diff --git a/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml b/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml index 7c6b0958a78a..2bdb50066496 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml +++ b/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml @@ -329,6 +329,28 @@ + + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse + + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse#Multiple + + + + + + + + + + + + ValidationStatus + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PrivateEndpointConnection @@ -653,6 +675,46 @@ + + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpProperties + + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpProperties#Multiple + + + + + + + + + + + + + + + + + + + + + AutoScalePolicyEnforcement + + + CapacityUnitScaleUpLimitTiB + + + IncreaseCapacityUnitByTiB + + + UnusedSizeTiB + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Sku diff --git a/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.psd1 b/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.psd1 index df670c3e3189..d1aa3f0665b2 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.psd1 +++ b/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ElasticSan.private.dll' FormatsToProcess = './Az.ElasticSan.format.ps1xml' - FunctionsToExport = 'Add-AzElasticSanVolumeGroupNetworkRule', 'Get-AzElasticSan', 'Get-AzElasticSanSkuList', 'Get-AzElasticSanVolume', 'Get-AzElasticSanVolumeGroup', 'Get-AzElasticSanVolumeSnapshot', 'New-AzElasticSan', 'New-AzElasticSanVirtualNetworkRuleObject', 'New-AzElasticSanVolume', 'New-AzElasticSanVolumeGroup', 'New-AzElasticSanVolumeSnapshot', 'Remove-AzElasticSan', 'Remove-AzElasticSanVolume', 'Remove-AzElasticSanVolumeGroup', 'Remove-AzElasticSanVolumeGroupNetworkRule', 'Remove-AzElasticSanVolumeSnapshot', 'Update-AzElasticSan', 'Update-AzElasticSanVolume', 'Update-AzElasticSanVolumeGroup' + FunctionsToExport = 'Add-AzElasticSanVolumeGroupNetworkRule', 'Get-AzElasticSan', 'Get-AzElasticSanSkuList', 'Get-AzElasticSanVolume', 'Get-AzElasticSanVolumeGroup', 'Get-AzElasticSanVolumeSnapshot', 'New-AzElasticSan', 'New-AzElasticSanVirtualNetworkRuleObject', 'New-AzElasticSanVolume', 'New-AzElasticSanVolumeGroup', 'New-AzElasticSanVolumeSnapshot', 'Remove-AzElasticSan', 'Remove-AzElasticSanVolume', 'Remove-AzElasticSanVolumeGroup', 'Remove-AzElasticSanVolumeGroupNetworkRule', 'Remove-AzElasticSanVolumeSnapshot', 'Test-AzElasticSanVolumeBackup', 'Test-AzElasticSanVolumeRestore', 'Update-AzElasticSan', 'Update-AzElasticSanVolume', 'Update-AzElasticSanVolumeGroup' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ElasticSan' diff --git a/generated/ElasticSan/ElasticSan.Autorest/Properties/AssemblyInfo.cs b/generated/ElasticSan/ElasticSan.Autorest/Properties/AssemblyInfo.cs index 0582c863dbca..51665853a8d9 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/Properties/AssemblyInfo.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ElasticSan")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.4.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.4.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.4.1")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.4.1")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/ElasticSan/ElasticSan.Autorest/exports/New-AzElasticSan.ps1 b/generated/ElasticSan/ElasticSan.Autorest/exports/New-AzElasticSan.ps1 index 84d3e905b78e..bb30a53a948c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/exports/New-AzElasticSan.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/exports/New-AzElasticSan.ps1 @@ -20,7 +20,7 @@ Create ElasticSan. .Description Create ElasticSan. .Example -New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -89,6 +89,31 @@ param( # The sku name. ${SkuName}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Enable or Disable scale up setting on Elastic San Appliance. + ${AutoScalePolicyEnforcement}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Maximum scale up size on Elastic San appliance in TiB. + ${CapacityUnitScaleUpLimitTiB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unit to increase Capacity Unit on Elastic San appliance in TiB. + ${IncreaseCapacityUnitByTiB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unused size on Elastic San appliance in TiB. + ${UnusedSizeTiB}, + [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] diff --git a/generated/ElasticSan/ElasticSan.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/ElasticSan/ElasticSan.Autorest/exports/ProxyCmdletDefinitions.ps1 index 5ba716421282..8f6224684989 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -2780,6 +2780,598 @@ end { } } +<# +.Synopsis +Validate whether a disk snapshot backup can be taken for list of volumes. +.Description +Validate whether a disk snapshot backup can be taken for list of volumes. +.Example +Test-AzElasticSanVolumeBackup -ResourceGroupName myresourcegroup -ElasticSanName myelasticsan -VolumeGroupName myvolumegroup -VolumeName myvolume + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse +.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. + +ELASTICSANINPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +INPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +PARAMETER : object to hold array of volume names + VolumeName >: array of volume names +.Link +https://learn.microsoft.com/powershell/module/az.elasticsan/test-azelasticsanvolumebackup +#> +function Test-AzElasticSanVolumeBackup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse])] +[CmdletBinding(DefaultParameterSetName='BackupExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Backup', Mandatory)] + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the ElasticSan. + ${ElasticSanName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Backup')] + [Parameter(ParameterSetName='BackupExpanded')] + [Parameter(ParameterSetName='BackupViaJsonFilePath')] + [Parameter(ParameterSetName='BackupViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSan', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the VolumeGroup. + ${VolumeGroupName}, + + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='BackupViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSanExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${ElasticSanInputObject}, + + [Parameter(ParameterSetName='Backup', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList] + # object to hold array of volume names + ${Parameter}, + + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String[]] + # array of volume names + ${VolumeName}, + + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Path of Json file supplied to the Backup operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Json string supplied to the Backup operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Backup = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_Backup'; + BackupExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupExpanded'; + BackupViaIdentity = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentity'; + BackupViaIdentityElasticSan = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentityElasticSan'; + BackupViaIdentityElasticSanExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded'; + BackupViaIdentityExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentityExpanded'; + BackupViaJsonFilePath = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaJsonFilePath'; + BackupViaJsonString = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaJsonString'; + } + if (('Backup', 'BackupExpanded', 'BackupViaJsonFilePath', 'BackupViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. +.Description +Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. +.Example +Test-AzElasticSanVolumeRestore -ResourceGroupName myresourcegroup -ElasticSanName myelasticsan -VolumeGroupName myvolumegroup -DiskSnapshotId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Compute/snapshots/mydisksnapshot" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse +.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. + +ELASTICSANINPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +INPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +PARAMETER : object to hold array of Disk Snapshot ARM IDs + DiskSnapshotId >: array of DiskSnapshot ARM IDs +.Link +https://learn.microsoft.com/powershell/module/az.elasticsan/test-azelasticsanvolumerestore +#> +function Test-AzElasticSanVolumeRestore { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse])] +[CmdletBinding(DefaultParameterSetName='RestoreExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the ElasticSan. + ${ElasticSanName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Restore')] + [Parameter(ParameterSetName='RestoreExpanded')] + [Parameter(ParameterSetName='RestoreViaJsonFilePath')] + [Parameter(ParameterSetName='RestoreViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSan', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the VolumeGroup. + ${VolumeGroupName}, + + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='RestoreViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSanExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${ElasticSanInputObject}, + + [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList] + # object to hold array of Disk Snapshot ARM IDs + ${Parameter}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String[]] + # array of DiskSnapshot ARM IDs + ${DiskSnapshotId}, + + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Path of Json file supplied to the Restore operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Json string supplied to the Restore operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Restore = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_Restore'; + RestoreExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreExpanded'; + RestoreViaIdentity = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentity'; + RestoreViaIdentityElasticSan = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentityElasticSan'; + RestoreViaIdentityElasticSanExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded'; + RestoreViaIdentityExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentityExpanded'; + RestoreViaJsonFilePath = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaJsonFilePath'; + RestoreViaJsonString = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaJsonString'; + } + if (('Restore', 'RestoreExpanded', 'RestoreViaJsonFilePath', 'RestoreViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + <# .Synopsis Update an Volume. @@ -3060,7 +3652,7 @@ Update a Elastic San. .Description Update a Elastic San. .Example -$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 64 -ExtendedCapacitySizeTib 128 -Tag @{"tag3" = "value3"} +$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 5 -ExtendedCapacitySizeTib 20 -Tag @{"tag3" = "value3"} -CapacityUnitScaleUpLimitTiB 20 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 5 -AutoScalePolicyEnforcement Disabled .Inputs Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity @@ -3114,18 +3706,37 @@ param( # Identity Parameter ${InputObject}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Enable or Disable scale up setting on Elastic San Appliance. + ${AutoScalePolicyEnforcement}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] [System.Int64] # Base size of the Elastic San appliance in TiB. ${BaseSizeTiB}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Maximum scale up size on Elastic San appliance in TiB. + ${CapacityUnitScaleUpLimitTiB}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] [System.Int64] # Extended size of the Elastic San appliance in TiB. ${ExtendedCapacitySizeTiB}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unit to increase Capacity Unit on Elastic San appliance in TiB. + ${IncreaseCapacityUnitByTiB}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] @@ -3141,6 +3752,12 @@ param( # Update tags ${Tag}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unused size on Elastic San appliance in TiB. + ${UnusedSizeTiB}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3539,7 +4156,7 @@ Create ElasticSan. .Description Create ElasticSan. .Example -New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -3608,6 +4225,31 @@ param( # The sku name. ${SkuName}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Enable or Disable scale up setting on Elastic San Appliance. + ${AutoScalePolicyEnforcement}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Maximum scale up size on Elastic San appliance in TiB. + ${CapacityUnitScaleUpLimitTiB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unit to increase Capacity Unit on Elastic San appliance in TiB. + ${IncreaseCapacityUnitByTiB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unused size on Elastic San appliance in TiB. + ${UnusedSizeTiB}, + [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] diff --git a/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeBackup.ps1 b/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeBackup.ps1 new file mode 100644 index 000000000000..487ef8387a70 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeBackup.ps1 @@ -0,0 +1,311 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Validate whether a disk snapshot backup can be taken for list of volumes. +.Description +Validate whether a disk snapshot backup can be taken for list of volumes. +.Example +Test-AzElasticSanVolumeBackup -ResourceGroupName myresourcegroup -ElasticSanName myelasticsan -VolumeGroupName myvolumegroup -VolumeName myvolume + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse +.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. + +ELASTICSANINPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +INPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +PARAMETER : object to hold array of volume names + VolumeName >: array of volume names +.Link +https://learn.microsoft.com/powershell/module/az.elasticsan/test-azelasticsanvolumebackup +#> +function Test-AzElasticSanVolumeBackup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse])] +[CmdletBinding(DefaultParameterSetName='BackupExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Backup', Mandatory)] + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the ElasticSan. + ${ElasticSanName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Backup')] + [Parameter(ParameterSetName='BackupExpanded')] + [Parameter(ParameterSetName='BackupViaJsonFilePath')] + [Parameter(ParameterSetName='BackupViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSan', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the VolumeGroup. + ${VolumeGroupName}, + + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='BackupViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSanExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${ElasticSanInputObject}, + + [Parameter(ParameterSetName='Backup', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList] + # object to hold array of volume names + ${Parameter}, + + [Parameter(ParameterSetName='BackupExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='BackupViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String[]] + # array of volume names + ${VolumeName}, + + [Parameter(ParameterSetName='BackupViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Path of Json file supplied to the Backup operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='BackupViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Json string supplied to the Backup operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Backup = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_Backup'; + BackupExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupExpanded'; + BackupViaIdentity = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentity'; + BackupViaIdentityElasticSan = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentityElasticSan'; + BackupViaIdentityElasticSanExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded'; + BackupViaIdentityExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaIdentityExpanded'; + BackupViaJsonFilePath = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaJsonFilePath'; + BackupViaJsonString = 'Az.ElasticSan.private\Test-AzElasticSanVolumeBackup_BackupViaJsonString'; + } + if (('Backup', 'BackupExpanded', 'BackupViaJsonFilePath', 'BackupViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeRestore.ps1 b/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeRestore.ps1 new file mode 100644 index 000000000000..93dd1cd337c8 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeRestore.ps1 @@ -0,0 +1,311 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. +.Description +Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. +.Example +Test-AzElasticSanVolumeRestore -ResourceGroupName myresourcegroup -ElasticSanName myelasticsan -VolumeGroupName myvolumegroup -DiskSnapshotId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Compute/snapshots/mydisksnapshot" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse +.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. + +ELASTICSANINPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +INPUTOBJECT : Identity Parameter + [ElasticSanName ]: The name of the ElasticSan. + [Id ]: Resource identity path + [PrivateEndpointConnectionName ]: The name of the Private Endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SnapshotName ]: The name of the volume snapshot within the given volume group. + [SubscriptionId ]: The ID of the target subscription. + [VolumeGroupName ]: The name of the VolumeGroup. + [VolumeName ]: The name of the Volume. + +PARAMETER : object to hold array of Disk Snapshot ARM IDs + DiskSnapshotId >: array of DiskSnapshot ARM IDs +.Link +https://learn.microsoft.com/powershell/module/az.elasticsan/test-azelasticsanvolumerestore +#> +function Test-AzElasticSanVolumeRestore { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse])] +[CmdletBinding(DefaultParameterSetName='RestoreExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the ElasticSan. + ${ElasticSanName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Restore')] + [Parameter(ParameterSetName='RestoreExpanded')] + [Parameter(ParameterSetName='RestoreViaJsonFilePath')] + [Parameter(ParameterSetName='RestoreViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSan', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [System.String] + # The name of the VolumeGroup. + ${VolumeGroupName}, + + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='RestoreViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSanExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity] + # Identity Parameter + ${ElasticSanInputObject}, + + [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSan', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList] + # object to hold array of Disk Snapshot ARM IDs + ${Parameter}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityElasticSanExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String[]] + # array of DiskSnapshot ARM IDs + ${DiskSnapshotId}, + + [Parameter(ParameterSetName='RestoreViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Path of Json file supplied to the Restore operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RestoreViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Json string supplied to the Restore operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Restore = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_Restore'; + RestoreExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreExpanded'; + RestoreViaIdentity = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentity'; + RestoreViaIdentityElasticSan = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentityElasticSan'; + RestoreViaIdentityElasticSanExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded'; + RestoreViaIdentityExpanded = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaIdentityExpanded'; + RestoreViaJsonFilePath = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaJsonFilePath'; + RestoreViaJsonString = 'Az.ElasticSan.private\Test-AzElasticSanVolumeRestore_RestoreViaJsonString'; + } + if (('Restore', 'RestoreExpanded', 'RestoreViaJsonFilePath', 'RestoreViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/ElasticSan/ElasticSan.Autorest/exports/Update-AzElasticSan.ps1 b/generated/ElasticSan/ElasticSan.Autorest/exports/Update-AzElasticSan.ps1 index 6a3a837fc28a..849653ff0ca9 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/exports/Update-AzElasticSan.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/exports/Update-AzElasticSan.ps1 @@ -20,7 +20,7 @@ Update a Elastic San. .Description Update a Elastic San. .Example -$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 64 -ExtendedCapacitySizeTib 128 -Tag @{"tag3" = "value3"} +$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 5 -ExtendedCapacitySizeTib 20 -Tag @{"tag3" = "value3"} -CapacityUnitScaleUpLimitTiB 20 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 5 -AutoScalePolicyEnforcement Disabled .Inputs Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity @@ -74,18 +74,37 @@ param( # Identity Parameter ${InputObject}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Enable or Disable scale up setting on Elastic San Appliance. + ${AutoScalePolicyEnforcement}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] [System.Int64] # Base size of the Elastic San appliance in TiB. ${BaseSizeTiB}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Maximum scale up size on Elastic San appliance in TiB. + ${CapacityUnitScaleUpLimitTiB}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] [System.Int64] # Extended size of the Elastic San appliance in TiB. ${ExtendedCapacitySizeTiB}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unit to increase Capacity Unit on Elastic San appliance in TiB. + ${IncreaseCapacityUnitByTiB}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] @@ -101,6 +120,12 @@ param( # Update tags ${Tag}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unused size on Elastic San appliance in TiB. + ${UnusedSizeTiB}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] diff --git a/generated/ElasticSan/ElasticSan.Autorest/generate-info.json b/generated/ElasticSan/ElasticSan.Autorest/generate-info.json index 6d70c48f8961..724c91d9bc61 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generate-info.json +++ b/generated/ElasticSan/ElasticSan.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "4e88cd60-3085-4c80-bdb3-7249b0b6dc90" + "generate_Id": "d4a443b3-a298-4cd8-afa8-fc88ee8e9513" } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs index 35a151849d6e..d059f33e42c8 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan /// /// Low-level API implementation for the ElasticSan service. + /// (missing-service-description) Add service description /// public partial class ElasticSan { @@ -29,7 +30,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansCreate(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -76,7 +77,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -133,7 +134,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -193,7 +194,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansCreateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -239,7 +240,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -286,7 +287,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansCreateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -660,7 +661,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansDelete(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -702,7 +703,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansDeleteViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -936,7 +937,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansGet(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -979,7 +980,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansGetViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1032,7 +1033,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1087,7 +1088,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansGetWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1266,7 +1267,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListByResourceGroup(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1306,7 +1307,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListByResourceGroupViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1355,7 +1356,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1405,7 +1406,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1579,7 +1580,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1617,7 +1618,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListBySubscriptionViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1663,7 +1664,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1709,7 +1710,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1881,7 +1882,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansUpdate(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1928,7 +1929,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1985,7 +1986,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2045,7 +2046,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansUpdateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2091,7 +2092,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2138,7 +2139,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task ElasticSansUpdateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2497,7 +2498,7 @@ public partial class ElasticSan } } - /// Gets a list of ElasticSan operations. + /// List the operations for the provider /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2508,7 +2509,7 @@ public partial class ElasticSan /// 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2532,7 +2533,7 @@ public partial class ElasticSan } } - /// Gets a list of ElasticSan operations. + /// List the operations for the provider /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2544,7 +2545,7 @@ public partial class ElasticSan /// 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2577,7 +2578,7 @@ public partial class ElasticSan } } - /// Gets a list of ElasticSan operations. + /// List the operations for the provider /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync pipeline to use to make the request. @@ -2587,7 +2588,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2620,7 +2621,7 @@ public partial class ElasticSan } } - /// Gets a list of ElasticSan operations. + /// List the operations for the provider /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync pipeline to use to make the request. /// @@ -2629,7 +2630,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2798,7 +2799,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreate(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2849,7 +2850,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2911,7 +2912,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2977,7 +2978,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3028,7 +3029,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3080,7 +3081,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3463,7 +3464,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3509,7 +3510,7 @@ public partial class ElasticSan /// 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3747,7 +3748,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3790,7 +3791,7 @@ public partial class ElasticSan /// 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3844,7 +3845,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3901,7 +3902,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4087,7 +4088,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4129,7 +4130,7 @@ public partial class ElasticSan /// 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4181,7 +4182,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4235,7 +4236,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4418,7 +4419,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByElasticSan(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4460,7 +4461,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByElasticSanViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4512,7 +4513,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByElasticSanViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4566,7 +4567,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByElasticSanWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4750,7 +4751,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task SkusList(string subscriptionId, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4791,7 +4792,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task SkusListViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4840,7 +4841,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task SkusListViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4889,7 +4890,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task SkusListWithResult(string subscriptionId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5064,7 +5065,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsCreate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5113,7 +5114,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5173,7 +5174,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5237,7 +5238,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsCreateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5286,7 +5287,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5336,7 +5337,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsCreateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5718,7 +5719,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsDelete(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5762,7 +5763,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsDeleteViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6005,7 +6006,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsGet(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6050,7 +6051,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsGetViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6106,7 +6107,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6165,7 +6166,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsGetWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6352,7 +6353,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsListByElasticSan(string subscriptionId, string resourceGroupName, string elasticSanName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6364,7 +6365,7 @@ public partial class ElasticSan + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ElasticSan/elasticSans/" + global::System.Uri.EscapeDataString(elasticSanName) - + "/volumeGroups" + + "/volumegroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6394,16 +6395,16 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsListByElasticSanViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/(?[^/]+)/volumeGroups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ElasticSan/elasticSans/(?[^/]+)/volumegroups$", 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.ElasticSan/elasticSans/{elasticSanName}/volumeGroups'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups'"); } // replace URI parameters with values from identity @@ -6418,7 +6419,7 @@ public partial class ElasticSan + resourceGroupName + "/providers/Microsoft.ElasticSan/elasticSans/" + elasticSanName - + "/volumeGroups" + + "/volumegroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6446,16 +6447,16 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsListByElasticSanViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/(?[^/]+)/volumeGroups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ElasticSan/elasticSans/(?[^/]+)/volumegroups$", 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.ElasticSan/elasticSans/{elasticSanName}/volumeGroups'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups'"); } // replace URI parameters with values from identity @@ -6470,7 +6471,7 @@ public partial class ElasticSan + resourceGroupName + "/providers/Microsoft.ElasticSan/elasticSans/" + elasticSanName - + "/volumeGroups" + + "/volumegroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6500,7 +6501,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsListByElasticSanWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6512,7 +6513,7 @@ public partial class ElasticSan + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ElasticSan/elasticSans/" + global::System.Uri.EscapeDataString(elasticSanName) - + "/volumeGroups" + + "/volumegroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6686,7 +6687,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsUpdate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6735,7 +6736,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6795,7 +6796,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6859,7 +6860,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6908,7 +6909,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6958,7 +6959,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeGroupsUpdateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7342,7 +7343,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsCreate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7393,7 +7394,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7456,7 +7457,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7524,7 +7525,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsCreateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7576,7 +7577,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7629,7 +7630,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsCreateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8019,7 +8020,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsDelete(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8065,7 +8066,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsDeleteViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8315,7 +8316,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsGet(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8360,7 +8361,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsGetViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8417,7 +8418,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8478,7 +8479,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsGetWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string snapshotName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8676,7 +8677,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsListByVolumeGroup(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8692,9 +8693,9 @@ public partial class ElasticSan + global::System.Uri.EscapeDataString(volumeGroupName) + "/snapshots" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8725,7 +8726,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsListByVolumeGroupViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8754,9 +8755,9 @@ public partial class ElasticSan + volumeGroupName + "/snapshots" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8785,7 +8786,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsListByVolumeGroupViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8814,9 +8815,9 @@ public partial class ElasticSan + volumeGroupName + "/snapshots" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -8848,7 +8849,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumeSnapshotsListByVolumeGroupWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8864,9 +8865,9 @@ public partial class ElasticSan + global::System.Uri.EscapeDataString(volumeGroupName) + "/snapshots" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -9046,7 +9047,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesCreate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9097,7 +9098,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9160,7 +9161,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9228,7 +9229,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesCreateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9280,7 +9281,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9333,7 +9334,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesCreateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9727,7 +9728,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesDelete(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, string xMSDeleteSnapshots, string xMSForceDelete, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9787,7 +9788,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesDeleteViaIdentity(global::System.String viaIdentity, string xMSDeleteSnapshots, string xMSForceDelete, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10055,7 +10056,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesGet(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10102,7 +10103,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesGetViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10161,7 +10162,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10224,7 +10225,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesGetWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10419,7 +10420,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesListByVolumeGroup(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10463,7 +10464,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesListByVolumeGroupViaIdentity(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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10518,7 +10519,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesListByVolumeGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10576,7 +10577,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesListByVolumeGroupWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10750,6 +10751,1350 @@ public partial class ElasticSan } } + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Volume Name List (currently only one volume name in the list is supported. Server would return error + /// if list is bigger) + /// a delegate that is called 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.ElasticSan.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 VolumesPreBackup(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preBackup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesPreBackup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// Volume Name List (currently only one volume name in the list is supported. Server would return error + /// if list is bigger) + /// a delegate that is called 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.ElasticSan.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 VolumesPreBackupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/(?[^/]+)/volumegroups/(?[^/]+)$", 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.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var elasticSanName = _match.Groups["elasticSanName"].Value; + var volumeGroupName = _match.Groups["volumeGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ElasticSan/elasticSans/" + + elasticSanName + + "/volumegroups/" + + volumeGroupName + + "/preBackup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesPreBackup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// Volume Name List (currently only one volume name in the list is supported. Server would return error + /// if list is bigger) + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 VolumesPreBackupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/(?[^/]+)/volumegroups/(?[^/]+)$", 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.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var elasticSanName = _match.Groups["elasticSanName"].Value; + var volumeGroupName = _match.Groups["volumeGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ElasticSan/elasticSans/" + + elasticSanName + + "/volumegroups/" + + volumeGroupName + + "/preBackup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesPreBackupWithResult_Call (request, eventListener,sender); + } + } + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Json string supplied to the VolumesPreBackup 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.ElasticSan.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 VolumesPreBackupViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preBackup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesPreBackup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Json string supplied to the VolumesPreBackup operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 VolumesPreBackupViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preBackup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesPreBackupWithResult_Call (request, eventListener,sender); + } + } + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Volume Name List (currently only one volume name in the list is supported. Server would return error + /// if list is bigger) + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 VolumesPreBackupWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preBackup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesPreBackupWithResult_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.ElasticSan.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 VolumesPreBackupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.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 VolumesPreBackup_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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Volume Name List (currently only one volume name in the list is supported. Server would return error + /// if list is bigger) + /// 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 VolumesPreBackup_Validate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(elasticSanName),elasticSanName); + await eventListener.AssertMinimumLength(nameof(elasticSanName),elasticSanName,3); + await eventListener.AssertMaximumLength(nameof(elasticSanName),elasticSanName,24); + await eventListener.AssertRegEx(nameof(elasticSanName), elasticSanName, @"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"); + await eventListener.AssertNotNull(nameof(volumeGroupName),volumeGroupName); + await eventListener.AssertMinimumLength(nameof(volumeGroupName),volumeGroupName,3); + await eventListener.AssertMaximumLength(nameof(volumeGroupName),volumeGroupName,63); + await eventListener.AssertRegEx(nameof(volumeGroupName), volumeGroupName, @"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Disk Snapshot List (currently only one Disk Snapshot in the list is supported and that the Disk Snapshot + /// must be in same azure region as the ElasticSan. Server would return error if list is bigger) + /// a delegate that is called 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.ElasticSan.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 VolumesPreRestore(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preRestore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesPreRestore_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// Disk Snapshot List (currently only one Disk Snapshot in the list is supported and that the Disk Snapshot + /// must be in same azure region as the ElasticSan. Server would return error if list is bigger) + /// a delegate that is called 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.ElasticSan.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 VolumesPreRestoreViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/(?[^/]+)/volumegroups/(?[^/]+)$", 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.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var elasticSanName = _match.Groups["elasticSanName"].Value; + var volumeGroupName = _match.Groups["volumeGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ElasticSan/elasticSans/" + + elasticSanName + + "/volumegroups/" + + volumeGroupName + + "/preRestore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesPreRestore_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// Disk Snapshot List (currently only one Disk Snapshot in the list is supported and that the Disk Snapshot + /// must be in same azure region as the ElasticSan. Server would return error if list is bigger) + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 VolumesPreRestoreViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/(?[^/]+)/volumegroups/(?[^/]+)$", 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.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var elasticSanName = _match.Groups["elasticSanName"].Value; + var volumeGroupName = _match.Groups["volumeGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ElasticSan/elasticSans/" + + elasticSanName + + "/volumegroups/" + + volumeGroupName + + "/preRestore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesPreRestoreWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Json string supplied to the VolumesPreRestore 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.ElasticSan.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 VolumesPreRestoreViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preRestore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesPreRestore_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Json string supplied to the VolumesPreRestore operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 VolumesPreRestoreViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preRestore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesPreRestoreWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Disk Snapshot List (currently only one Disk Snapshot in the list is supported and that the Disk Snapshot + /// must be in same azure region as the ElasticSan. Server would return error if list is bigger) + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 VolumesPreRestoreWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-09-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.ElasticSan/elasticSans/" + + global::System.Uri.EscapeDataString(elasticSanName) + + "/volumegroups/" + + global::System.Uri.EscapeDataString(volumeGroupName) + + "/preRestore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesPreRestoreWithResult_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.ElasticSan.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 VolumesPreRestoreWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.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 VolumesPreRestore_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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the VolumeGroup. + /// Disk Snapshot List (currently only one Disk Snapshot in the list is supported and that the Disk Snapshot + /// must be in same azure region as the ElasticSan. Server would return error if list is bigger) + /// 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 VolumesPreRestore_Validate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(elasticSanName),elasticSanName); + await eventListener.AssertMinimumLength(nameof(elasticSanName),elasticSanName,3); + await eventListener.AssertMaximumLength(nameof(elasticSanName),elasticSanName,24); + await eventListener.AssertRegEx(nameof(elasticSanName), elasticSanName, @"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"); + await eventListener.AssertNotNull(nameof(volumeGroupName),volumeGroupName); + await eventListener.AssertMinimumLength(nameof(volumeGroupName),volumeGroupName,3); + await eventListener.AssertMaximumLength(nameof(volumeGroupName),volumeGroupName,63); + await eventListener.AssertRegEx(nameof(volumeGroupName), volumeGroupName, @"^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + /// update an Volume. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -10768,7 +12113,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesUpdate(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10819,7 +12164,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10882,7 +12227,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10950,7 +12295,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, 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.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11002,7 +12347,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11055,7 +12400,7 @@ public partial class ElasticSan /// public async global::System.Threading.Tasks.Task VolumesUpdateWithResult(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-01"; + var apiVersion = @"2025-09-01"; // Constant Parameters using( NoSynchronizationContext ) { diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.PowerShell.cs new file mode 100644 index 000000000000..01e42b9053ef --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// The auto scale settings on Elastic San Appliance. + [System.ComponentModel.TypeConverter(typeof(AutoScalePropertiesTypeConverter))] + public partial class AutoScaleProperties + { + + /// + /// 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 AutoScaleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).ScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("ScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).ScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).AutoScalePolicyEnforcement, 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 AutoScaleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).ScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("ScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).ScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)this).AutoScalePolicyEnforcement, 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.ElasticSan.Models.IAutoScaleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AutoScaleProperties(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.ElasticSan.Models.IAutoScaleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AutoScaleProperties(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.ElasticSan.Models.IAutoScaleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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 auto scale settings on Elastic San Appliance. + [System.ComponentModel.TypeConverter(typeof(AutoScalePropertiesTypeConverter))] + public partial interface IAutoScaleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.TypeConverter.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.TypeConverter.cs new file mode 100644 index 000000000000..660d7f846b77 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AutoScalePropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AutoScaleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AutoScaleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AutoScaleProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.cs new file mode 100644 index 000000000000..ecac46fe18ed --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// The auto scale settings on Elastic San Appliance. + public partial class AutoScaleProperties : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal + { + + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public string AutoScalePolicyEnforcement { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).AutoScalePolicyEnforcement; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).AutoScalePolicyEnforcement = value ?? null; } + + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? CapacityUnitScaleUpLimitTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).CapacityUnitScaleUpLimitTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).CapacityUnitScaleUpLimitTiB = value ?? default(long); } + + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? IncreaseCapacityUnitByTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).IncreaseCapacityUnitByTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).IncreaseCapacityUnitByTiB = value ?? default(long); } + + /// Internal Acessors for ScaleUpProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal.ScaleUpProperty { get => (this._scaleUpProperty = this._scaleUpProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpProperties()); set { {_scaleUpProperty = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties _scaleUpProperty; + + /// Scale up settings on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties ScaleUpProperty { get => (this._scaleUpProperty = this._scaleUpProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpProperties()); set => this._scaleUpProperty = value; } + + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? UnusedSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).UnusedSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)ScaleUpProperty).UnusedSizeTiB = value ?? default(long); } + + /// Creates an new instance. + public AutoScaleProperties() + { + + } + } + /// The auto scale settings on Elastic San Appliance. + public partial interface IAutoScaleProperties : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable + { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUnitScaleUpLimitTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + long? IncreaseCapacityUnitByTiB { get; set; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + long? UnusedSizeTiB { get; set; } + + } + /// The auto scale settings on Elastic San Appliance. + internal partial interface IAutoScalePropertiesInternal + + { + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + long? CapacityUnitScaleUpLimitTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + long? IncreaseCapacityUnitByTiB { get; set; } + /// Scale up settings on Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties ScaleUpProperty { get; set; } + /// Unused size on Elastic San appliance in TiB. + long? UnusedSizeTiB { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.json.cs new file mode 100644 index 000000000000..d449fcea2179 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// The auto scale settings on Elastic San Appliance. + public partial class AutoScaleProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject instance to deserialize from. + internal AutoScaleProperties(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scaleUpProperty = If( json?.PropertyT("scaleUpProperties"), out var __jsonScaleUpProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpProperties.FromJson(__jsonScaleUpProperties) : _scaleUpProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json ? new AutoScaleProperties(json) : null; + } + + /// + /// 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 . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._scaleUpProperty ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) this._scaleUpProperty.ToJson(null,serializationMode) : null, "scaleUpProperties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.PowerShell.cs new file mode 100644 index 000000000000..b89796cf77ea --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// object to hold array of Disk Snapshot ARM IDs + [System.ComponentModel.TypeConverter(typeof(DiskSnapshotListTypeConverter))] + public partial class DiskSnapshotList + { + + /// + /// 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.ElasticSan.Models.IDiskSnapshotList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiskSnapshotList(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.ElasticSan.Models.IDiskSnapshotList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiskSnapshotList(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiskSnapshotList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskSnapshotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotListInternal)this).DiskSnapshotId = (System.Collections.Generic.List) content.GetValueForProperty("DiskSnapshotId",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotListInternal)this).DiskSnapshotId, __y => TypeConverterExtensions.SelectToList(__y, 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 DiskSnapshotList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskSnapshotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotListInternal)this).DiskSnapshotId = (System.Collections.Generic.List) content.GetValueForProperty("DiskSnapshotId",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotListInternal)this).DiskSnapshotId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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(); + } + } + /// object to hold array of Disk Snapshot ARM IDs + [System.ComponentModel.TypeConverter(typeof(DiskSnapshotListTypeConverter))] + public partial interface IDiskSnapshotList + + { + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.TypeConverter.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.TypeConverter.cs new file mode 100644 index 000000000000..a6536f3a846e --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiskSnapshotListTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiskSnapshotList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiskSnapshotList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiskSnapshotList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.cs new file mode 100644 index 000000000000..35f8f0086183 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// object to hold array of Disk Snapshot ARM IDs + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.DoNotFormat] + public partial class DiskSnapshotList : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotListInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _diskSnapshotId; + + /// array of DiskSnapshot ARM IDs + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public System.Collections.Generic.List DiskSnapshotId { get => this._diskSnapshotId; set => this._diskSnapshotId = value; } + + /// Creates an new instance. + public DiskSnapshotList() + { + + } + } + /// object to hold array of Disk Snapshot ARM IDs + public partial interface IDiskSnapshotList : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable + { + /// array of DiskSnapshot ARM IDs + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"array of DiskSnapshot ARM IDs", + SerializedName = @"diskSnapshotIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List DiskSnapshotId { get; set; } + + } + /// object to hold array of Disk Snapshot ARM IDs + internal partial interface IDiskSnapshotListInternal + + { + /// array of DiskSnapshot ARM IDs + System.Collections.Generic.List DiskSnapshotId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.json.cs new file mode 100644 index 000000000000..1755baff57b8 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// object to hold array of Disk Snapshot ARM IDs + public partial class DiskSnapshotList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject instance to deserialize from. + internal DiskSnapshotList(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_diskSnapshotId = If( json?.PropertyT("diskSnapshotIds"), out var __jsonDiskSnapshotIds) ? If( __jsonDiskSnapshotIds as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _diskSnapshotId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json ? new DiskSnapshotList(json) : null; + } + + /// + /// 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 . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._diskSnapshotId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.XNodeArray(); + foreach( var __x in this._diskSnapshotId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("diskSnapshotIds",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.PowerShell.cs index cce3ff4925c1..f849011c3e29 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.PowerShell.cs @@ -158,6 +158,10 @@ internal ElasticSan(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.SkuTypeConverter.ConvertFrom); } + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("AvailabilityZone")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -210,6 +214,26 @@ internal ElasticSan(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).SkuTier, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializeDictionary(content); } @@ -283,6 +307,10 @@ internal ElasticSan(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.SkuTypeConverter.ConvertFrom); } + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("AvailabilityZone")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -335,6 +363,26 @@ internal ElasticSan(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).SkuTier, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializePSObject(content); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.cs index c89f036c2eb2..1cbf7a581df0 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.cs @@ -19,6 +19,10 @@ public partial class ElasticSan : /// private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.TrackedResource(); + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public string AutoScalePolicyEnforcement { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AutoScalePolicyEnforcement; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AutoScalePolicyEnforcement = value ?? null; } + /// Logical zone for Elastic San resource; example: ["1"]. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] public System.Collections.Generic.List AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AvailabilityZone = value ?? null /* arrayOf */; } @@ -27,6 +31,10 @@ public partial class ElasticSan : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] public long? BaseSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).BaseSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).BaseSizeTiB = value ?? default(long); } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? CapacityUnitScaleUpLimitTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).CapacityUnitScaleUpLimitTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).CapacityUnitScaleUpLimitTiB = value ?? default(long); } + /// Extended size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] public long? ExtendedCapacitySizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).ExtendedCapacitySizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).ExtendedCapacitySizeTiB = value ?? default(long); } @@ -37,10 +45,20 @@ public partial class ElasticSan : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__trackedResource).Id; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? IncreaseCapacityUnitByTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).IncreaseCapacityUnitByTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).IncreaseCapacityUnitByTiB = value ?? default(long); } + /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + /// Internal Acessors for AutoScaleProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal.AutoScaleProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AutoScaleProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AutoScaleProperty = value ?? null /* model class */; } + + /// Internal Acessors for AutoScalePropertyScaleUpProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal.AutoScalePropertyScaleUpProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AutoScalePropertyScaleUpProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).AutoScalePropertyScaleUpProperty = value ?? null /* model class */; } + /// Internal Acessors for PrivateEndpointConnection System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } @@ -191,6 +209,10 @@ public partial class ElasticSan : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__trackedResource).Type; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? UnusedSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).UnusedSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).UnusedSizeTiB = value ?? default(long); } + /// Total number of volume groups in this Elastic San appliance. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] public long? VolumeGroupCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)Property).VolumeGroupCount; } @@ -218,6 +240,18 @@ public partial interface IElasticSan : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResource { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } /// Logical zone for Elastic San resource; example: ["1"]. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -240,6 +274,17 @@ public partial interface IElasticSan : SerializedName = @"baseSizeTiB", PossibleTypes = new [] { typeof(long) })] long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -251,6 +296,17 @@ public partial interface IElasticSan : SerializedName = @"extendedCapacitySizeTiB", PossibleTypes = new [] { typeof(long) })] long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + long? IncreaseCapacityUnitByTiB { get; set; } /// The list of Private Endpoint Connections. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -272,7 +328,7 @@ public partial interface IElasticSan : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -356,6 +412,17 @@ public partial interface IElasticSan : SerializedName = @"totalVolumeSizeGiB", PossibleTypes = new [] { typeof(long) })] long? TotalVolumeSizeGiB { get; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + long? UnusedSizeTiB { get; set; } /// Total number of volume groups in this Elastic San appliance. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -373,18 +440,29 @@ public partial interface IElasticSan : internal partial interface IElasticSanInternal : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Auto Scale Properties for Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties AutoScaleProperty { get; set; } + /// Scale up settings on Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties AutoScalePropertyScaleUpProperty { get; set; } /// Logical zone for Elastic San resource; example: ["1"]. System.Collections.Generic.List AvailabilityZone { get; set; } /// Base size of the Elastic San appliance in TiB. long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + long? IncreaseCapacityUnitByTiB { get; set; } /// The list of Private Endpoint Connections. System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// Properties of ElasticSan. Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanProperties Property { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -407,6 +485,8 @@ internal partial interface IElasticSanInternal : long? TotalSizeTiB { get; set; } /// Total size of the provisioned Volumes in GiB. long? TotalVolumeSizeGiB { get; set; } + /// Unused size on Elastic San appliance in TiB. + long? UnusedSizeTiB { get; set; } /// Total number of volume groups in this Elastic San appliance. long? VolumeGroupCount { get; set; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.PowerShell.cs index c79e6d44d1e0..ab715761cc75 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.PowerShell.cs @@ -113,6 +113,10 @@ internal ElasticSanIdentity(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).ElasticSanName = (string) content.GetValueForProperty("ElasticSanName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).ElasticSanName, global::System.Convert.ToString); } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } if (content.Contains("VolumeGroupName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeGroupName = (string) content.GetValueForProperty("VolumeGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeGroupName, global::System.Convert.ToString); @@ -121,10 +125,6 @@ internal ElasticSanIdentity(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeName = (string) content.GetValueForProperty("VolumeName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeName, global::System.Convert.ToString); } - if (content.Contains("PrivateEndpointConnectionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); - } if (content.Contains("SnapshotName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).SnapshotName = (string) content.GetValueForProperty("SnapshotName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).SnapshotName, global::System.Convert.ToString); @@ -162,6 +162,10 @@ internal ElasticSanIdentity(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).ElasticSanName = (string) content.GetValueForProperty("ElasticSanName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).ElasticSanName, global::System.Convert.ToString); } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } if (content.Contains("VolumeGroupName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeGroupName = (string) content.GetValueForProperty("VolumeGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeGroupName, global::System.Convert.ToString); @@ -170,10 +174,6 @@ internal ElasticSanIdentity(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeName = (string) content.GetValueForProperty("VolumeName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).VolumeName, global::System.Convert.ToString); } - if (content.Contains("PrivateEndpointConnectionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); - } if (content.Contains("SnapshotName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).SnapshotName = (string) content.GetValueForProperty("SnapshotName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentityInternal)this).SnapshotName, global::System.Convert.ToString); diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.json.cs index 7a1144b9a545..0bf920735e9e 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.json.cs @@ -67,9 +67,9 @@ internal ElasticSanIdentity(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtim {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} {_elasticSanName = If( json?.PropertyT("elasticSanName"), out var __jsonElasticSanName) ? (string)__jsonElasticSanName : (string)_elasticSanName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)_privateEndpointConnectionName;} {_volumeGroupName = If( json?.PropertyT("volumeGroupName"), out var __jsonVolumeGroupName) ? (string)__jsonVolumeGroupName : (string)_volumeGroupName;} {_volumeName = If( json?.PropertyT("volumeName"), out var __jsonVolumeName) ? (string)__jsonVolumeName : (string)_volumeName;} - {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)_privateEndpointConnectionName;} {_snapshotName = If( json?.PropertyT("snapshotName"), out var __jsonSnapshotName) ? (string)__jsonSnapshotName : (string)_snapshotName;} {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); @@ -109,9 +109,9 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); AddIf( null != (((object)this._elasticSanName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._elasticSanName.ToString()) : null, "elasticSanName" ,container.Add ); + AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); AddIf( null != (((object)this._volumeGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._volumeGroupName.ToString()) : null, "volumeGroupName" ,container.Add ); AddIf( null != (((object)this._volumeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._volumeName.ToString()) : null, "volumeName" ,container.Add ); - AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); AddIf( null != (((object)this._snapshotName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._snapshotName.ToString()) : null, "snapshotName" ,container.Add ); AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); AfterToJson(ref container); diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.cs index 67bbfc5f20af..b357195cc1f6 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.cs @@ -14,20 +14,17 @@ public partial class ElasticSanList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanListInternal { - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - /// Backing field for property. private string _nextLink; - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } + public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. private System.Collections.Generic.List _value; - /// An array of Elastic San objects. + /// The ElasticSan items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } @@ -41,25 +38,25 @@ public ElasticSanList() public partial interface IElasticSanList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = true, + ReadOnly = false, Read = true, - Create = false, - Update = false, - Description = @"URI to fetch the next section of the paginated response.", + Create = true, + Update = true, + Description = @"The link to the next page of items", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// An array of Elastic San objects. + string NextLink { get; set; } + /// The ElasticSan items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = false, + Required = true, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"An array of Elastic San objects.", + Description = @"The ElasticSan items on this page", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan) })] System.Collections.Generic.List Value { get; set; } @@ -69,9 +66,9 @@ public partial interface IElasticSanList : internal partial interface IElasticSanListInternal { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items string NextLink { get; set; } - /// An array of Elastic San objects. + /// The ElasticSan items on this page System.Collections.Generic.List Value { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.json.cs index 51bd4077b86f..b1efdd03a491 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.json.cs @@ -110,10 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.PowerShell.cs index 302653cf7f36..c08f36c4dea1 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.PowerShell.cs @@ -106,6 +106,10 @@ internal ElasticSanProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.SkuTypeConverter.ConvertFrom); } + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("AvailabilityZone")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -158,6 +162,26 @@ internal ElasticSanProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).SkuTier, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializeDictionary(content); } @@ -179,6 +203,10 @@ internal ElasticSanProperties(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.SkuTypeConverter.ConvertFrom); } + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("AvailabilityZone")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -231,6 +259,26 @@ internal ElasticSanProperties(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).SkuTier, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializePSObject(content); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.cs index cf9d1eac83d1..abb96c657799 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.cs @@ -14,6 +14,17 @@ public partial class ElasticSanProperties : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public string AutoScalePolicyEnforcement { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).AutoScalePolicyEnforcement; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).AutoScalePolicyEnforcement = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties _autoScaleProperty; + + /// Auto Scale Properties for Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties AutoScaleProperty { get => (this._autoScaleProperty = this._autoScaleProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScaleProperties()); set => this._autoScaleProperty = value; } + /// Backing field for property. private System.Collections.Generic.List _availabilityZone; @@ -28,6 +39,10 @@ public partial class ElasticSanProperties : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public long? BaseSizeTiB { get => this._baseSizeTiB; set => this._baseSizeTiB = value; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? CapacityUnitScaleUpLimitTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).CapacityUnitScaleUpLimitTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).CapacityUnitScaleUpLimitTiB = value ?? default(long); } + /// Backing field for property. private long? _extendedCapacitySizeTiB; @@ -35,6 +50,16 @@ public partial class ElasticSanProperties : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public long? ExtendedCapacitySizeTiB { get => this._extendedCapacitySizeTiB; set => this._extendedCapacitySizeTiB = value; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? IncreaseCapacityUnitByTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).IncreaseCapacityUnitByTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).IncreaseCapacityUnitByTiB = value ?? default(long); } + + /// Internal Acessors for AutoScaleProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal.AutoScaleProperty { get => (this._autoScaleProperty = this._autoScaleProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScaleProperties()); set { {_autoScaleProperty = value;} } } + + /// Internal Acessors for AutoScalePropertyScaleUpProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal.AutoScalePropertyScaleUpProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).ScaleUpProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).ScaleUpProperty = value ?? null /* model class */; } + /// Internal Acessors for PrivateEndpointConnection System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanPropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } @@ -125,6 +150,10 @@ public partial class ElasticSanProperties : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public long? TotalVolumeSizeGiB { get => this._totalVolumeSizeGiB; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? UnusedSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).UnusedSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).UnusedSizeTiB = value ?? default(long); } + /// Backing field for property. private long? _volumeGroupCount; @@ -142,6 +171,18 @@ public ElasticSanProperties() public partial interface IElasticSanProperties : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } /// Logical zone for Elastic San resource; example: ["1"]. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -164,6 +205,17 @@ public partial interface IElasticSanProperties : SerializedName = @"baseSizeTiB", PossibleTypes = new [] { typeof(long) })] long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -175,6 +227,17 @@ public partial interface IElasticSanProperties : SerializedName = @"extendedCapacitySizeTiB", PossibleTypes = new [] { typeof(long) })] long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + long? IncreaseCapacityUnitByTiB { get; set; } /// The list of Private Endpoint Connections. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -196,7 +259,7 @@ public partial interface IElasticSanProperties : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -280,6 +343,17 @@ public partial interface IElasticSanProperties : SerializedName = @"totalVolumeSizeGiB", PossibleTypes = new [] { typeof(long) })] long? TotalVolumeSizeGiB { get; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + long? UnusedSizeTiB { get; set; } /// Total number of volume groups in this Elastic San appliance. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -297,16 +371,27 @@ public partial interface IElasticSanProperties : internal partial interface IElasticSanPropertiesInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Auto Scale Properties for Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties AutoScaleProperty { get; set; } + /// Scale up settings on Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties AutoScalePropertyScaleUpProperty { get; set; } /// Logical zone for Elastic San resource; example: ["1"]. System.Collections.Generic.List AvailabilityZone { get; set; } /// Base size of the Elastic San appliance in TiB. long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + long? IncreaseCapacityUnitByTiB { get; set; } /// The list of Private Endpoint Connections. System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -329,6 +414,8 @@ internal partial interface IElasticSanPropertiesInternal long? TotalSizeTiB { get; set; } /// Total size of the provisioned Volumes in GiB. long? TotalVolumeSizeGiB { get; set; } + /// Unused size on Elastic San appliance in TiB. + long? UnusedSizeTiB { get; set; } /// Total number of volume groups in this Elastic San appliance. long? VolumeGroupCount { get; set; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.json.cs index 39c322d0e795..30520eec88e6 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.json.cs @@ -66,6 +66,7 @@ internal ElasticSanProperties(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runt return; } {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Sku.FromJson(__jsonSku) : _sku;} + {_autoScaleProperty = If( json?.PropertyT("autoScaleProperties"), out var __jsonAutoScaleProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScaleProperties.FromJson(__jsonAutoScaleProperties) : _autoScaleProperty;} {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _availabilityZone;} {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} {_baseSizeTiB = If( json?.PropertyT("baseSizeTiB"), out var __jsonBaseSizeTiB) ? (long?)__jsonBaseSizeTiB : _baseSizeTiB;} @@ -112,6 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso return container; } AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._autoScaleProperty ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) this._autoScaleProperty.ToJson(null,serializationMode) : null, "autoScaleProperties" ,container.Add ); if (null != this._availabilityZone) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.XNodeArray(); diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.PowerShell.cs index 967f23c6039d..91ec5fbc2db7 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.PowerShell.cs @@ -110,6 +110,10 @@ internal ElasticSanUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSanUpdateTagsTypeConverter.ConvertFrom); } + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("BaseSizeTiB")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).BaseSizeTiB = (long?) content.GetValueForProperty("BaseSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).BaseSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -122,6 +126,26 @@ internal ElasticSanUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializeDictionary(content); } @@ -147,6 +171,10 @@ internal ElasticSanUpdate(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSanUpdateTagsTypeConverter.ConvertFrom); } + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("BaseSizeTiB")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).BaseSizeTiB = (long?) content.GetValueForProperty("BaseSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).BaseSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -159,6 +187,26 @@ internal ElasticSanUpdate(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializePSObject(content); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.cs index 9a35d952fd06..1a91c8f54bdb 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.cs @@ -14,14 +14,32 @@ public partial class ElasticSanUpdate : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public string AutoScalePolicyEnforcement { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).AutoScalePolicyEnforcement; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).AutoScalePolicyEnforcement = value ?? null; } + /// Base size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] public long? BaseSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).BaseSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).BaseSizeTiB = value ?? default(long); } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? CapacityUnitScaleUpLimitTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).CapacityUnitScaleUpLimitTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).CapacityUnitScaleUpLimitTiB = value ?? default(long); } + /// Extended size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] public long? ExtendedCapacitySizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).ExtendedCapacitySizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).ExtendedCapacitySizeTiB = value ?? default(long); } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? IncreaseCapacityUnitByTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).IncreaseCapacityUnitByTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).IncreaseCapacityUnitByTiB = value ?? default(long); } + + /// Internal Acessors for AutoScaleProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal.AutoScaleProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).AutoScaleProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).AutoScaleProperty = value ?? null /* model class */; } + + /// Internal Acessors for AutoScalePropertyScaleUpProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal.AutoScalePropertyScaleUpProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).AutoScalePropertyScaleUpProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).AutoScalePropertyScaleUpProperty = value ?? null /* model class */; } + /// Internal Acessors for Property Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSanUpdateProperties()); set { {_property = value;} } } @@ -46,6 +64,10 @@ public partial class ElasticSanUpdate : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSanUpdateTags()); set => this._tag = value; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? UnusedSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).UnusedSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)Property).UnusedSizeTiB = value ?? default(long); } + /// Creates an new instance. public ElasticSanUpdate() { @@ -56,6 +78,18 @@ public ElasticSanUpdate() public partial interface IElasticSanUpdate : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } /// Base size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -67,6 +101,17 @@ public partial interface IElasticSanUpdate : SerializedName = @"baseSizeTiB", PossibleTypes = new [] { typeof(long) })] long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -78,6 +123,17 @@ public partial interface IElasticSanUpdate : SerializedName = @"extendedCapacitySizeTiB", PossibleTypes = new [] { typeof(long) })] long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + long? IncreaseCapacityUnitByTiB { get; set; } /// /// Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or /// 'Disabled'. @@ -104,16 +160,38 @@ public partial interface IElasticSanUpdate : SerializedName = @"tags", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags) })] Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags Tag { get; set; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + long? UnusedSizeTiB { get; set; } } /// Response for ElasticSan update request. internal partial interface IElasticSanUpdateInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Auto Scale Properties for Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties AutoScaleProperty { get; set; } + /// Scale up settings on Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties AutoScalePropertyScaleUpProperty { get; set; } /// Base size of the Elastic San appliance in TiB. long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + long? IncreaseCapacityUnitByTiB { get; set; } /// Properties of ElasticSan. Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateProperties Property { get; set; } /// @@ -124,6 +202,8 @@ internal partial interface IElasticSanUpdateInternal string PublicNetworkAccess { get; set; } /// Update tags Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags Tag { get; set; } + /// Unused size on Elastic San appliance in TiB. + long? UnusedSizeTiB { get; set; } } } \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.PowerShell.cs index 88972c92a1c5..e55d1858d9c7 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.PowerShell.cs @@ -102,6 +102,10 @@ internal ElasticSanUpdateProperties(global::System.Collections.IDictionary conte return; } // actually deserialize + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("BaseSizeTiB")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).BaseSizeTiB = (long?) content.GetValueForProperty("BaseSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).BaseSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -114,6 +118,26 @@ internal ElasticSanUpdateProperties(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializeDictionary(content); } @@ -131,6 +155,10 @@ internal ElasticSanUpdateProperties(global::System.Management.Automation.PSObjec return; } // actually deserialize + if (content.Contains("AutoScaleProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScaleProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties) content.GetValueForProperty("AutoScaleProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScaleProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScalePropertiesTypeConverter.ConvertFrom); + } if (content.Contains("BaseSizeTiB")) { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).BaseSizeTiB = (long?) content.GetValueForProperty("BaseSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).BaseSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -143,6 +171,26 @@ internal ElasticSanUpdateProperties(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } + if (content.Contains("AutoScalePropertyScaleUpProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePropertyScaleUpProperty = (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties) content.GetValueForProperty("AutoScalePropertyScaleUpProperty",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePropertyScaleUpProperty, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ScaleUpPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } AfterDeserializePSObject(content); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.cs index ea13c73a4976..302c1a322ae6 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.cs @@ -14,6 +14,17 @@ public partial class ElasticSanUpdateProperties : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public string AutoScalePolicyEnforcement { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).AutoScalePolicyEnforcement; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).AutoScalePolicyEnforcement = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties _autoScaleProperty; + + /// Auto Scale Properties for Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties AutoScaleProperty { get => (this._autoScaleProperty = this._autoScaleProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScaleProperties()); set => this._autoScaleProperty = value; } + /// Backing field for property. private long? _baseSizeTiB; @@ -21,6 +32,10 @@ public partial class ElasticSanUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public long? BaseSizeTiB { get => this._baseSizeTiB; set => this._baseSizeTiB = value; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? CapacityUnitScaleUpLimitTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).CapacityUnitScaleUpLimitTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).CapacityUnitScaleUpLimitTiB = value ?? default(long); } + /// Backing field for property. private long? _extendedCapacitySizeTiB; @@ -28,6 +43,16 @@ public partial class ElasticSanUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public long? ExtendedCapacitySizeTiB { get => this._extendedCapacitySizeTiB; set => this._extendedCapacitySizeTiB = value; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? IncreaseCapacityUnitByTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).IncreaseCapacityUnitByTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).IncreaseCapacityUnitByTiB = value ?? default(long); } + + /// Internal Acessors for AutoScaleProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal.AutoScaleProperty { get => (this._autoScaleProperty = this._autoScaleProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScaleProperties()); set { {_autoScaleProperty = value;} } } + + /// Internal Acessors for AutoScalePropertyScaleUpProperty + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdatePropertiesInternal.AutoScalePropertyScaleUpProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).ScaleUpProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).ScaleUpProperty = value ?? null /* model class */; } + /// Backing field for property. private string _publicNetworkAccess; @@ -38,6 +63,10 @@ public partial class ElasticSanUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] + public long? UnusedSizeTiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).UnusedSizeTiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScalePropertiesInternal)AutoScaleProperty).UnusedSizeTiB = value ?? default(long); } + /// Creates an new instance. public ElasticSanUpdateProperties() { @@ -48,6 +77,18 @@ public ElasticSanUpdateProperties() public partial interface IElasticSanUpdateProperties : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } /// Base size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -59,6 +100,17 @@ public partial interface IElasticSanUpdateProperties : SerializedName = @"baseSizeTiB", PossibleTypes = new [] { typeof(long) })] long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, @@ -70,6 +122,17 @@ public partial interface IElasticSanUpdateProperties : SerializedName = @"extendedCapacitySizeTiB", PossibleTypes = new [] { typeof(long) })] long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + long? IncreaseCapacityUnitByTiB { get; set; } /// /// Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or /// 'Disabled'. @@ -85,22 +148,46 @@ public partial interface IElasticSanUpdateProperties : PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")] string PublicNetworkAccess { get; set; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + long? UnusedSizeTiB { get; set; } } /// Elastic San update properties. internal partial interface IElasticSanUpdatePropertiesInternal { + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Auto Scale Properties for Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IAutoScaleProperties AutoScaleProperty { get; set; } + /// Scale up settings on Elastic San Appliance. + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties AutoScalePropertyScaleUpProperty { get; set; } /// Base size of the Elastic San appliance in TiB. long? BaseSizeTiB { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + long? CapacityUnitScaleUpLimitTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. long? ExtendedCapacitySizeTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + long? IncreaseCapacityUnitByTiB { get; set; } /// /// Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be 'Enabled' or /// 'Disabled'. /// [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")] string PublicNetworkAccess { get; set; } + /// Unused size on Elastic San appliance in TiB. + long? UnusedSizeTiB { get; set; } } } \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.json.cs index 9f22156b1179..e8731f60e68d 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.json.cs @@ -65,6 +65,7 @@ internal ElasticSanUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.ElasticSa { return; } + {_autoScaleProperty = If( json?.PropertyT("autoScaleProperties"), out var __jsonAutoScaleProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.AutoScaleProperties.FromJson(__jsonAutoScaleProperties) : _autoScaleProperty;} {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} AfterFromJson(json); } @@ -100,6 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso { return container; } + AddIf( null != this._autoScaleProperty ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) this._autoScaleProperty.ToJson(null,serializationMode) : null, "autoScaleProperties" ,container.Add ); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeUpdate)) { AddIf( null != this._baseSizeTiB ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNumber((long)this._baseSizeTiB) : null, "baseSizeTiB" ,container.Add ); diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/IscsiTargetInfo.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/IscsiTargetInfo.cs index a776a7a57462..40c09d6d0249 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/IscsiTargetInfo.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/IscsiTargetInfo.cs @@ -82,7 +82,7 @@ public partial interface IIscsiTargetInfo : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// Operational status of the iSCSI Target. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -138,7 +138,7 @@ internal partial interface IIscsiTargetInfoInternal { /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// Operational status of the iSCSI Target. [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Unknown", "Healthy", "Unhealthy", "Updating", "Running", "Stopped", "Stopped (deallocated)")] diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.PowerShell.cs new file mode 100644 index 000000000000..58bdab11b987 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// response object for pre validation api + [System.ComponentModel.TypeConverter(typeof(PreValidationResponseTypeConverter))] + public partial class PreValidationResponse + { + + /// + /// 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.ElasticSan.Models.IPreValidationResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PreValidationResponse(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.ElasticSan.Models.IPreValidationResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PreValidationResponse(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.ElasticSan.Models.IPreValidationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PreValidationResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponseInternal)this).ValidationStatus = (string) content.GetValueForProperty("ValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponseInternal)this).ValidationStatus, 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 PreValidationResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ValidationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponseInternal)this).ValidationStatus = (string) content.GetValueForProperty("ValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponseInternal)this).ValidationStatus, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + } + } + /// response object for pre validation api + [System.ComponentModel.TypeConverter(typeof(PreValidationResponseTypeConverter))] + public partial interface IPreValidationResponse + + { + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.TypeConverter.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.TypeConverter.cs new file mode 100644 index 000000000000..59a034004095 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PreValidationResponseTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PreValidationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PreValidationResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PreValidationResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.cs new file mode 100644 index 000000000000..cab8a24f886f --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// response object for pre validation api + public partial class PreValidationResponse : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponseInternal + { + + /// Backing field for property. + private string _validationStatus; + + /// a status value indicating success or failure of validation + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public string ValidationStatus { get => this._validationStatus; set => this._validationStatus = value; } + + /// Creates an new instance. + public PreValidationResponse() + { + + } + } + /// response object for pre validation api + public partial interface IPreValidationResponse : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable + { + /// a status value indicating success or failure of validation + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"a status value indicating success or failure of validation", + SerializedName = @"validationStatus", + PossibleTypes = new [] { typeof(string) })] + string ValidationStatus { get; set; } + + } + /// response object for pre validation api + internal partial interface IPreValidationResponseInternal + + { + /// a status value indicating success or failure of validation + string ValidationStatus { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.json.cs new file mode 100644 index 000000000000..3d591ed9aff6 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// response object for pre validation api + public partial class PreValidationResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json ? new PreValidationResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject instance to deserialize from. + internal PreValidationResponse(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validationStatus = If( json?.PropertyT("validationStatus"), out var __jsonValidationStatus) ? (string)__jsonValidationStatus : (string)_validationStatus;} + AfterFromJson(json); + } + + /// + /// 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 . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._validationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._validationStatus.ToString()) : null, "validationStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.cs index 18b56106e22d..67ad497c597c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.cs @@ -14,9 +14,9 @@ public partial class PrivateEndpointConnection : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ProxyResource(); /// List of resources private endpoint is mapped [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] @@ -26,7 +26,7 @@ public partial class PrivateEndpointConnection : /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for PrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value ?? null /* model class */; } @@ -44,38 +44,38 @@ public partial class PrivateEndpointConnection : string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Id = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Name = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } /// Internal Acessors for SystemDataCreatedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } /// Internal Acessors for SystemDataCreatedBy - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy = value ?? null; } /// Internal Acessors for SystemDataCreatedByType - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedByType = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType = value ?? null; } /// Internal Acessors for SystemDataLastModifiedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } /// Internal Acessors for SystemDataLastModifiedBy - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy = value ?? null; } /// Internal Acessors for SystemDataLastModifiedByType - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Type = value ?? null; } + string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Name; } /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inlined)] @@ -116,37 +116,37 @@ public partial class PrivateEndpointConnection : /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedAt; } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedBy; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataCreatedByType; } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Type; } /// Creates an new instance. public PrivateEndpointConnection() @@ -162,14 +162,14 @@ public PrivateEndpointConnection() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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); } } /// Response for PrivateEndpoint Connection object public partial interface IPrivateEndpointConnection : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResource + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IProxyResource { /// List of resources private endpoint is mapped [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -178,7 +178,7 @@ public partial interface IPrivateEndpointConnection : Read = true, Create = true, Update = true, - Description = @" List of resources private endpoint is mapped", + Description = @"List of resources private endpoint is mapped", SerializedName = @"groupIds", PossibleTypes = new [] { typeof(string) })] System.Collections.Generic.List GroupId { get; set; } @@ -241,13 +241,13 @@ public partial interface IPrivateEndpointConnection : Description = @"Provisioning State of Private Endpoint connection resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } } /// Response for PrivateEndpoint Connection object internal partial interface IPrivateEndpointConnectionInternal : - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IProxyResourceInternal { /// List of resources private endpoint is mapped System.Collections.Generic.List GroupId { get; set; } @@ -271,7 +271,7 @@ internal partial interface IPrivateEndpointConnectionInternal : /// Private Endpoint Connection Properties. Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionProperties Property { get; set; } /// Provisioning State of Private Endpoint connection resource - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs index c60227b2a02e..bd4152352766 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs @@ -77,7 +77,7 @@ internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Resource(json); + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ProxyResource(json); {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs index f150e96df2f0..104120ae9b46 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models { using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; - /// List of private endpoint connections associated with SAN + /// The response of a PrivateEndpointConnection list operation. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] public partial class PrivateEndpointConnectionListResult { @@ -164,7 +164,7 @@ public override string ToString() return ToJsonString(); } } - /// List of private endpoint connections associated with SAN + /// The response of a PrivateEndpointConnection list operation. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] public partial interface IPrivateEndpointConnectionListResult diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs index 171e8c922ede..4811cf861e01 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs @@ -7,26 +7,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; - /// List of private endpoint connections associated with SAN + /// The response of a PrivateEndpointConnection list operation. public partial class PrivateEndpointConnectionListResult : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionListResult, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionListResultInternal { - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnectionListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - /// Backing field for property. private string _nextLink; - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } + public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. private System.Collections.Generic.List _value; - /// Array of private endpoint connections + /// The PrivateEndpointConnection items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } @@ -36,41 +33,41 @@ public PrivateEndpointConnectionListResult() } } - /// List of private endpoint connections associated with SAN + /// The response of a PrivateEndpointConnection list operation. public partial interface IPrivateEndpointConnectionListResult : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = true, + ReadOnly = false, Read = true, - Create = false, - Update = false, - Description = @"URI to fetch the next section of the paginated response.", + Create = true, + Update = true, + Description = @"The link to the next page of items", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// Array of private endpoint connections + string NextLink { get; set; } + /// The PrivateEndpointConnection items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = false, + Required = true, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"Array of private endpoint connections", + Description = @"The PrivateEndpointConnection items on this page", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnection) })] System.Collections.Generic.List Value { get; set; } } - /// List of private endpoint connections associated with SAN + /// The response of a PrivateEndpointConnection list operation. internal partial interface IPrivateEndpointConnectionListResultInternal { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items string NextLink { get; set; } - /// Array of private endpoint connections + /// The PrivateEndpointConnection items on this page System.Collections.Generic.List Value { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs index 1bca6bcb4088..9a6a2998cc1c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; - /// List of private endpoint connections associated with SAN + /// The response of a PrivateEndpointConnection list operation. public partial class PrivateEndpointConnectionListResult { @@ -111,10 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs index ceda7cdd8268..5e96cd57d32f 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs @@ -90,7 +90,7 @@ public partial interface IPrivateEndpointConnectionProperties : Read = true, Create = true, Update = true, - Description = @" List of resources private endpoint is mapped", + Description = @"List of resources private endpoint is mapped", SerializedName = @"groupIds", PossibleTypes = new [] { typeof(string) })] System.Collections.Generic.List GroupId { get; set; } @@ -153,7 +153,7 @@ public partial interface IPrivateEndpointConnectionProperties : Description = @"Provisioning State of Private Endpoint connection resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } } @@ -181,7 +181,7 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Pending", "Approved", "Failed", "Rejected")] string PrivateLinkServiceConnectionStateStatus { get; set; } /// Provisioning State of Private Endpoint connection resource - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs index f507c9352d48..f3abb2d16b3c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs @@ -53,7 +53,7 @@ public partial interface IPrivateLinkResourceListResult : string NextLink { get; } /// Array of private link resources [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = false, + Required = true, ReadOnly = false, Read = true, Create = true, diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.PowerShell.cs new file mode 100644 index 000000000000..fa40256852fc --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// Scale up properties on Elastic San Appliance. + [System.ComponentModel.TypeConverter(typeof(ScaleUpPropertiesTypeConverter))] + public partial class ScaleUpProperties + { + + /// + /// 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.ElasticSan.Models.IScaleUpProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScaleUpProperties(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.ElasticSan.Models.IScaleUpProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScaleUpProperties(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.ElasticSan.Models.IScaleUpProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScaleUpProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).AutoScalePolicyEnforcement, 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 ScaleUpProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UnusedSizeTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).UnusedSizeTiB = (long?) content.GetValueForProperty("UnusedSizeTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).UnusedSizeTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncreaseCapacityUnitByTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).IncreaseCapacityUnitByTiB = (long?) content.GetValueForProperty("IncreaseCapacityUnitByTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).IncreaseCapacityUnitByTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUnitScaleUpLimitTiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).CapacityUnitScaleUpLimitTiB = (long?) content.GetValueForProperty("CapacityUnitScaleUpLimitTiB",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).CapacityUnitScaleUpLimitTiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AutoScalePolicyEnforcement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).AutoScalePolicyEnforcement = (string) content.GetValueForProperty("AutoScalePolicyEnforcement",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal)this).AutoScalePolicyEnforcement, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + } + } + /// Scale up properties on Elastic San Appliance. + [System.ComponentModel.TypeConverter(typeof(ScaleUpPropertiesTypeConverter))] + public partial interface IScaleUpProperties + + { + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.TypeConverter.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.TypeConverter.cs new file mode 100644 index 000000000000..7426e2cd64e1 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ScaleUpPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ScaleUpProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ScaleUpProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ScaleUpProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.cs new file mode 100644 index 000000000000..9a7bf00461a3 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// Scale up properties on Elastic San Appliance. + public partial class ScaleUpProperties : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpPropertiesInternal + { + + /// Backing field for property. + private string _autoScalePolicyEnforcement; + + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public string AutoScalePolicyEnforcement { get => this._autoScalePolicyEnforcement; set => this._autoScalePolicyEnforcement = value; } + + /// Backing field for property. + private long? _capacityUnitScaleUpLimitTiB; + + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public long? CapacityUnitScaleUpLimitTiB { get => this._capacityUnitScaleUpLimitTiB; set => this._capacityUnitScaleUpLimitTiB = value; } + + /// Backing field for property. + private long? _increaseCapacityUnitByTiB; + + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public long? IncreaseCapacityUnitByTiB { get => this._increaseCapacityUnitByTiB; set => this._increaseCapacityUnitByTiB = value; } + + /// Backing field for property. + private long? _unusedSizeTiB; + + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public long? UnusedSizeTiB { get => this._unusedSizeTiB; set => this._unusedSizeTiB = value; } + + /// Creates an new instance. + public ScaleUpProperties() + { + + } + } + /// Scale up properties on Elastic San Appliance. + public partial interface IScaleUpProperties : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable + { + /// Enable or Disable scale up setting on Elastic San Appliance. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUnitScaleUpLimitTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + long? IncreaseCapacityUnitByTiB { get; set; } + /// Unused size on Elastic San appliance in TiB. + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + long? UnusedSizeTiB { get; set; } + + } + /// Scale up properties on Elastic San Appliance. + internal partial interface IScaleUpPropertiesInternal + + { + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + string AutoScalePolicyEnforcement { get; set; } + /// Maximum scale up size on Elastic San appliance in TiB. + long? CapacityUnitScaleUpLimitTiB { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + long? IncreaseCapacityUnitByTiB { get; set; } + /// Unused size on Elastic San appliance in TiB. + long? UnusedSizeTiB { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.json.cs new file mode 100644 index 000000000000..3bebbd0e0fb0 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// Scale up properties on Elastic San Appliance. + public partial class ScaleUpProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IScaleUpProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json ? new ScaleUpProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject instance to deserialize from. + internal ScaleUpProperties(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_unusedSizeTiB = If( json?.PropertyT("unusedSizeTiB"), out var __jsonUnusedSizeTiB) ? (long?)__jsonUnusedSizeTiB : _unusedSizeTiB;} + {_increaseCapacityUnitByTiB = If( json?.PropertyT("increaseCapacityUnitByTiB"), out var __jsonIncreaseCapacityUnitByTiB) ? (long?)__jsonIncreaseCapacityUnitByTiB : _increaseCapacityUnitByTiB;} + {_capacityUnitScaleUpLimitTiB = If( json?.PropertyT("capacityUnitScaleUpLimitTiB"), out var __jsonCapacityUnitScaleUpLimitTiB) ? (long?)__jsonCapacityUnitScaleUpLimitTiB : _capacityUnitScaleUpLimitTiB;} + {_autoScalePolicyEnforcement = If( json?.PropertyT("autoScalePolicyEnforcement"), out var __jsonAutoScalePolicyEnforcement) ? (string)__jsonAutoScalePolicyEnforcement : (string)_autoScalePolicyEnforcement;} + AfterFromJson(json); + } + + /// + /// 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 . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._unusedSizeTiB ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNumber((long)this._unusedSizeTiB) : null, "unusedSizeTiB" ,container.Add ); + AddIf( null != this._increaseCapacityUnitByTiB ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNumber((long)this._increaseCapacityUnitByTiB) : null, "increaseCapacityUnitByTiB" ,container.Add ); + AddIf( null != this._capacityUnitScaleUpLimitTiB ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNumber((long)this._capacityUnitScaleUpLimitTiB) : null, "capacityUnitScaleUpLimitTiB" ,container.Add ); + AddIf( null != (((object)this._autoScalePolicyEnforcement)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._autoScalePolicyEnforcement.ToString()) : null, "autoScalePolicyEnforcement" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.cs index bd5ca25129c1..c6a4ce127f18 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.cs @@ -13,23 +13,20 @@ public partial class SkuInformationList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformationListInternal { - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformationListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - /// Internal Acessors for Value System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformationListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } + public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. private System.Collections.Generic.List _value; - /// List of ResourceType Sku + /// The SkuInformation items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; } @@ -43,25 +40,25 @@ public SkuInformationList() public partial interface ISkuInformationList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = true, + ReadOnly = false, Read = true, - Create = false, - Update = false, - Description = @"URI to fetch the next section of the paginated response.", + Create = true, + Update = true, + Description = @"The link to the next page of items", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// List of ResourceType Sku + string NextLink { get; set; } + /// The SkuInformation items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, ReadOnly = true, Read = true, Create = false, Update = false, - Description = @"List of ResourceType Sku", + Description = @"The SkuInformation items on this page", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformation) })] System.Collections.Generic.List Value { get; } @@ -71,9 +68,9 @@ public partial interface ISkuInformationList : internal partial interface ISkuInformationListInternal { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items string NextLink { get; set; } - /// List of ResourceType Sku + /// The SkuInformation items on this page System.Collections.Generic.List Value { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.json.cs index 1e0b886dd004..6c0eea5be370 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.json.cs @@ -113,10 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Snapshot.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Snapshot.cs index b8c3bdf71baf..38e13d4a4943 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Snapshot.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Snapshot.cs @@ -185,7 +185,7 @@ public partial interface ISnapshot : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// Size of Source Volume [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -224,7 +224,7 @@ internal partial interface ISnapshotInternal : /// Properties of Volume Snapshot. Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshotProperties Property { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// Size of Source Volume long? SourceVolumeSizeGiB { get; set; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.cs index ef31c63a143e..21aaaf175ba5 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.cs @@ -14,20 +14,17 @@ public partial class SnapshotList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshotListInternal { - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshotListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - /// Backing field for property. private string _nextLink; - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } + public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. private System.Collections.Generic.List _value; - /// An array of Snapshot objects. + /// The Snapshot items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } @@ -41,25 +38,25 @@ public SnapshotList() public partial interface ISnapshotList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = true, + ReadOnly = false, Read = true, - Create = false, - Update = false, - Description = @"URI to fetch the next section of the paginated response.", + Create = true, + Update = true, + Description = @"The link to the next page of items", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// An array of Snapshot objects. + string NextLink { get; set; } + /// The Snapshot items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = false, + Required = true, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"An array of Snapshot objects.", + Description = @"The Snapshot items on this page", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot) })] System.Collections.Generic.List Value { get; set; } @@ -69,9 +66,9 @@ public partial interface ISnapshotList : internal partial interface ISnapshotListInternal { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items string NextLink { get; set; } - /// An array of Snapshot objects. + /// The Snapshot items on this page System.Collections.Generic.List Value { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.json.cs index e5e517237679..01eb9f4502c8 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.json.cs @@ -110,10 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotProperties.cs index deabf59d8f6e..e3d0beb4688c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotProperties.cs @@ -93,7 +93,7 @@ public partial interface ISnapshotProperties : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// Size of Source Volume [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -130,7 +130,7 @@ internal partial interface ISnapshotPropertiesInternal /// string CreationDataSourceId { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// Size of Source Volume long? SourceVolumeSizeGiB { get; set; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Volume.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Volume.cs index 7a0f99b29e85..8b79333ddf26 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Volume.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/Volume.cs @@ -260,7 +260,7 @@ public partial interface IVolume : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// Volume size. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -318,7 +318,7 @@ public partial interface IVolume : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string StorageTargetProvisioningState { get; } /// Operational status of the iSCSI Target. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -367,7 +367,7 @@ internal partial interface IVolumeInternal : /// Properties of Volume. Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeProperties Property { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// Volume size. long SizeGiB { get; set; } @@ -382,7 +382,7 @@ internal partial interface IVolumeInternal : /// iSCSI Target Portal Port int? StorageTargetPortalPort { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string StorageTargetProvisioningState { get; set; } /// Operational status of the iSCSI Target. [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Unknown", "Healthy", "Unhealthy", "Updating", "Running", "Stopped", "Stopped (deallocated)")] diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroup.cs index ab79e8a9a187..fb76f799c795 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroup.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroup.cs @@ -448,7 +448,7 @@ public partial interface IVolumeGroup : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } } @@ -514,7 +514,7 @@ internal partial interface IVolumeGroupInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Iscsi", "None")] string ProtocolType { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.cs index 702fec740b8e..b22011efb7a6 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.cs @@ -14,20 +14,17 @@ public partial class VolumeGroupList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupListInternal { - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - /// Backing field for property. private string _nextLink; - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } + public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. private System.Collections.Generic.List _value; - /// An array of Volume Groups objects. + /// The VolumeGroup items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } @@ -41,25 +38,25 @@ public VolumeGroupList() public partial interface IVolumeGroupList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = true, + ReadOnly = false, Read = true, - Create = false, - Update = false, - Description = @"URI to fetch the next section of the paginated response.", + Create = true, + Update = true, + Description = @"The link to the next page of items", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// An array of Volume Groups objects. + string NextLink { get; set; } + /// The VolumeGroup items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = false, + Required = true, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"An array of Volume Groups objects.", + Description = @"The VolumeGroup items on this page", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup) })] System.Collections.Generic.List Value { get; set; } @@ -69,9 +66,9 @@ public partial interface IVolumeGroupList : internal partial interface IVolumeGroupListInternal { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items string NextLink { get; set; } - /// An array of Volume Groups objects. + /// The VolumeGroup items on this page System.Collections.Generic.List Value { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.json.cs index 11d43d961239..508770917878 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.json.cs @@ -93,10 +93,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupProperties.cs index 4ae2433cba6a..7808b253cb9c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupProperties.cs @@ -288,7 +288,7 @@ public partial interface IVolumeGroupProperties : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } } @@ -338,7 +338,7 @@ internal partial interface IVolumeGroupPropertiesInternal [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Iscsi", "None")] string ProtocolType { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.cs index 6accf9f315f5..0af8ef17ac62 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.cs @@ -14,20 +14,17 @@ public partial class VolumeList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeListInternal { - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - /// Backing field for property. private string _nextLink; - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } + public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. private System.Collections.Generic.List _value; - /// An array of Volume objects. + /// The Volume items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } @@ -41,25 +38,25 @@ public VolumeList() public partial interface IVolumeList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = true, + ReadOnly = false, Read = true, - Create = false, - Update = false, - Description = @"URI to fetch the next section of the paginated response.", + Create = true, + Update = true, + Description = @"The link to the next page of items", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// An array of Volume objects. + string NextLink { get; set; } + /// The Volume items on this page [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = false, + Required = true, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"An array of Volume objects.", + Description = @"The Volume items on this page", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume) })] System.Collections.Generic.List Value { get; set; } @@ -69,9 +66,9 @@ public partial interface IVolumeList : internal partial interface IVolumeListInternal { - /// URI to fetch the next section of the paginated response. + /// The link to the next page of items string NextLink { get; set; } - /// An array of Volume objects. + /// The Volume items on this page System.Collections.Generic.List Value { get; set; } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.json.cs index 22c61fa6e7cc..9236a77235bc 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.json.cs @@ -93,10 +93,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.PowerShell.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.PowerShell.cs new file mode 100644 index 000000000000..e1f8505343d7 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// object to hold array of volume names + [System.ComponentModel.TypeConverter(typeof(VolumeNameListTypeConverter))] + public partial class VolumeNameList + { + + /// + /// 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.ElasticSan.Models.IVolumeNameList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VolumeNameList(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.ElasticSan.Models.IVolumeNameList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VolumeNameList(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.ElasticSan.Models.IVolumeNameList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VolumeNameList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VolumeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameListInternal)this).VolumeName = (System.Collections.Generic.List) content.GetValueForProperty("VolumeName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameListInternal)this).VolumeName, __y => TypeConverterExtensions.SelectToList(__y, 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 VolumeNameList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VolumeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameListInternal)this).VolumeName = (System.Collections.Generic.List) content.GetValueForProperty("VolumeName",((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameListInternal)this).VolumeName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// object to hold array of volume names + [System.ComponentModel.TypeConverter(typeof(VolumeNameListTypeConverter))] + public partial interface IVolumeNameList + + { + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.TypeConverter.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.TypeConverter.cs new file mode 100644 index 000000000000..8f51368822d1 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VolumeNameListTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VolumeNameList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VolumeNameList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VolumeNameList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.cs new file mode 100644 index 000000000000..9cc01408c6a5 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// object to hold array of volume names + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.DoNotFormat] + public partial class VolumeNameList : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameListInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _volumeName; + + /// array of volume names + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] + public System.Collections.Generic.List VolumeName { get => this._volumeName; set => this._volumeName = value; } + + /// Creates an new instance. + public VolumeNameList() + { + + } + } + /// object to hold array of volume names + public partial interface IVolumeNameList : + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable + { + /// array of volume names + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"array of volume names", + SerializedName = @"volumeNames", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VolumeName { get; set; } + + } + /// object to hold array of volume names + internal partial interface IVolumeNameListInternal + + { + /// array of volume names + System.Collections.Generic.List VolumeName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.json.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.json.cs new file mode 100644 index 000000000000..c6254e124352 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + + /// object to hold array of volume names + public partial class VolumeNameList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json ? new VolumeNameList(json) : null; + } + + /// + /// 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 . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._volumeName) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.XNodeArray(); + foreach( var __x in this._volumeName ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("volumeNames",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject instance to deserialize from. + internal VolumeNameList(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_volumeName = If( json?.PropertyT("volumeNames"), out var __jsonVolumeNames) ? If( __jsonVolumeNames as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _volumeName;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeProperties.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeProperties.cs index f7893223d80a..30bc8e2765dc 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeProperties.cs @@ -182,7 +182,7 @@ public partial interface IVolumeProperties : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; } /// Volume size. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -240,7 +240,7 @@ public partial interface IVolumeProperties : Description = @"State of the operation on the resource.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string StorageTargetProvisioningState { get; } /// Operational status of the iSCSI Target. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( @@ -287,7 +287,7 @@ internal partial interface IVolumePropertiesInternal /// string ManagedByResourceId { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string ProvisioningState { get; set; } /// Volume size. long SizeGiB { get; set; } @@ -302,7 +302,7 @@ internal partial interface IVolumePropertiesInternal /// iSCSI Target Portal Port int? StorageTargetPortalPort { get; set; } /// State of the operation on the resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting", "Deleted", "Restoring")] string StorageTargetProvisioningState { get; set; } /// Operational status of the iSCSI Target. [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Unknown", "Healthy", "Unhealthy", "Updating", "Running", "Stopped", "Stopped (deallocated)")] diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanOperation_List.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanOperation_List.cs index de4a731d660b..d9823ee0a46c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanOperation_List.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanOperation_List.cs @@ -10,16 +10,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; using System; - /// Gets a list of ElasticSan operations. + /// List the operations for the provider /// /// [OpenAPI] List=>GET:"/providers/Microsoft.ElasticSan/operations" /// [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzElasticSanOperation_List")] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IOperation))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Gets a list of ElasticSan operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"List the operations for the provider")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/providers/Microsoft.ElasticSan/operations", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/providers/Microsoft.ElasticSan/operations", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanOperation_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -44,6 +44,12 @@ public partial class GetAzElasticSanOperation_List : global::System.Management.A /// 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. @@ -435,7 +441,7 @@ protected override void StopProcessing() // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IOperationListResult var result = (await response); // response should be returning an array of some kind. +Pageable - // pageable / value / + // pageable / value / nextLink if (null != result.Value) { if (0 == _responseSize && 1 == result.Value.Count) @@ -459,6 +465,20 @@ protected override void StopProcessing() _responseSize = 2; } } + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (!String.IsNullOrEmpty(_nextLink)) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanSkuList_List.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanSkuList_List.cs index f4f1b1172470..6ba0d4432edb 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanSkuList_List.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanSkuList_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"List all the available Skus in the region and information related to them")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanSkuList_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -43,6 +43,12 @@ public partial class GetAzElasticSanSkuList_List : global::System.Management.Aut /// 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. @@ -470,7 +476,7 @@ protected override void StopProcessing() // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformationList var result = (await response); // response should be returning an array of some kind. +Pageable - // pageable / value / + // pageable / value / nextLink if (null != result.Value) { if (0 == _responseSize && 1 == result.Value.Count) @@ -494,6 +500,20 @@ protected override void StopProcessing() _responseSize = 2; } } + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (!String.IsNullOrEmpty(_nextLink)) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SkusList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_Get.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_Get.cs index ff5fba2ddabf..df245ef5c0a4 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_Get.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_Get.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volume groups from an Elastic SAN or get a single volume group from an Elastic SAN.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeGroup_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentity.cs index 48ca4808b5cf..fe78774cdca8 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentity.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volume groups from an Elastic SAN or get a single volume group from an Elastic SAN.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeGroup_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentityElasticSan.cs index 99933aa04df4..69bef0b8c524 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentityElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_GetViaIdentityElasticSan.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volume groups from an Elastic SAN or get a single volume group from an Elastic SAN.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeGroup_GetViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_List.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_List.cs index 9b9e0e459c42..0452298f7b92 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_List.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeGroup_List.cs @@ -12,13 +12,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets /// List VolumeGroups. /// - /// [OpenAPI] ListByElasticSan=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups" + /// [OpenAPI] ListByElasticSan=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzElasticSanVolumeGroup_List")] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"List VolumeGroups.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeGroup_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_Get.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_Get.cs index 7f2dcc610353..adb3fcd264a5 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_Get.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeSnapshot_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentity.cs index c8fd1e5c697c..6044a7e87d75 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeSnapshot_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityElasticSan.cs index 1ec77aab1cc3..88eb22bb2e74 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityElasticSan.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeSnapshot_GetViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityVolumegroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityVolumegroup.cs index 59d5a8a2e112..7a3c688a5723 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityVolumegroup.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_GetViaIdentityVolumegroup.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeSnapshot_GetViaIdentityVolumegroup : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_List.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_List.cs index 6ab92d557895..9aa7de8c1890 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_List.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolumeSnapshot_List.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolumeSnapshot_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_Get.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_Get.cs index 6727edbefb12..b6d4bb5ea7fb 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_Get.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_Get.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volumes from a volume group or get a single volume from a volume group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolume_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentity.cs index 60514079344b..2da4c4dd3aad 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentity.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volumes from a volume group or get a single volume from a volume group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolume_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityElasticSan.cs index ae48704fce64..48d1162cea67 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityElasticSan.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volumes from a volume group or get a single volume from a volume group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolume_GetViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityVolumegroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityVolumegroup.cs index 31e175f39ee4..30b2a95c3eee 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityVolumegroup.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_GetViaIdentityVolumegroup.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of all volumes from a volume group or get a single volume from a volume group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolume_GetViaIdentityVolumegroup : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_List.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_List.cs index e4a2f6243d94..c0bf24d31e31 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_List.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSanVolume_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"List Volumes in a VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", ApiVersion = "2025-09-01")] public partial class GetAzElasticSanVolume_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_Get.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_Get.cs index decd0029139b..c922070a5997 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_Get.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_Get.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of Elastic SANs from a subscription or a resource group, or get a single Elastic SAN.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSan_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_GetViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_GetViaIdentity.cs index 9c0e972b3f93..5c6ee0276c56 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_GetViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_GetViaIdentity.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Get either a list of Elastic SANs from a subscription or a resource group, or get a single Elastic SAN.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class GetAzElasticSan_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List.cs index bdca71593fb8..bd8d5bfab6c1 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Gets a list of ElasticSans in a subscription")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", ApiVersion = "2025-09-01")] public partial class GetAzElasticSan_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List1.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List1.cs index 86fc9986e388..95d68a9a6163 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List1.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/GetAzElasticSan_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Gets a list of ElasticSan in a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", ApiVersion = "2025-09-01")] public partial class GetAzElasticSan_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateExpanded.cs index b2ed1b5496d6..2ea2149c81b8 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeGroup_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,18 +41,9 @@ public partial class NewAzElasticSanVolumeGroup_CreateExpanded : global::System. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - /// Response for Volume Group request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeGroup(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -386,11 +377,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -706,24 +692,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded.cs index 3e7e035c96e5..b804eddf6063 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,18 +41,9 @@ public partial class NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpan /// 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; - /// Response for Volume Group request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeGroup(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -346,11 +337,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -688,24 +674,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded.cs index adb49eb35a72..81fb8b0d5971 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,18 +41,9 @@ public partial class NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded : glob /// 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; - /// Response for Volume Group request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeGroup(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -328,11 +319,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -672,24 +658,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateExpanded.cs index cdcf91cf3ffa..05264c78793d 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeSnapshot_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolumeSnapshot_CreateExpanded : global::Syst /// 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; - /// Response for Volume Snapshot request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Snapshot(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -292,11 +283,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -612,24 +598,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded.cs index ff180eda517e..2307eeddcb80 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanEx /// 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; - /// Response for Volume Snapshot request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Snapshot(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -252,11 +243,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -594,24 +580,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded.cs index 8539eec6f9df..93cebd6a8390 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded : g /// 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; - /// Response for Volume Snapshot request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Snapshot(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -220,11 +211,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -568,24 +554,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded.cs index 93c0d256afc2..92313c309f89 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupE /// 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; - /// Response for Volume Snapshot request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Snapshot(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -237,11 +228,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -583,24 +569,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateExpanded.cs index ec1780d05963..f818af14f0df 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolume_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolume_CreateExpanded : global::System.Manag /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Volume(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -330,11 +321,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -654,24 +640,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded.cs index 0cc8fe24f4f8..ab207f0939df 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded : /// 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; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Volume(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -290,11 +281,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -635,24 +621,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityExpanded.cs index f808647cc5ab..83c5e6a1916b 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolume_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolume_CreateViaIdentityExpanded : global::S /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Volume(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -257,11 +248,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -609,24 +595,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded.cs index f0006b10ecb6..d67406d4fde9 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create a Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded /// 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; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Volume(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -275,11 +266,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSanVolu /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -624,24 +610,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateExpanded.cs index 3300b7a830bf..af741fa26156 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create ElasticSan.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSan_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,23 +41,26 @@ public partial class NewAzElasticSan_CreateExpanded : global::System.Management. /// 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; - /// Response for ElasticSan request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSan(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enable or Disable scale up setting on Elastic San Appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + public string AutoScalePolicyEnforcement { get => _parametersBody.AutoScalePolicyEnforcement ?? null; set => _parametersBody.AutoScalePolicyEnforcement = value; } + /// Logical zone for Elastic San resource; example: ["1"]. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Logical zone for Elastic San resource; example: [\"1\"].")] @@ -89,6 +92,17 @@ public partial class NewAzElasticSan_CreateExpanded : global::System.Management. /// Accessor for cancellationTokenSource. public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Maximum scale up size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum scale up size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + public long CapacityUnitScaleUpLimitTiB { get => _parametersBody.CapacityUnitScaleUpLimitTiB ?? default(long); set => _parametersBody.CapacityUnitScaleUpLimitTiB = value; } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.ClientAPI; @@ -128,6 +142,17 @@ public partial class NewAzElasticSan_CreateExpanded : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unit to increase Capacity Unit on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + public long IncreaseCapacityUnitByTiB { get => _parametersBody.IncreaseCapacityUnitByTiB ?? default(long); set => _parametersBody.IncreaseCapacityUnitByTiB = value; } + /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -277,6 +302,17 @@ public partial class NewAzElasticSan_CreateExpanded : global::System.Management. PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceTags) })] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + /// Unused size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unused size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + public long UnusedSizeTiB { get => _parametersBody.UnusedSizeTiB ?? default(long); set => _parametersBody.UnusedSizeTiB = 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 @@ -346,11 +382,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSan_Cre /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -666,24 +697,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateViaIdentityExpanded.cs index f6d532068970..7a3c2c4e4eda 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateViaIdentityExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"create ElasticSan.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class NewAzElasticSan_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,23 +41,26 @@ public partial class NewAzElasticSan_CreateViaIdentityExpanded : global::System. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - /// Response for ElasticSan request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSan(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enable or Disable scale up setting on Elastic San Appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + public string AutoScalePolicyEnforcement { get => _parametersBody.AutoScalePolicyEnforcement ?? null; set => _parametersBody.AutoScalePolicyEnforcement = value; } + /// Logical zone for Elastic San resource; example: ["1"]. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Logical zone for Elastic San resource; example: [\"1\"].")] @@ -89,6 +92,17 @@ public partial class NewAzElasticSan_CreateViaIdentityExpanded : global::System. /// Accessor for cancellationTokenSource. public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Maximum scale up size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum scale up size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + public long CapacityUnitScaleUpLimitTiB { get => _parametersBody.CapacityUnitScaleUpLimitTiB ?? default(long); set => _parametersBody.CapacityUnitScaleUpLimitTiB = value; } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.ClientAPI; @@ -128,6 +142,17 @@ public partial class NewAzElasticSan_CreateViaIdentityExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unit to increase Capacity Unit on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + public long IncreaseCapacityUnitByTiB { get => _parametersBody.IncreaseCapacityUnitByTiB ?? default(long); set => _parametersBody.IncreaseCapacityUnitByTiB = value; } + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _inputObject; @@ -237,6 +262,17 @@ public partial class NewAzElasticSan_CreateViaIdentityExpanded : global::System. PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceTags) })] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + /// Unused size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unused size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + public long UnusedSizeTiB { get => _parametersBody.UnusedSizeTiB ?? default(long); set => _parametersBody.UnusedSizeTiB = 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 @@ -303,11 +339,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.NewAzElasticSan_Cre /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -643,24 +674,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_Delete.cs index 37a02592a34b..33d1e35b0d3d 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_Delete.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeGroup_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeGroup_Delete : global::System.Manag /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -276,11 +267,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -592,7 +578,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -616,7 +602,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentity.cs index d3c09517c2c4..617ae4b8c61f 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeGroup_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeGroup_DeleteViaIdentity : global::S /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -218,11 +209,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -558,7 +544,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -582,7 +568,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan.cs index 9589e42d22f6..4fe156eec997 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan : /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -236,11 +227,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -573,7 +559,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -597,7 +583,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_Delete.cs index 02be8a3da6dd..b7fca4890102 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_Delete.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeSnapshot_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeSnapshot_Delete : global::System.Ma /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -290,11 +281,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -606,7 +592,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -630,7 +616,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity.cs index f91e1838ec16..7d42d3275595 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity : global /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -218,11 +209,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -562,7 +548,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -586,7 +572,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan.cs index 3f3d30522dc9..307278ac269c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSa /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -250,11 +241,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -587,7 +573,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -611,7 +597,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup.cs index 590b8d70c87e..3a45b0f84fe2 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete a Volume Snapshot.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegro /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -235,11 +226,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -577,7 +563,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -601,7 +587,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_Delete.cs index 66d678f4b03f..c226d23eda5d 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_Delete.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolume_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolume_Delete : global::System.Management /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -327,11 +318,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -643,7 +629,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -667,7 +653,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentity.cs index c76998c13c72..3c8d13a9f21b 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolume_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolume_DeleteViaIdentity : global::System /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -254,11 +245,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -598,7 +584,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -622,7 +608,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan.cs index 58956faca7aa..4a962c35bd66 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan : glob /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -285,11 +276,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -622,7 +608,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -646,7 +632,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup.cs index e325544e62a1..4ab7ff4dda5b 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup : glo /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -270,11 +261,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -611,7 +597,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -635,7 +621,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_Delete.cs index baa752899992..c46add7dcd5c 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_Delete.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete a Elastic San.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSan_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSan_Delete : global::System.Management.Autom /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -261,11 +252,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSan_ /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -577,7 +563,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -601,7 +587,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_DeleteViaIdentity.cs index 175009f0b263..5d28ae4a26a9 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_DeleteViaIdentity.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Delete a Elastic San.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class RemoveAzElasticSan_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,15 +40,6 @@ public partial class RemoveAzElasticSan_DeleteViaIdentity : global::System.Manag /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -218,11 +209,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.RemoveAzElasticSan_ /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -554,7 +540,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -578,7 +564,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_Backup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_Backup.cs new file mode 100644 index 000000000000..29b62a1445ff --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_Backup.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_Backup", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeBackup_Backup : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList _parameter; + + /// object to hold array of volume names + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "object to hold array of volume names", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"object to hold array of volume names", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeBackup_Backup + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_Backup Clone() + { + var clone = new TestAzElasticSanVolumeBackup_Backup(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreBackup(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_Backup() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupExpanded.cs new file mode 100644 index 000000000000..dc5f6722c7ca --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupExpanded.cs @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeBackup_BackupExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// object to hold array of volume names + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeNameList(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = value; } + + /// array of volume names + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "array of volume names")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"array of volume names", + SerializedName = @"volumeNames", + PossibleTypes = new [] { typeof(string) })] + public string[] VolumeName { get => _parametersBody.VolumeName?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.VolumeName = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupExpanded Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreBackup(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_BackupExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentity.cs new file mode 100644 index 000000000000..b842c4271852 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentity.cs @@ -0,0 +1,555 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeBackup_BackupViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList _parameter; + + /// object to hold array of volume names + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "object to hold array of volume names", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"object to hold array of volume names", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupViaIdentity Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.VolumesPreBackupViaIdentity(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) ); + } + 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.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.VolumeGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VolumeGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.VolumesPreBackup(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ElasticSanName ?? null, InputObject.VolumeGroupName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_BackupViaIdentity() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan.cs new file mode 100644 index 000000000000..0328758715d8 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan.cs @@ -0,0 +1,569 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupViaIdentityElasticSan", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _elasticSanInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity ElasticSanInputObject { get => this._elasticSanInputObject; set => this._elasticSanInputObject = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList _parameter; + + /// object to hold array of volume names + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "object to hold array of volume names", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"object to hold array of volume names", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.VolumeGroupName = this.VolumeGroupName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ElasticSanInputObject?.Id != null) + { + this.ElasticSanInputObject.Id += $"/volumegroups/{(global::System.Uri.EscapeDataString(this.VolumeGroupName.ToString()))}"; + await this.Client.VolumesPreBackupViaIdentity(ElasticSanInputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ElasticSanInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + await this.Client.VolumesPreBackup(ElasticSanInputObject.SubscriptionId ?? null, ElasticSanInputObject.ResourceGroupName ?? null, ElasticSanInputObject.ElasticSanName ?? null, VolumeGroupName, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded.cs new file mode 100644 index 000000000000..45322dcc4424 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded.cs @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// object to hold array of volume names + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeNameList(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _elasticSanInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity ElasticSanInputObject { get => this._elasticSanInputObject; set => this._elasticSanInputObject = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = value; } + + /// array of volume names + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "array of volume names")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"array of volume names", + SerializedName = @"volumeNames", + PossibleTypes = new [] { typeof(string) })] + public string[] VolumeName { get => _parametersBody.VolumeName?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.VolumeName = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.VolumeGroupName = this.VolumeGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ElasticSanInputObject?.Id != null) + { + this.ElasticSanInputObject.Id += $"/volumegroups/{(global::System.Uri.EscapeDataString(this.VolumeGroupName.ToString()))}"; + await this.Client.VolumesPreBackupViaIdentity(ElasticSanInputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ElasticSanInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + await this.Client.VolumesPreBackup(ElasticSanInputObject.SubscriptionId ?? null, ElasticSanInputObject.ResourceGroupName ?? null, ElasticSanInputObject.ElasticSanName ?? null, VolumeGroupName, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded.cs new file mode 100644 index 000000000000..1980041dcf97 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded.cs @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// object to hold array of volume names + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeNameList _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeNameList(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// array of volume names + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "array of volume names")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"array of volume names", + SerializedName = @"volumeNames", + PossibleTypes = new [] { typeof(string) })] + public string[] VolumeName { get => _parametersBody.VolumeName?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.VolumeName = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.VolumesPreBackupViaIdentity(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) ); + } + 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.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.VolumeGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VolumeGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.VolumesPreBackup(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ElasticSanName ?? null, InputObject.VolumeGroupName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonFilePath.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonFilePath.cs new file mode 100644 index 000000000000..1889e44541de --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonFilePath.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.NotSuggestDefaultParameterSet] + public partial class TestAzElasticSanVolumeBackup_BackupViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 Backup operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Backup operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Backup 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupViaJsonFilePath Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreBackupViaJsonString(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_BackupViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonString.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonString.cs new file mode 100644 index 000000000000..c3b0d03d1f0e --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonString.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// Validate whether a disk snapshot backup can be taken for list of volumes. + /// + /// [OpenAPI] PreBackup=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeBackup_BackupViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a disk snapshot backup can be taken for list of volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preBackup", ApiVersion = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.NotSuggestDefaultParameterSet] + public partial class TestAzElasticSanVolumeBackup_BackupViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 Backup operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Backup operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Backup 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeBackup_BackupViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeBackup_BackupViaJsonString Clone() + { + var clone = new TestAzElasticSanVolumeBackup_BackupViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreBackup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreBackupViaJsonString(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeBackup_BackupViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_Restore.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_Restore.cs new file mode 100644 index 000000000000..1cfc262f28c6 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_Restore.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_Restore", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeRestore_Restore : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList _parameter; + + /// object to hold array of Disk Snapshot ARM IDs + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "object to hold array of Disk Snapshot ARM IDs", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"object to hold array of Disk Snapshot ARM IDs", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeRestore_Restore + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_Restore Clone() + { + var clone = new TestAzElasticSanVolumeRestore_Restore(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreRestore(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_Restore() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreExpanded.cs new file mode 100644 index 000000000000..1c29b09fd958 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreExpanded.cs @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeRestore_RestoreExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// object to hold array of Disk Snapshot ARM IDs + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.DiskSnapshotList(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// array of DiskSnapshot ARM IDs + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "array of DiskSnapshot ARM IDs")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"array of DiskSnapshot ARM IDs", + SerializedName = @"diskSnapshotIds", + PossibleTypes = new [] { typeof(string) })] + public string[] DiskSnapshotId { get => _parametersBody.DiskSnapshotId?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.DiskSnapshotId = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreExpanded Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreRestore(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_RestoreExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentity.cs new file mode 100644 index 000000000000..56f12ed0d445 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentity.cs @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeRestore_RestoreViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList _parameter; + + /// object to hold array of Disk Snapshot ARM IDs + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "object to hold array of Disk Snapshot ARM IDs", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"object to hold array of Disk Snapshot ARM IDs", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreViaIdentity Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.VolumesPreRestoreViaIdentity(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) ); + } + 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.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.VolumeGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VolumeGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.VolumesPreRestore(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ElasticSanName ?? null, InputObject.VolumeGroupName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_RestoreViaIdentity() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan.cs new file mode 100644 index 000000000000..bfdf96bb3dd5 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan.cs @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreViaIdentityElasticSan", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _elasticSanInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity ElasticSanInputObject { get => this._elasticSanInputObject; set => this._elasticSanInputObject = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList _parameter; + + /// object to hold array of Disk Snapshot ARM IDs + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "object to hold array of Disk Snapshot ARM IDs", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"object to hold array of Disk Snapshot ARM IDs", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.VolumeGroupName = this.VolumeGroupName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ElasticSanInputObject?.Id != null) + { + this.ElasticSanInputObject.Id += $"/volumegroups/{(global::System.Uri.EscapeDataString(this.VolumeGroupName.ToString()))}"; + await this.Client.VolumesPreRestoreViaIdentity(ElasticSanInputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ElasticSanInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + await this.Client.VolumesPreRestore(ElasticSanInputObject.SubscriptionId ?? null, ElasticSanInputObject.ResourceGroupName ?? null, ElasticSanInputObject.ElasticSanName ?? null, VolumeGroupName, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded.cs new file mode 100644 index 000000000000..8c75d2e332f8 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded.cs @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// object to hold array of Disk Snapshot ARM IDs + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.DiskSnapshotList(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// array of DiskSnapshot ARM IDs + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "array of DiskSnapshot ARM IDs")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"array of DiskSnapshot ARM IDs", + SerializedName = @"diskSnapshotIds", + PossibleTypes = new [] { typeof(string) })] + public string[] DiskSnapshotId { get => _parametersBody.DiskSnapshotId?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.DiskSnapshotId = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _elasticSanInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity ElasticSanInputObject { get => this._elasticSanInputObject; set => this._elasticSanInputObject = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.VolumeGroupName = this.VolumeGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ElasticSanInputObject?.Id != null) + { + this.ElasticSanInputObject.Id += $"/volumegroups/{(global::System.Uri.EscapeDataString(this.VolumeGroupName.ToString()))}"; + await this.Client.VolumesPreRestoreViaIdentity(ElasticSanInputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ElasticSanInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + if (null == ElasticSanInputObject.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ElasticSanInputObject has null value for ElasticSanInputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ElasticSanInputObject) ); + } + await this.Client.VolumesPreRestore(ElasticSanInputObject.SubscriptionId ?? null, ElasticSanInputObject.ResourceGroupName ?? null, ElasticSanInputObject.ElasticSanName ?? null, VolumeGroupName, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded.cs new file mode 100644 index 000000000000..8859ad6d4d63 --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded.cs @@ -0,0 +1,560 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + public partial class TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// object to hold array of Disk Snapshot ARM IDs + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IDiskSnapshotList _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.DiskSnapshotList(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// array of DiskSnapshot ARM IDs + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "array of DiskSnapshot ARM IDs")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"array of DiskSnapshot ARM IDs", + SerializedName = @"diskSnapshotIds", + PossibleTypes = new [] { typeof(string) })] + public string[] DiskSnapshotId { get => _parametersBody.DiskSnapshotId?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.DiskSnapshotId = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.VolumesPreRestoreViaIdentity(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) ); + } + 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.ElasticSanName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ElasticSanName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.VolumeGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VolumeGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.VolumesPreRestore(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ElasticSanName ?? null, InputObject.VolumeGroupName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath.cs new file mode 100644 index 000000000000..fe7443a1176e --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath.cs @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.NotSuggestDefaultParameterSet] + public partial class TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 Restore operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Restore operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Restore 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreRestoreViaJsonString(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonString.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonString.cs new file mode 100644 index 000000000000..d9503265ccce --- /dev/null +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonString.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Cmdlets; + using System; + + /// + /// Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes. + /// + /// + /// [OpenAPI] PreRestore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzElasticSanVolumeRestore_RestoreViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPreValidationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/preRestore", ApiVersion = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.NotSuggestDefaultParameterSet] + public partial class TestAzElasticSanVolumeRestore_RestoreViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _elasticSanName; + + /// The name of the ElasticSan. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the ElasticSan.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the ElasticSan.", + SerializedName = @"elasticSanName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string ElasticSanName { get => this._elasticSanName; set => this._elasticSanName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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 Restore operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Restore operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Restore 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.ElasticSan.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _volumeGroupName; + + /// The name of the VolumeGroup. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VolumeGroup.")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VolumeGroup.", + SerializedName = @"volumeGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Path)] + public string VolumeGroupName { get => this._volumeGroupName; set => this._volumeGroupName = 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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of TestAzElasticSanVolumeRestore_RestoreViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.TestAzElasticSanVolumeRestore_RestoreViaJsonString Clone() + { + var clone = new TestAzElasticSanVolumeRestore_RestoreViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ElasticSanName = this.ElasticSanName; + clone.VolumeGroupName = this.VolumeGroupName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesPreRestore' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesPreRestoreViaJsonString(SubscriptionId, ResourceGroupName, ElasticSanName, VolumeGroupName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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,ElasticSanName=ElasticSanName,VolumeGroupName=VolumeGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public TestAzElasticSanVolumeRestore_RestoreViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.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.ElasticSan.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.ElasticSan.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.ElasticSan.Models.IPreValidationResponse + /// 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.ElasticSan.Models.IPreValidationResponse + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateExpanded.cs index b58b31e5af2d..e4227157af59 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolumeGroup_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,18 +41,9 @@ public partial class UpdateAzElasticSanVolumeGroup_UpdateExpanded : global::Syst /// 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; - /// Volume Group request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeGroupUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -386,11 +377,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -706,24 +692,7 @@ public UpdateAzElasticSanVolumeGroup_UpdateExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded.cs index 49ed76b87bba..aecc8a0ab8d5 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,18 +41,9 @@ public partial class UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanEx /// 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; - /// Volume Group request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeGroupUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -346,11 +337,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -688,24 +674,7 @@ public UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded.cs index a9e584808625..7cfcb98cc550 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an VolumeGroup.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -41,18 +41,9 @@ public partial class UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded : g /// 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; - /// Volume Group request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroupUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeGroupUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -328,11 +319,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -672,24 +658,7 @@ public UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateExpanded.cs index 1bbdc6112e5b..04eec1333ea1 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolume_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class UpdateAzElasticSanVolume_UpdateExpanded : global::System.Ma /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -305,11 +296,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -629,24 +615,7 @@ public UpdateAzElasticSanVolume_UpdateExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded.cs index 324979e44e83..6ae4fca573c6 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpande /// 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; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -265,11 +256,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -610,24 +596,7 @@ public UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityExpanded.cs index c5c2678c4b67..a29a68587f8a 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolume_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class UpdateAzElasticSanVolume_UpdateViaIdentityExpanded : global /// 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; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -232,11 +223,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -584,24 +570,7 @@ public UpdateAzElasticSanVolume_UpdateViaIdentityExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded.cs index eaf47e8f68b7..517ee1996dee 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update an Volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,18 +40,9 @@ public partial class UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpand /// 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; - /// Response for Volume request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VolumeUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] @@ -250,11 +241,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSanV /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -600,24 +586,7 @@ public UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateExpanded.cs index 4da5ad1c5aac..d4c577a87e1a 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update a Elastic San.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSan_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,23 +40,26 @@ public partial class UpdateAzElasticSan_UpdateExpanded : global::System.Manageme /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// A buffer to record first returned object in response. - private object _firstResponse = null; - /// Response for ElasticSan update request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSanUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enable or Disable scale up setting on Elastic San Appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + public string AutoScalePolicyEnforcement { get => _parametersBody.AutoScalePolicyEnforcement ?? null; set => _parametersBody.AutoScalePolicyEnforcement = value; } + /// Base size of the Elastic San appliance in TiB. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Base size of the Elastic San appliance in TiB.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] @@ -76,6 +79,17 @@ public partial class UpdateAzElasticSan_UpdateExpanded : global::System.Manageme /// Accessor for cancellationTokenSource. public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Maximum scale up size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum scale up size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + public long CapacityUnitScaleUpLimitTiB { get => _parametersBody.CapacityUnitScaleUpLimitTiB ?? default(long); set => _parametersBody.CapacityUnitScaleUpLimitTiB = value; } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.ClientAPI; @@ -115,6 +129,17 @@ public partial class UpdateAzElasticSan_UpdateExpanded : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unit to increase Capacity Unit on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + public long IncreaseCapacityUnitByTiB { get => _parametersBody.IncreaseCapacityUnitByTiB ?? default(long); set => _parametersBody.IncreaseCapacityUnitByTiB = value; } + /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -230,6 +255,17 @@ public partial class UpdateAzElasticSan_UpdateExpanded : global::System.Manageme PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags) })] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + /// Unused size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unused size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + public long UnusedSizeTiB { get => _parametersBody.UnusedSizeTiB ?? default(long); set => _parametersBody.UnusedSizeTiB = 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 @@ -299,11 +335,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSan_ /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -619,24 +650,7 @@ public UpdateAzElasticSan_UpdateExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateViaIdentityExpanded.cs index 6c3ac9d2bf66..3c7930b0e1b9 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateViaIdentityExpanded.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan))] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"update a Elastic San.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2025-09-01")] public partial class UpdateAzElasticSan_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IContext @@ -40,23 +40,26 @@ public partial class UpdateAzElasticSan_UpdateViaIdentityExpanded : global::Syst /// 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; - /// Response for ElasticSan update request. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdate _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ElasticSanUpdate(); - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// Enable or Disable scale up setting on Elastic San Appliance. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enable or Disable scale up setting on Elastic San Appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or Disable scale up setting on Elastic San Appliance.", + SerializedName = @"autoScalePolicyEnforcement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + public string AutoScalePolicyEnforcement { get => _parametersBody.AutoScalePolicyEnforcement ?? null; set => _parametersBody.AutoScalePolicyEnforcement = value; } + /// Base size of the Elastic San appliance in TiB. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Base size of the Elastic San appliance in TiB.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] @@ -76,6 +79,17 @@ public partial class UpdateAzElasticSan_UpdateViaIdentityExpanded : global::Syst /// Accessor for cancellationTokenSource. public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Maximum scale up size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum scale up size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum scale up size on Elastic San appliance in TiB.", + SerializedName = @"capacityUnitScaleUpLimitTiB", + PossibleTypes = new [] { typeof(long) })] + public long CapacityUnitScaleUpLimitTiB { get => _parametersBody.CapacityUnitScaleUpLimitTiB ?? default(long); set => _parametersBody.CapacityUnitScaleUpLimitTiB = value; } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ElasticSan Client => Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.ClientAPI; @@ -115,6 +129,17 @@ public partial class UpdateAzElasticSan_UpdateViaIdentityExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + /// Unit to increase Capacity Unit on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unit to increase Capacity Unit on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unit to increase Capacity Unit on Elastic San appliance in TiB.", + SerializedName = @"increaseCapacityUnitByTiB", + PossibleTypes = new [] { typeof(long) })] + public long IncreaseCapacityUnitByTiB { get => _parametersBody.IncreaseCapacityUnitByTiB ?? default(long); set => _parametersBody.IncreaseCapacityUnitByTiB = value; } + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity _inputObject; @@ -190,6 +215,17 @@ public partial class UpdateAzElasticSan_UpdateViaIdentityExpanded : global::Syst PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags) })] public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanUpdateTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + /// Unused size on Elastic San appliance in TiB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unused size on Elastic San appliance in TiB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unused size on Elastic San appliance in TiB.", + SerializedName = @"unusedSizeTiB", + PossibleTypes = new [] { typeof(long) })] + public long UnusedSizeTiB { get => _parametersBody.UnusedSizeTiB ?? default(long); set => _parametersBody.UnusedSizeTiB = 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 @@ -256,11 +292,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Cmdlets.UpdateAzElasticSan_ /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -596,24 +627,7 @@ public UpdateAzElasticSan_UpdateViaIdentityExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } + WriteObject(result, false); } } } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/runtime/Context.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/runtime/Context.cs index cc4b1dd59378..4396cd1fe3e9 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/runtime/Context.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/runtime/Context.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime /// The IContext Interface defines the communication mechanism for input customization. /// /// - /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. /// public interface IContext { diff --git a/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 b/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 index 9751792f7734..4b019daf82d5 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Gets a list of ElasticSan operations. +List the operations for the provider .Description -Gets a list of ElasticSan operations. +List the operations for the provider .Example {{ Add code here }} .Example diff --git a/generated/ElasticSan/ElasticSan.Autorest/internal/New-AzElasticSan.ps1 b/generated/ElasticSan/ElasticSan.Autorest/internal/New-AzElasticSan.ps1 index d53ac0dd942f..3a26ae818904 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/internal/New-AzElasticSan.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/internal/New-AzElasticSan.ps1 @@ -20,7 +20,7 @@ Create ElasticSan. .Description Create ElasticSan. .Example -New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -101,6 +101,13 @@ param( # The sku name. ${SkuName}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Enable or Disable scale up setting on Elastic San Appliance. + ${AutoScalePolicyEnforcement}, + [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] @@ -108,6 +115,18 @@ param( # Logical zone for Elastic San resource; example: ["1"]. ${AvailabilityZone}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Maximum scale up size on Elastic San appliance in TiB. + ${CapacityUnitScaleUpLimitTiB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unit to increase Capacity Unit on Elastic San appliance in TiB. + ${IncreaseCapacityUnitByTiB}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] @@ -130,6 +149,12 @@ param( # Resource tags. ${Tag}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unused size on Elastic San appliance in TiB. + ${UnusedSizeTiB}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] diff --git a/generated/ElasticSan/ElasticSan.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/ElasticSan/ElasticSan.Autorest/internal/ProxyCmdletDefinitions.ps1 index 9fa5dd29b339..ccf1f87f4887 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Gets a list of ElasticSan operations. +List the operations for the provider .Description -Gets a list of ElasticSan operations. +List the operations for the provider .Example {{ Add code here }} .Example @@ -425,7 +425,7 @@ Create ElasticSan. .Description Create ElasticSan. .Example -New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -506,6 +506,13 @@ param( # The sku name. ${SkuName}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("None", "Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.String] + # Enable or Disable scale up setting on Elastic San Appliance. + ${AutoScalePolicyEnforcement}, + [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] @@ -513,6 +520,18 @@ param( # Logical zone for Elastic San resource; example: ["1"]. ${AvailabilityZone}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Maximum scale up size on Elastic San appliance in TiB. + ${CapacityUnitScaleUpLimitTiB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unit to increase Capacity Unit on Elastic San appliance in TiB. + ${IncreaseCapacityUnitByTiB}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] @@ -535,6 +554,12 @@ param( # Resource tags. ${Tag}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')] + [System.Int64] + # Unused size on Elastic San appliance in TiB. + ${UnusedSizeTiB}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()]