diff --git a/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml b/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml index 2bdb50066496..7c6b0958a78a 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml +++ b/generated/ElasticSan/ElasticSan.Autorest/Az.ElasticSan.format.ps1xml @@ -329,28 +329,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse - - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PreValidationResponse#Multiple - - - - - - - - - - - - ValidationStatus - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.PrivateEndpointConnection @@ -675,46 +653,6 @@ - - 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 d1aa3f0665b2..df670c3e3189 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', 'Test-AzElasticSanVolumeBackup', 'Test-AzElasticSanVolumeRestore', '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', '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 51665853a8d9..c857cfd0d76f 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.1")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.4.1")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.5.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.5.0")] [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 bb30a53a948c..84d3e905b78e 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' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -89,31 +89,6 @@ 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 8f6224684989..5ba716421282 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -2780,598 +2780,6 @@ 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. @@ -3652,7 +3060,7 @@ Update a Elastic San. .Description Update a Elastic San. .Example -$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 5 -ExtendedCapacitySizeTib 20 -Tag @{"tag3" = "value3"} -CapacityUnitScaleUpLimitTiB 20 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 5 -AutoScalePolicyEnforcement Disabled +$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 64 -ExtendedCapacitySizeTib 128 -Tag @{"tag3" = "value3"} .Inputs Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity @@ -3706,37 +3114,18 @@ 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')] @@ -3752,12 +3141,6 @@ 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()] @@ -4156,7 +3539,7 @@ Create ElasticSan. .Description Create ElasticSan. .Example -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 +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -4225,31 +3608,6 @@ 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 deleted file mode 100644 index 487ef8387a70..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeBackup.ps1 +++ /dev/null @@ -1,311 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -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 deleted file mode 100644 index 93dd1cd337c8..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/exports/Test-AzElasticSanVolumeRestore.ps1 +++ /dev/null @@ -1,311 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code -# is regenerated. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -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 849653ff0ca9..6a3a837fc28a 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 5 -ExtendedCapacitySizeTib 20 -Tag @{"tag3" = "value3"} -CapacityUnitScaleUpLimitTiB 20 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 5 -AutoScalePolicyEnforcement Disabled +$elasticSan = Update-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 64 -ExtendedCapacitySizeTib 128 -Tag @{"tag3" = "value3"} .Inputs Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity @@ -74,37 +74,18 @@ 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')] @@ -120,12 +101,6 @@ 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 724c91d9bc61..5229b1e7a8da 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generate-info.json +++ b/generated/ElasticSan/ElasticSan.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "d4a443b3-a298-4cd8-afa8-fc88ee8e9513" + "generate_Id": "54866fc1-12de-4954-a2d8-0f71c87ec4ec" } diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs index d059f33e42c8..35a151849d6e 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/ElasticSan.cs @@ -9,7 +9,6 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan /// /// Low-level API implementation for the ElasticSan service. - /// (missing-service-description) Add service description /// public partial class ElasticSan { @@ -30,7 +29,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -77,7 +76,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -134,7 +133,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -194,7 +193,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -240,7 +239,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -287,7 +286,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -661,7 +660,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -703,7 +702,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -937,7 +936,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -980,7 +979,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1033,7 +1032,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1088,7 +1087,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1267,7 +1266,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1307,7 +1306,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1356,7 +1355,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1406,7 +1405,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1580,7 +1579,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1618,7 +1617,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1664,7 +1663,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1710,7 +1709,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1882,7 +1881,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1929,7 +1928,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1986,7 +1985,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2046,7 +2045,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2092,7 +2091,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2139,7 +2138,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2498,7 +2497,7 @@ public partial class ElasticSan } } - /// List the operations for the provider + /// Gets a list of ElasticSan operations. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2509,7 +2508,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2533,7 +2532,7 @@ public partial class ElasticSan } } - /// List the operations for the provider + /// Gets a list of ElasticSan operations. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2545,7 +2544,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2578,7 +2577,7 @@ public partial class ElasticSan } } - /// List the operations for the provider + /// Gets a list of ElasticSan operations. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync pipeline to use to make the request. @@ -2588,7 +2587,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2621,7 +2620,7 @@ public partial class ElasticSan } } - /// List the operations for the provider + /// Gets a list of ElasticSan operations. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.ISendAsync pipeline to use to make the request. /// @@ -2630,7 +2629,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2799,7 +2798,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2850,7 +2849,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2912,7 +2911,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2978,7 +2977,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3029,7 +3028,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3081,7 +3080,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3464,7 +3463,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3510,7 +3509,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3748,7 +3747,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3791,7 +3790,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3845,7 +3844,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3902,7 +3901,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4088,7 +4087,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4130,7 +4129,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4182,7 +4181,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4236,7 +4235,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4419,7 +4418,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4461,7 +4460,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4513,7 +4512,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4567,7 +4566,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4751,7 +4750,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4792,7 +4791,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4841,7 +4840,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4890,7 +4889,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5065,7 +5064,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5114,7 +5113,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5174,7 +5173,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5238,7 +5237,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5287,7 +5286,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5337,7 +5336,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5719,7 +5718,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5763,7 +5762,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6006,7 +6005,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6051,7 +6050,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6107,7 +6106,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6166,7 +6165,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6353,7 +6352,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6365,7 +6364,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"); @@ -6395,16 +6394,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 = @"2025-09-01"; + var apiVersion = @"2024-05-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 @@ -6419,7 +6418,7 @@ public partial class ElasticSan + resourceGroupName + "/providers/Microsoft.ElasticSan/elasticSans/" + elasticSanName - + "/volumegroups" + + "/volumeGroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6447,16 +6446,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 = @"2025-09-01"; + var apiVersion = @"2024-05-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 @@ -6471,7 +6470,7 @@ public partial class ElasticSan + resourceGroupName + "/providers/Microsoft.ElasticSan/elasticSans/" + elasticSanName - + "/volumegroups" + + "/volumeGroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6501,7 +6500,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6513,7 +6512,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"); @@ -6687,7 +6686,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6736,7 +6735,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6796,7 +6795,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6860,7 +6859,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6909,7 +6908,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6959,7 +6958,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7343,7 +7342,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7394,7 +7393,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7457,7 +7456,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7525,7 +7524,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7577,7 +7576,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7630,7 +7629,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8020,7 +8019,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8066,7 +8065,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8316,7 +8315,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8361,7 +8360,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8418,7 +8417,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8479,7 +8478,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8677,7 +8676,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8693,9 +8692,9 @@ public partial class ElasticSan + global::System.Uri.EscapeDataString(volumeGroupName) + "/snapshots" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8726,7 +8725,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8755,9 +8754,9 @@ public partial class ElasticSan + volumeGroupName + "/snapshots" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8786,7 +8785,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8815,9 +8814,9 @@ public partial class ElasticSan + volumeGroupName + "/snapshots" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -8849,7 +8848,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8865,9 +8864,9 @@ public partial class ElasticSan + global::System.Uri.EscapeDataString(volumeGroupName) + "/snapshots" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -9047,7 +9046,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9098,7 +9097,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9161,7 +9160,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9229,7 +9228,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9281,7 +9280,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9334,7 +9333,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9728,7 +9727,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9788,7 +9787,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10056,7 +10055,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10103,7 +10102,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10162,7 +10161,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10225,7 +10224,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10420,7 +10419,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10464,7 +10463,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10519,7 +10518,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10577,7 +10576,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10751,1350 +10750,6 @@ 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. @@ -12113,7 +10768,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12164,7 +10819,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12227,7 +10882,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12295,7 +10950,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12347,7 +11002,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 = @"2025-09-01"; + var apiVersion = @"2024-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12400,7 +11055,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 = @"2025-09-01"; + var apiVersion = @"2024-05-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 deleted file mode 100644 index 01e42b9053ef..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.PowerShell.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 660d7f846b77..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index ecac46fe18ed..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index d449fcea2179..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/AutoScaleProperties.json.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index b89796cf77ea..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.PowerShell.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index a6536f3a846e..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 35f8f0086183..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 1755baff57b8..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/DiskSnapshotList.json.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 f849011c3e29..cce3ff4925c1 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.PowerShell.cs @@ -158,10 +158,6 @@ 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)); @@ -214,26 +210,6 @@ 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); } @@ -307,10 +283,6 @@ 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)); @@ -363,26 +335,6 @@ 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 1cbf7a581df0..c89f036c2eb2 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSan.cs @@ -19,10 +19,6 @@ 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 */; } @@ -31,10 +27,6 @@ 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); } @@ -45,20 +37,10 @@ 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 */; } @@ -209,10 +191,6 @@ 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; } @@ -240,18 +218,6 @@ 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, @@ -274,17 +240,6 @@ 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, @@ -296,17 +251,6 @@ 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, @@ -328,7 +272,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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] string ProvisioningState { get; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -412,17 +356,6 @@ 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, @@ -440,29 +373,18 @@ 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] string ProvisioningState { get; set; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -485,8 +407,6 @@ 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 ab715761cc75..c79e6d44d1e0 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanIdentity.PowerShell.cs @@ -113,10 +113,6 @@ 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); @@ -125,6 +121,10 @@ 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,10 +162,6 @@ 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); @@ -174,6 +170,10 @@ 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 0bf920735e9e..7a1144b9a545 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 b357195cc1f6..67bbfc5f20af 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.cs @@ -14,17 +14,20 @@ 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; - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } + public string NextLink { get => this._nextLink; } /// Backing field for property. private System.Collections.Generic.List _value; - /// The ElasticSan items on this page + /// An array of Elastic San objects. [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; } @@ -38,25 +41,25 @@ public ElasticSanList() public partial interface IElasticSanList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", + Create = false, + Update = false, + Description = @"URI to fetch the next section of the paginated response.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The ElasticSan items on this page + string NextLink { get; } + /// An array of Elastic San objects. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"The ElasticSan items on this page", + Description = @"An array of Elastic San objects.", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan) })] System.Collections.Generic.List Value { get; set; } @@ -66,9 +69,9 @@ public partial interface IElasticSanList : internal partial interface IElasticSanListInternal { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. string NextLink { get; set; } - /// The ElasticSan items on this page + /// An array of Elastic San objects. 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 b1efdd03a491..51bd4077b86f 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanList.json.cs @@ -110,7 +110,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - 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 ); + 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 ); + } 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 c08f36c4dea1..302653cf7f36 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.PowerShell.cs @@ -106,10 +106,6 @@ 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)); @@ -162,26 +158,6 @@ 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); } @@ -203,10 +179,6 @@ 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)); @@ -259,26 +231,6 @@ 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 abb96c657799..cf9d1eac83d1 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.cs @@ -14,17 +14,6 @@ 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; @@ -39,10 +28,6 @@ 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; @@ -50,16 +35,6 @@ 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;} } } @@ -150,10 +125,6 @@ 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; @@ -171,18 +142,6 @@ 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, @@ -205,17 +164,6 @@ 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, @@ -227,17 +175,6 @@ 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, @@ -259,7 +196,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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] string ProvisioningState { get; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -343,17 +280,6 @@ 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, @@ -371,27 +297,16 @@ 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] string ProvisioningState { get; set; } /// /// Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. @@ -414,8 +329,6 @@ 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 30520eec88e6..39c322d0e795 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanProperties.json.cs @@ -66,7 +66,6 @@ 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;} @@ -113,7 +112,6 @@ 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 91ec5fbc2db7..967f23c6039d 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.PowerShell.cs @@ -110,10 +110,6 @@ 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))); @@ -126,26 +122,6 @@ 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); } @@ -171,10 +147,6 @@ 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))); @@ -187,26 +159,6 @@ 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 1a91c8f54bdb..9a35d952fd06 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdate.cs @@ -14,32 +14,14 @@ 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;} } } @@ -64,10 +46,6 @@ 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() { @@ -78,18 +56,6 @@ 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, @@ -101,17 +67,6 @@ 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, @@ -123,17 +78,6 @@ 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'. @@ -160,38 +104,16 @@ 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; } /// @@ -202,8 +124,6 @@ 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 e55d1858d9c7..88972c92a1c5 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.PowerShell.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.PowerShell.cs @@ -102,10 +102,6 @@ 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))); @@ -118,26 +114,6 @@ 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); } @@ -155,10 +131,6 @@ 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))); @@ -171,26 +143,6 @@ 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 302c1a322ae6..ea13c73a4976 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.cs @@ -14,17 +14,6 @@ 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; @@ -32,10 +21,6 @@ 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; @@ -43,16 +28,6 @@ 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; @@ -63,10 +38,6 @@ 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() { @@ -77,18 +48,6 @@ 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, @@ -100,17 +59,6 @@ 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, @@ -122,17 +70,6 @@ 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'. @@ -148,46 +85,22 @@ 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 e8731f60e68d..9f22156b1179 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ElasticSanUpdateProperties.json.cs @@ -65,7 +65,6 @@ 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); } @@ -101,7 +100,6 @@ 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 40c09d6d0249..a776a7a57462 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 deleted file mode 100644 index 58bdab11b987..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.PowerShell.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 59a034004095..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index cab8a24f886f..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 3d591ed9aff6..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PreValidationResponse.json.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 67ad497c597c..18b56106e22d 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.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ProxyResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Resource(); /// 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)__proxyResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).Id = value ?? null; } + 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; } /// Internal Acessors for Name - 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; } + 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; } /// 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)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).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)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).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)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy = value ?? null; } + 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; } /// Internal Acessors for SystemDataCreatedByType - 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; } + 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; } /// Internal Acessors for SystemDataLastModifiedAt - 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); } + 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); } /// Internal Acessors for SystemDataLastModifiedBy - 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; } + 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; } /// Internal Acessors for SystemDataLastModifiedByType - 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; } + 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; } /// Internal Acessors for Type - 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; } + 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; } /// 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)__proxyResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } + 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 */; } /// 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)__proxyResource).SystemDataCreatedAt; } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataCreatedBy; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataCreatedByType; } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataLastModifiedAt; } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataLastModifiedBy; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).SystemDataLastModifiedByType; } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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)__proxyResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal)__resource).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(__proxyResource), __proxyResource); - await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); } } /// Response for PrivateEndpoint Connection object public partial interface IPrivateEndpointConnection : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResource { /// 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] string ProvisioningState { get; } } /// Response for PrivateEndpoint Connection object internal partial interface IPrivateEndpointConnectionInternal : - Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IProxyResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IResourceInternal { /// 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 bd4152352766..c60227b2a02e 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; } - __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ProxyResource(json); + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Resource(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; } - __proxyResource?.ToJson(container, serializationMode); + __resource?.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 104120ae9b46..f150e96df2f0 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; - /// The response of a PrivateEndpointConnection list operation. + /// List of private endpoint connections associated with SAN [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] public partial class PrivateEndpointConnectionListResult { @@ -164,7 +164,7 @@ public override string ToString() return ToJsonString(); } } - /// The response of a PrivateEndpointConnection list operation. + /// List of private endpoint connections associated with SAN [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 4811cf861e01..171e8c922ede 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs @@ -7,23 +7,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Extensions; - /// The response of a PrivateEndpointConnection list operation. + /// List of private endpoint connections associated with SAN 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; - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } + public string NextLink { get => this._nextLink; } /// Backing field for property. private System.Collections.Generic.List _value; - /// The PrivateEndpointConnection items on this page + /// Array of private endpoint connections [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; } @@ -33,41 +36,41 @@ public PrivateEndpointConnectionListResult() } } - /// The response of a PrivateEndpointConnection list operation. + /// List of private endpoint connections associated with SAN public partial interface IPrivateEndpointConnectionListResult : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", + Create = false, + Update = false, + Description = @"URI to fetch the next section of the paginated response.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The PrivateEndpointConnection items on this page + string NextLink { get; } + /// Array of private endpoint connections [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"The PrivateEndpointConnection items on this page", + Description = @"Array of private endpoint connections", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IPrivateEndpointConnection) })] System.Collections.Generic.List Value { get; set; } } - /// The response of a PrivateEndpointConnection list operation. + /// List of private endpoint connections associated with SAN internal partial interface IPrivateEndpointConnectionListResultInternal { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. string NextLink { get; set; } - /// The PrivateEndpointConnection items on this page + /// Array of private endpoint connections 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 9a6a2998cc1c..1bca6bcb4088 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; - /// The response of a PrivateEndpointConnection list operation. + /// List of private endpoint connections associated with SAN public partial class PrivateEndpointConnectionListResult { @@ -111,7 +111,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - 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 ); + 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 ); + } 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 5e96cd57d32f..ceda7cdd8268 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 f3abb2d16b3c..f507c9352d48 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 = true, + Required = false, 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 deleted file mode 100644 index fa40256852fc..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.PowerShell.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 7426e2cd64e1..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 9a7bf00461a3..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 3bebbd0e0fb0..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/ScaleUpProperties.json.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 c6a4ce127f18..bd5ca25129c1 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.cs @@ -13,20 +13,23 @@ 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; - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } + public string NextLink { get => this._nextLink; } /// Backing field for property. private System.Collections.Generic.List _value; - /// The SkuInformation items on this page + /// List of ResourceType Sku [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] public System.Collections.Generic.List Value { get => this._value; } @@ -40,25 +43,25 @@ public SkuInformationList() public partial interface ISkuInformationList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", + Create = false, + Update = false, + Description = @"URI to fetch the next section of the paginated response.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The SkuInformation items on this page + string NextLink { get; } + /// List of ResourceType Sku [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, ReadOnly = true, Read = true, Create = false, Update = false, - Description = @"The SkuInformation items on this page", + Description = @"List of ResourceType Sku", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISkuInformation) })] System.Collections.Generic.List Value { get; } @@ -68,9 +71,9 @@ public partial interface ISkuInformationList : internal partial interface ISkuInformationListInternal { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. string NextLink { get; set; } - /// The SkuInformation items on this page + /// List of ResourceType Sku 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 6c0eea5be370..1e0b886dd004 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SkuInformationList.json.cs @@ -113,7 +113,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso container.Add("value",__w); } } - 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 ); + 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 ); + } 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 38e13d4a4943..b8c3bdf71baf 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 21aaaf175ba5..ef31c63a143e 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.cs @@ -14,17 +14,20 @@ 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; - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } + public string NextLink { get => this._nextLink; } /// Backing field for property. private System.Collections.Generic.List _value; - /// The Snapshot items on this page + /// An array of Snapshot objects. [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; } @@ -38,25 +41,25 @@ public SnapshotList() public partial interface ISnapshotList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", + Create = false, + Update = false, + Description = @"URI to fetch the next section of the paginated response.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The Snapshot items on this page + string NextLink { get; } + /// An array of Snapshot objects. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"The Snapshot items on this page", + Description = @"An array of Snapshot objects.", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ISnapshot) })] System.Collections.Generic.List Value { get; set; } @@ -66,9 +69,9 @@ public partial interface ISnapshotList : internal partial interface ISnapshotListInternal { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. string NextLink { get; set; } - /// The Snapshot items on this page + /// An array of Snapshot objects. 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 01eb9f4502c8..e5e517237679 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/SnapshotList.json.cs @@ -110,7 +110,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - 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 ); + 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 ); + } 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 e3d0beb4688c..deabf59d8f6e 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 8b79333ddf26..7a0f99b29e85 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 fb76f799c795..ab79e8a9a187 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 b22011efb7a6..702fec740b8e 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.cs @@ -14,17 +14,20 @@ 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; - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } + public string NextLink { get => this._nextLink; } /// Backing field for property. private System.Collections.Generic.List _value; - /// The VolumeGroup items on this page + /// An array of Volume Groups objects. [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; } @@ -38,25 +41,25 @@ public VolumeGroupList() public partial interface IVolumeGroupList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", + Create = false, + Update = false, + Description = @"URI to fetch the next section of the paginated response.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The VolumeGroup items on this page + string NextLink { get; } + /// An array of Volume Groups objects. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"The VolumeGroup items on this page", + Description = @"An array of Volume Groups objects.", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolumeGroup) })] System.Collections.Generic.List Value { get; set; } @@ -66,9 +69,9 @@ public partial interface IVolumeGroupList : internal partial interface IVolumeGroupListInternal { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. string NextLink { get; set; } - /// The VolumeGroup items on this page + /// An array of Volume Groups objects. 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 508770917878..11d43d961239 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeGroupList.json.cs @@ -93,7 +93,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - 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 ); + 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 ); + } 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 7808b253cb9c..4ae2433cba6a 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 0af8ef17ac62..6accf9f315f5 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.cs @@ -14,17 +14,20 @@ 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; - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Origin(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } + public string NextLink { get => this._nextLink; } /// Backing field for property. private System.Collections.Generic.List _value; - /// The Volume items on this page + /// An array of Volume objects. [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; } @@ -38,25 +41,25 @@ public VolumeList() public partial interface IVolumeList : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.IJsonSerializable { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", + Create = false, + Update = false, + Description = @"URI to fetch the next section of the paginated response.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The Volume items on this page + string NextLink { get; } + /// An array of Volume objects. [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Read = true, Create = true, Update = true, - Description = @"The Volume items on this page", + Description = @"An array of Volume objects.", SerializedName = @"value", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IVolume) })] System.Collections.Generic.List Value { get; set; } @@ -66,9 +69,9 @@ public partial interface IVolumeList : internal partial interface IVolumeListInternal { - /// The link to the next page of items + /// URI to fetch the next section of the paginated response. string NextLink { get; set; } - /// The Volume items on this page + /// An array of Volume objects. 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 9236a77235bc..22c61fa6e7cc 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.json.cs +++ b/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeList.json.cs @@ -93,7 +93,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Json.JsonNode ToJso } container.Add("value",__w); } - 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 ); + 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 ); + } 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 deleted file mode 100644 index e1f8505343d7..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.PowerShell.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 8f51368822d1..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 9cc01408c6a5..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index c6254e124352..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/api/Models/VolumeNameList.json.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 30bc8e2765dc..f7893223d80a 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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", "Deleted", "Restoring")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Invalid", "Succeeded", "Failed", "Canceled", "Pending", "Creating", "Updating", "Deleting")] 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 d9823ee0a46c..de4a731d660b 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; - /// List the operations for the provider + /// Gets a list of ElasticSan operations. /// /// [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(@"List the operations for the provider")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Description(@"Gets a list of ElasticSan operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/providers/Microsoft.ElasticSan/operations", ApiVersion = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/providers/Microsoft.ElasticSan/operations", ApiVersion = "2024-05-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,12 +44,6 @@ 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. @@ -441,7 +435,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 / nextLink + // pageable / value / if (null != result.Value) { if (0 == _responseSize && 1 == result.Value.Count) @@ -465,20 +459,6 @@ 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 6ba0d4432edb..f4f1b1172470 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", ApiVersion = "2024-05-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,12 +43,6 @@ 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. @@ -476,7 +470,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 / nextLink + // pageable / value / if (null != result.Value) { if (0 == _responseSize && 1 == result.Value.Count) @@ -500,20 +494,6 @@ 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 df245ef5c0a4..ff5fba2ddabf 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 fe78774cdca8..48ca4808b5cf 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 69bef0b8c524..99933aa04df4 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 0452298f7b92..9b9e0e459c42 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups", ApiVersion = "2024-05-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 adb3fcd264a5..7f2dcc610353 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 = "2025-09-01")] + [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")] 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 6044a7e87d75..c8fd1e5c697c 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 = "2025-09-01")] + [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")] 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 88eb22bb2e74..1ec77aab1cc3 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 = "2025-09-01")] + [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")] 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 7a3c688a5723..59d5a8a2e112 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 = "2025-09-01")] + [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")] 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 9aa7de8c1890..6ab92d557895 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots", ApiVersion = "2024-05-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 b6d4bb5ea7fb..6727edbefb12 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 = "2025-09-01")] + [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")] 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 2da4c4dd3aad..60514079344b 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 = "2025-09-01")] + [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")] 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 48d1162cea67..ae48704fce64 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 = "2025-09-01")] + [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")] 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 30b2a95c3eee..31e175f39ee4 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 = "2025-09-01")] + [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")] 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 c0bf24d31e31..e4a2f6243d94 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", ApiVersion = "2024-05-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 c922070a5997..decd0029139b 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 5c6ee0276c56..9c0e972b3f93 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 bd8d5bfab6c1..bdca71593fb8 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", ApiVersion = "2024-05-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 95d68a9a6163..86fc9986e388 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", ApiVersion = "2024-05-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 2ea2149c81b8..4a5cb3b5658a 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityElasticSanExpanded.cs index b804eddf6063..d946404f77ce 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeGroup_CreateViaIdentityExpanded.cs index 81fb8b0d5971..81798b19de20 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateExpanded.cs index 05264c78793d..d4ecd450023f 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolumeSnapshot_CreateExpanded : 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/NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded.cs index 2307eeddcb80..343c9084a793 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityElasticSanExpanded : 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/NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded.cs index 93cebd6a8390..fd822192045d 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityExpanded : 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/NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded.cs index 92313c309f89..3f729d8aff07 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolumeSnapshot_CreateViaIdentityVolumegroupExpanded : 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/NewAzElasticSanVolume_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateExpanded.cs index f818af14f0df..28219983ac08 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolume_CreateExpanded : 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/NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded.cs index ab207f0939df..269e41ffe3b6 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolume_CreateViaIdentityElasticSanExpanded : 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/NewAzElasticSanVolume_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityExpanded.cs index 83c5e6a1916b..57fb6212e273 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolume_CreateViaIdentityExpanded : 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/NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded.cs index d67406d4fde9..b3d7e5236f1b 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 = "2025-09-01")] + [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")] public partial class NewAzElasticSanVolume_CreateViaIdentityVolumegroupExpanded : 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/NewAzElasticSan_CreateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateExpanded.cs index af741fa26156..81ef4f77e1ad 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 @@ -49,18 +49,6 @@ public partial class NewAzElasticSan_CreateExpanded : global::System.Management. [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\"].")] @@ -92,17 +80,6 @@ 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; @@ -142,17 +119,6 @@ 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; } } @@ -302,17 +268,6 @@ 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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/NewAzElasticSan_CreateViaIdentityExpanded.cs index 7a3c2c4e4eda..7bc8aa9626f2 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 @@ -49,18 +49,6 @@ public partial class NewAzElasticSan_CreateViaIdentityExpanded : global::System. [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\"].")] @@ -92,17 +80,6 @@ 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; @@ -142,17 +119,6 @@ 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; @@ -262,17 +228,6 @@ 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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_Delete.cs index 33d1e35b0d3d..59949b332ba3 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentity.cs index 617ae4b8c61f..cf475fd72983 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeGroup_DeleteViaIdentityElasticSan.cs index 4fe156eec997..0df594de0cb7 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_Delete.cs index b7fca4890102..b635ee2dbc17 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolumeSnapshot_Delete : 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/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity.cs index 7d42d3275595..b9f3ab88f323 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentity : 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/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan.cs index 307278ac269c..7ca84554ef9c 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityElasticSan : 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/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup.cs index 3a45b0f84fe2..a63ce66ba337 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolumeSnapshot_DeleteViaIdentityVolumegroup : 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/RemoveAzElasticSanVolume_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_Delete.cs index c226d23eda5d..7d6229068bfb 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolume_Delete : 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/RemoveAzElasticSanVolume_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentity.cs index 3c8d13a9f21b..0abc31707698 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolume_DeleteViaIdentity : 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/RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan.cs index 4a962c35bd66..24bcd27fc339 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolume_DeleteViaIdentityElasticSan : 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/RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup.cs index 4ab7ff4dda5b..fa3e74322a41 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 = "2025-09-01")] + [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")] public partial class RemoveAzElasticSanVolume_DeleteViaIdentityVolumegroup : 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/RemoveAzElasticSan_Delete.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_Delete.cs index c46add7dcd5c..659f92f0594a 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_DeleteViaIdentity.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/RemoveAzElasticSan_DeleteViaIdentity.cs index 5d28ae4a26a9..292dc3489066 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_Backup.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_Backup.cs deleted file mode 100644 index 29b62a1445ff..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_Backup.cs +++ /dev/null @@ -1,588 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index dc5f6722c7ca..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupExpanded.cs +++ /dev/null @@ -1,589 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index b842c4271852..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentity.cs +++ /dev/null @@ -1,555 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 0328758715d8..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSan.cs +++ /dev/null @@ -1,569 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 45322dcc4424..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityElasticSanExpanded.cs +++ /dev/null @@ -1,571 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 1980041dcf97..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaIdentityExpanded.cs +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 1889e44541de..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonFilePath.cs +++ /dev/null @@ -1,590 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index c3b0d03d1f0e..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeBackup_BackupViaJsonString.cs +++ /dev/null @@ -1,588 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 1cfc262f28c6..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_Restore.cs +++ /dev/null @@ -1,590 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 1c29b09fd958..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreExpanded.cs +++ /dev/null @@ -1,591 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 56f12ed0d445..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentity.cs +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index bfdf96bb3dd5..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSan.cs +++ /dev/null @@ -1,571 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 8c75d2e332f8..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityElasticSanExpanded.cs +++ /dev/null @@ -1,573 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index 8859ad6d4d63..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaIdentityExpanded.cs +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index fe7443a1176e..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonFilePath.cs +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 deleted file mode 100644 index d9503265ccce..000000000000 --- a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/TestAzElasticSanVolumeRestore_RestoreViaJsonString.cs +++ /dev/null @@ -1,590 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.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 e4227157af59..0e1022bc7760 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityElasticSanExpanded.cs index aecc8a0ab8d5..a3f9dc892412 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolumeGroup_UpdateViaIdentityExpanded.cs index 7cfcb98cc550..86c5f8f530bf 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", ApiVersion = "2024-05-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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateExpanded.cs index 04eec1333ea1..8da681324482 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 = "2025-09-01")] + [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")] public partial class UpdateAzElasticSanVolume_UpdateExpanded : 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/UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded.cs index 6ae4fca573c6..9130e9347971 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 = "2025-09-01")] + [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")] public partial class UpdateAzElasticSanVolume_UpdateViaIdentityElasticSanExpanded : 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/UpdateAzElasticSanVolume_UpdateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityExpanded.cs index a29a68587f8a..e1de98a54070 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 = "2025-09-01")] + [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")] public partial class UpdateAzElasticSanVolume_UpdateViaIdentityExpanded : 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/UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded.cs index 517ee1996dee..e86f872c2b38 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 = "2025-09-01")] + [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")] public partial class UpdateAzElasticSanVolume_UpdateViaIdentityVolumegroupExpanded : 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/UpdateAzElasticSan_UpdateExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateExpanded.cs index d4c577a87e1a..8521901d9fe6 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 @@ -48,18 +48,6 @@ public partial class UpdateAzElasticSan_UpdateExpanded : global::System.Manageme [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)] @@ -79,17 +67,6 @@ 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; @@ -129,17 +106,6 @@ 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; } } @@ -255,17 +221,6 @@ 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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateViaIdentityExpanded.cs b/generated/ElasticSan/ElasticSan.Autorest/generated/cmdlets/UpdateAzElasticSan_UpdateViaIdentityExpanded.cs index 3c7930b0e1b9..e9f96bff956f 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 = "2025-09-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", ApiVersion = "2024-05-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 @@ -48,18 +48,6 @@ public partial class UpdateAzElasticSan_UpdateViaIdentityExpanded : global::Syst [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)] @@ -79,17 +67,6 @@ 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; @@ -129,17 +106,6 @@ 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; @@ -215,17 +181,6 @@ 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 diff --git a/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 b/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 index 4b019daf82d5..9751792f7734 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/internal/Get-AzElasticSanOperation.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -List the operations for the provider +Gets a list of ElasticSan operations. .Description -List the operations for the provider +Gets a list of ElasticSan operations. .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 3a26ae818904..d53ac0dd942f 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' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -101,13 +101,6 @@ 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')] @@ -115,18 +108,6 @@ 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')] @@ -149,12 +130,6 @@ 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 ccf1f87f4887..9fa5dd29b339 100644 --- a/generated/ElasticSan/ElasticSan.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ElasticSan/ElasticSan.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -List the operations for the provider +Gets a list of ElasticSan operations. .Description -List the operations for the provider +Gets a list of ElasticSan operations. .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' -AvailabilityZone 1 -Tag @{tag1="value1";tag2="value2"} -AutoScalePolicyEnforcement Enabled -CapacityUnitScaleUpLimitTiB 30 -IncreaseCapacityUnitByTiB 2 -UnusedSizeTiB 6 +New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} .Example New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"} @@ -506,13 +506,6 @@ 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')] @@ -520,18 +513,6 @@ 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')] @@ -554,12 +535,6 @@ 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()]