From 972804ff721a0655e7a6d6fc4a3ad2d081995765 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Mon, 7 Jun 2021 14:47:41 +0800 Subject: [PATCH 1/2] Hotfix for the issue on windows powershell --- src/DiskPool/Az.DiskPool.psd1 | 4 +- src/DiskPool/build-module.ps1 | 4 +- src/DiskPool/custom/New-AzDiskPool.ps1 | 2 +- src/DiskPool/custom/Update-AzDiskPool.ps1 | 2 +- .../exports/ProxyCmdletDefinitions.ps1 | 10 ++--- src/DiskPool/exports/Stop-AzDiskPool.ps1 | 2 +- src/DiskPool/generate-info.json | 10 ++--- .../generated/api/Models/Any.PowerShell.cs | 20 ++++++++++ .../Api20210401Preview/Acl.PowerShell.cs | 20 ++++++++++ .../Api20210401Preview/Disk.PowerShell.cs | 40 ++++++++++++++----- .../Api20210401Preview/DiskPool.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolCreate.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolCreateProperties.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolCreateTags.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolListResult.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolProperties.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolUpdate.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolUpdateProperties.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolUpdateTags.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolZoneInfo.PowerShell.cs | 40 ++++++++++++++----- .../DiskPoolZoneListResult.PowerShell.cs | 40 ++++++++++++++----- .../EndpointDependency.PowerShell.cs | 40 ++++++++++++++----- .../EndpointDetail.PowerShell.cs | 40 ++++++++++++++----- .../Api20210401Preview/Error.PowerShell.cs | 40 ++++++++++++++----- .../ErrorAdditionalInfo.PowerShell.cs | 40 ++++++++++++++----- .../ErrorResponse.PowerShell.cs | 40 ++++++++++++++----- .../Api20210401Preview/IscsiLun.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTarget.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTargetCreate.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTargetCreateProperties.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTargetList.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTargetProperties.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTargetUpdate.PowerShell.cs | 40 ++++++++++++++----- .../IscsiTargetUpdateProperties.PowerShell.cs | 40 ++++++++++++++----- .../OutboundEnvironmentEndpoint.PowerShell.cs | 40 ++++++++++++++----- ...boundEnvironmentEndpointList.PowerShell.cs | 40 ++++++++++++++----- .../ProxyResource.PowerShell.cs | 40 ++++++++++++++----- .../Api20210401Preview/Resource.PowerShell.cs | 40 ++++++++++++++----- .../Api20210401Preview/Sku.PowerShell.cs | 40 ++++++++++++++----- .../StoragePoolOperationDisplay.PowerShell.cs | 40 ++++++++++++++----- ...oragePoolOperationListResult.PowerShell.cs | 40 ++++++++++++++----- .../StoragePoolRpOperation.PowerShell.cs | 40 ++++++++++++++----- .../SystemMetadata.PowerShell.cs | 40 ++++++++++++++----- .../TrackedResource.PowerShell.cs | 40 ++++++++++++++----- .../TrackedResourceTags.PowerShell.cs | 40 ++++++++++++++----- .../api/Models/DiskPoolIdentity.PowerShell.cs | 40 ++++++++++++++----- .../cmdlets/StopAzDiskPool_Deallocate.cs | 38 +++++++++--------- src/DiskPool/help/Stop-AzDiskPool.md | 24 +++++------ src/DiskPool/readme.md | 7 ++++ src/DiskPool/test/Stop-AzDiskPool.Tests.ps1 | 2 +- 50 files changed, 1206 insertions(+), 419 deletions(-) diff --git a/src/DiskPool/Az.DiskPool.psd1 b/src/DiskPool/Az.DiskPool.psd1 index 76f176568fbc..90b4dae270a5 100644 --- a/src/DiskPool/Az.DiskPool.psd1 +++ b/src/DiskPool/Az.DiskPool.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 5/27/2021 +# Generated on: 6/7/2021 # @{ @@ -111,7 +111,7 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = '* First preview release for module Az.DiskPool' + # ReleaseNotes = '' # Prerelease string of this module # Prerelease = '' diff --git a/src/DiskPool/build-module.ps1 b/src/DiskPool/build-module.ps1 index b404d28a2d03..d37e591c5b9f 100644 --- a/src/DiskPool/build-module.ps1 +++ b/src/DiskPool/build-module.ps1 @@ -122,8 +122,8 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' $modelCmdlets = @('Acl', 'IscsiLun') -. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') -Models $modelCmdlets -$moduleName = 'Az.DiskPool' +pwsh (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') -Models $modelCmdlets + if($NoDocs) { Write-Host -ForegroundColor Green 'Creating exports...' Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder diff --git a/src/DiskPool/custom/New-AzDiskPool.ps1 b/src/DiskPool/custom/New-AzDiskPool.ps1 index aa25a9461908..5b60234484fd 100644 --- a/src/DiskPool/custom/New-AzDiskPool.ps1 +++ b/src/DiskPool/custom/New-AzDiskPool.ps1 @@ -181,7 +181,7 @@ param( if ($PSBoundParameters.ContainsKey("DiskId")){ $disk = @() for ($i = 0; $i -lt $DiskId.Count; $i++) { - $diskObject= [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk]::New() + $diskObject = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk $diskObject.Id = $DiskId[$i] $disk += $diskObject } diff --git a/src/DiskPool/custom/Update-AzDiskPool.ps1 b/src/DiskPool/custom/Update-AzDiskPool.ps1 index 17be804bef44..06e9311b2775 100644 --- a/src/DiskPool/custom/Update-AzDiskPool.ps1 +++ b/src/DiskPool/custom/Update-AzDiskPool.ps1 @@ -159,7 +159,7 @@ param( if ($PSBoundParameters.ContainsKey("DiskId")){ $disk = @() for ($i = 0; $i -lt $DiskId.Count; $i++) { - $diskObject= [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk]::New() + $diskObject = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.Disk $diskObject.Id = $DiskId[$i] $disk += $diskObject } diff --git a/src/DiskPool/exports/ProxyCmdletDefinitions.ps1 b/src/DiskPool/exports/ProxyCmdletDefinitions.ps1 index 2de77089bbe3..dd13cc754de8 100644 --- a/src/DiskPool/exports/ProxyCmdletDefinitions.ps1 +++ b/src/DiskPool/exports/ProxyCmdletDefinitions.ps1 @@ -987,7 +987,7 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')] [System.String] # The name of the Disk Pool. - ${DiskPoolName}, + ${Name}, [Parameter(ParameterSetName='Deallocate', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')] @@ -1145,7 +1145,7 @@ westeurope disk-pool-1 Microsoft.StoragePool/diskPools .Outputs Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool .Link -https://docs.microsoft.com/powershell/module/diskpool/new-azdiskpool +https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpool #> function New-AzDiskPool { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])] @@ -1528,7 +1528,7 @@ STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN m InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client". MappedLun : List of LUN names mapped to the ACL. .Link -https://docs.microsoft.com/powershell/module/diskpool/new-azdiskpooliscsitarget +https://docs.microsoft.com/powershell/module/az.diskpool/new-azdiskpooliscsitarget #> function New-AzDiskPoolIscsiTarget { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])] @@ -1737,7 +1737,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SubscriptionId ]: The ID of the target subscription. .Link -https://docs.microsoft.com/powershell/module/diskpool/update-azdiskpool +https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpool #> function Update-AzDiskPool { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool])] @@ -1944,7 +1944,7 @@ STATICACL : Access Control List (ACL) for an iSCSI Target; defines LUN m InitiatorIqn : iSCSI initiator IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:client". MappedLun : List of LUN names mapped to the ACL. .Link -https://docs.microsoft.com/powershell/module/diskpool/update-azdiskpooliscsitarget +https://docs.microsoft.com/powershell/module/az.diskpool/update-azdiskpooliscsitarget #> function Update-AzDiskPoolIscsiTarget { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget])] diff --git a/src/DiskPool/exports/Stop-AzDiskPool.ps1 b/src/DiskPool/exports/Stop-AzDiskPool.ps1 index e03e96968f6a..525547558cf8 100644 --- a/src/DiskPool/exports/Stop-AzDiskPool.ps1 +++ b/src/DiskPool/exports/Stop-AzDiskPool.ps1 @@ -54,7 +54,7 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')] [System.String] # The name of the Disk Pool. - ${DiskPoolName}, + ${Name}, [Parameter(ParameterSetName='Deallocate', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category('Path')] diff --git a/src/DiskPool/generate-info.json b/src/DiskPool/generate-info.json index 4b95d9fb80aa..2fc962c59e6a 100644 --- a/src/DiskPool/generate-info.json +++ b/src/DiskPool/generate-info.json @@ -1,8 +1,8 @@ { - "autorest_modelerfour": "4.15.414", - "autorest_powershell": "3.0.430", - "autorest_core": "3.0.6375", "node": "v10.15.3", - "swagger_commit": "9875f8eebd8c1392a83c052bc50a79c8251b1174", - "autorest": "3.0.6187" + "autorest_powershell": "3.0.431", + "autorest": "3.0.6187", + "autorest_core": "3.0.6375", + "swagger_commit": "a252633188c5e02c4071cc1c3b5cead249db8a54", + "autorest_modelerfour": "4.15.414" } diff --git a/src/DiskPool/generated/api/Models/Any.PowerShell.cs b/src/DiskPool/generated/api/Models/Any.PowerShell.cs index 317d54a03d98..cc2c16400cb1 100644 --- a/src/DiskPool/generated/api/Models/Any.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Any.PowerShell.cs @@ -52,6 +52,14 @@ public partial class Any partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into a new instance of . @@ -123,6 +131,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IAny Deserializ /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Any object [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/Acl.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/Acl.PowerShell.cs index 8326e485efa4..59cf4a930820 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/Acl.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/Acl.PowerShell.cs @@ -47,6 +47,14 @@ public partial class Acl 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 . @@ -122,6 +130,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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(); + } } /// Access Control List (ACL) for an iSCSI Target; defines LUN masking policy [System.ComponentModel.TypeConverter(typeof(AclTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/Disk.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/Disk.PowerShell.cs index 5f1b7854f9d2..69dc706abc18 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/Disk.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/Disk.PowerShell.cs @@ -47,6 +47,14 @@ public partial class Disk 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 . @@ -74,39 +82,39 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal Disk(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal Disk(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Disk(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal Disk(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskInternal)this).Id, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -120,6 +128,18 @@ internal Disk(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Azure Managed Disk to attach to the Disk Pool. [System.ComponentModel.TypeConverter(typeof(DiskTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPool.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPool.PowerShell.cs index 09a44d6ccb67..34a2e6df76a8 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPool.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPool.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPool 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPool(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPool(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -109,18 +117,18 @@ internal DiskPool(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPool(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPool(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -148,7 +156,7 @@ internal DiskPool(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -162,6 +170,18 @@ internal DiskPool(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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 for Disk Pool request. [System.ComponentModel.TypeConverter(typeof(DiskPoolTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreate.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreate.PowerShell.cs index dc056788b339..724588da1af4 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreate.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreate.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolCreate 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolCreate(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolCreate(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -100,18 +108,18 @@ internal DiskPoolCreate(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).SubnetId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolCreate(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolCreate(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -130,7 +138,7 @@ internal DiskPoolCreate(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).SubnetId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreateInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -144,6 +152,18 @@ internal DiskPoolCreate(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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(); + } } /// Request payload for create or update Disk Pool request. [System.ComponentModel.TypeConverter(typeof(DiskPoolCreateTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateProperties.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateProperties.PowerShell.cs index b71d5551264d..3166c4d5195c 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateProperties.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateProperties.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolCreateProperties 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 . @@ -76,14 +84,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolCreateProperties(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolCreateProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -93,18 +101,18 @@ internal DiskPoolCreateProperties(global::System.Collections.IDictionary content ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).SubnetId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolCreateProperties(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolCreateProperties(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -114,7 +122,7 @@ internal DiskPoolCreateProperties(global::System.Management.Automation.PSObject ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).SubnetId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolCreatePropertiesInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -128,6 +136,18 @@ internal DiskPoolCreateProperties(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties for Disk Pool create or update request. [System.ComponentModel.TypeConverter(typeof(DiskPoolCreatePropertiesTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateTags.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateTags.PowerShell.cs index 28600adb441b..440348a45d83 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateTags.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolCreateTags.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolCreateTags 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolCreateTags(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolCreateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -89,18 +97,18 @@ internal DiskPoolCreateTags(global::System.Collections.IDictionary content) // actually deserialize // this type is a dictionary; copy elements from source to here. CopyFrom(content); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolCreateTags(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolCreateTags(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -108,7 +116,7 @@ internal DiskPoolCreateTags(global::System.Management.Automation.PSObject conten // actually deserialize // this type is a dictionary; copy elements from source to here. CopyFrom(content); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -122,6 +130,18 @@ internal DiskPoolCreateTags(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Resource tags. [System.ComponentModel.TypeConverter(typeof(DiskPoolCreateTagsTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolListResult.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolListResult.PowerShell.cs index 9ae46f875fd7..3e157e8d2be6 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolListResult.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolListResult.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolListResult 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolListResult(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolListResult(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -89,18 +97,18 @@ internal DiskPoolListResult(global::System.Collections.IDictionary content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolListResult(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolListResult(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -108,7 +116,7 @@ internal DiskPoolListResult(global::System.Management.Automation.PSObject conten // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPool[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolListResultInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -122,6 +130,18 @@ internal DiskPoolListResult(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List of Disk Pools [System.ComponentModel.TypeConverter(typeof(DiskPoolListResultTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolProperties.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolProperties.PowerShell.cs index b3a2eab0dac8..f8ca17ef64aa 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolProperties.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolProperties.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolProperties 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolProperties(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -93,18 +101,18 @@ internal DiskPoolProperties(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).SubnetId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolProperties(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolProperties(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -116,7 +124,7 @@ internal DiskPoolProperties(global::System.Management.Automation.PSObject conten ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).SubnetId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolPropertiesInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -130,6 +138,18 @@ internal DiskPoolProperties(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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(); + } } /// Disk Pool response properties. [System.ComponentModel.TypeConverter(typeof(DiskPoolPropertiesTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdate.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdate.PowerShell.cs index bf486f3f1fb7..fff1ad4dfd74 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdate.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdate.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolUpdate 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolUpdate(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolUpdate(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -90,18 +98,18 @@ internal DiskPoolUpdate(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolUpdatePropertiesTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolUpdateTagsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolUpdate(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolUpdate(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -110,7 +118,7 @@ internal DiskPoolUpdate(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolUpdatePropertiesTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolUpdateTagsTypeConverter.ConvertFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdateInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -124,6 +132,18 @@ internal DiskPoolUpdate(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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(); + } } /// Request payload for Update Disk Pool request. [System.ComponentModel.TypeConverter(typeof(DiskPoolUpdateTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateProperties.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateProperties.PowerShell.cs index 1998d66d41b9..438d45e952b5 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateProperties.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateProperties.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolUpdateProperties 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 . @@ -76,39 +84,39 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolUpdateProperties(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolUpdateProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdatePropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdatePropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolUpdateProperties(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolUpdateProperties(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdatePropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolUpdatePropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -122,6 +130,18 @@ internal DiskPoolUpdateProperties(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties for Disk Pool update request. [System.ComponentModel.TypeConverter(typeof(DiskPoolUpdatePropertiesTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateTags.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateTags.PowerShell.cs index d9902415ffcc..bf69acb7d139 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateTags.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolUpdateTags.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolUpdateTags 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolUpdateTags(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -89,18 +97,18 @@ internal DiskPoolUpdateTags(global::System.Collections.IDictionary content) // actually deserialize // this type is a dictionary; copy elements from source to here. CopyFrom(content); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolUpdateTags(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -108,7 +116,7 @@ internal DiskPoolUpdateTags(global::System.Management.Automation.PSObject conten // actually deserialize // this type is a dictionary; copy elements from source to here. CopyFrom(content); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -122,6 +130,18 @@ internal DiskPoolUpdateTags(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Resource tags. [System.ComponentModel.TypeConverter(typeof(DiskPoolUpdateTagsTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneInfo.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneInfo.PowerShell.cs index 179e3ac960ec..d681a88938d3 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneInfo.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneInfo.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolZoneInfo 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolZoneInfo(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolZoneInfo(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -92,18 +100,18 @@ internal DiskPoolZoneInfo(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuTier, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolZoneInfo(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolZoneInfo(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -114,7 +122,7 @@ internal DiskPoolZoneInfo(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).AdditionalCapability = (string[]) content.GetValueForProperty("AdditionalCapability",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).AdditionalCapability, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfoInternal)this).SkuTier, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -128,6 +136,18 @@ internal DiskPoolZoneInfo(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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(); + } } /// Disk Pool Sku Details [System.ComponentModel.TypeConverter(typeof(DiskPoolZoneInfoTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneListResult.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneListResult.PowerShell.cs index 675a944efd78..f6fcb72f65cf 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneListResult.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/DiskPoolZoneListResult.PowerShell.cs @@ -47,6 +47,14 @@ public partial class DiskPoolZoneListResult 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 . @@ -76,14 +84,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolZoneListResult(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolZoneListResult(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -91,18 +99,18 @@ internal DiskPoolZoneListResult(global::System.Collections.IDictionary content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfo[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneInfoTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolZoneListResult(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolZoneListResult(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -110,7 +118,7 @@ internal DiskPoolZoneListResult(global::System.Management.Automation.PSObject co // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneInfo[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.DiskPoolZoneInfoTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IDiskPoolZoneListResultInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -124,6 +132,18 @@ internal DiskPoolZoneListResult(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List Disk Pool skus operation response. [System.ComponentModel.TypeConverter(typeof(DiskPoolZoneListResultTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDependency.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDependency.PowerShell.cs index fae5562f2607..62ca97ad415c 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDependency.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDependency.PowerShell.cs @@ -49,6 +49,14 @@ public partial class EndpointDependency 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 . @@ -76,14 +84,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal EndpointDependency(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal EndpointDependency(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -91,18 +99,18 @@ internal EndpointDependency(global::System.Collections.IDictionary content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).EndpointDetail = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetail[]) content.GetValueForProperty("EndpointDetail",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).EndpointDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDetailTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal EndpointDependency(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal EndpointDependency(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -110,7 +118,7 @@ internal EndpointDependency(global::System.Management.Automation.PSObject conten // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).EndpointDetail = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetail[]) content.GetValueForProperty("EndpointDetail",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependencyInternal)this).EndpointDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDetailTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -124,6 +132,18 @@ internal EndpointDependency(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A domain name that a service is reached at, including details of the current connection status. [System.ComponentModel.TypeConverter(typeof(EndpointDependencyTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDetail.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDetail.PowerShell.cs index 3052b7b6f143..06e7a8eb0449 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDetail.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/EndpointDetail.PowerShell.cs @@ -49,6 +49,14 @@ public partial class EndpointDetail 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 . @@ -76,14 +84,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal EndpointDetail(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal EndpointDetail(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -93,18 +101,18 @@ internal EndpointDetail(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Latency = (double?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Latency, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).IsAccessible = (bool?) content.GetValueForProperty("IsAccessible",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).IsAccessible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal EndpointDetail(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal EndpointDetail(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -114,7 +122,7 @@ internal EndpointDetail(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Latency = (double?) content.GetValueForProperty("Latency",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).Latency, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).IsAccessible = (bool?) content.GetValueForProperty("IsAccessible",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDetailInternal)this).IsAccessible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -128,6 +136,18 @@ internal EndpointDetail(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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(); + } } /// Current TCP connectivity information from the App Service Environment to a single endpoint. [System.ComponentModel.TypeConverter(typeof(EndpointDetailTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/Error.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/Error.PowerShell.cs index 5c6326609c24..e59fafb7330e 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/Error.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/Error.PowerShell.cs @@ -47,6 +47,14 @@ public partial class Error 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal Error(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal Error(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -93,18 +101,18 @@ internal Error(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Target, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorResponseTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Error(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal Error(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -116,7 +124,7 @@ internal Error(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Target, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorResponseTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -130,6 +138,18 @@ internal Error(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource management error response. [System.ComponentModel.TypeConverter(typeof(ErrorTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorAdditionalInfo.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorAdditionalInfo.PowerShell.cs index b9a26bec644b..4cf763f5b3d7 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorAdditionalInfo.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorAdditionalInfo.PowerShell.cs @@ -47,6 +47,14 @@ public partial class ErrorAdditionalInfo 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 . @@ -76,14 +84,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -91,18 +99,18 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.AnyTypeConverter.ConvertFrom); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -110,7 +118,7 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.AnyTypeConverter.ConvertFrom); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -124,6 +132,18 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource management error additional info. [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorResponse.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorResponse.PowerShell.cs index 4bf1bb2c12be..14417e35192a 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorResponse.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/ErrorResponse.PowerShell.cs @@ -47,6 +47,14 @@ public partial class ErrorResponse 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 . @@ -74,14 +82,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponse(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponse(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -92,18 +100,18 @@ internal ErrorResponse(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Target, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorResponseTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponse(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponse(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -114,7 +122,7 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Target, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorResponseTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -128,6 +136,18 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource management error response. [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiLun.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiLun.PowerShell.cs index 2d06c88bdf95..6f8d41526c35 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiLun.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiLun.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiLun 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiLun(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiLun(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -97,18 +105,18 @@ internal IscsiLun(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).ManagedDiskAzureResourceId = (string) content.GetValueForProperty("ManagedDiskAzureResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).ManagedDiskAzureResourceId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiLun(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiLun(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -117,13 +125,25 @@ internal IscsiLun(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).ManagedDiskAzureResourceId = (string) content.GetValueForProperty("ManagedDiskAzureResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).ManagedDiskAzureResourceId, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLunInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// LUN to expose the Azure Managed Disk. [System.ComponentModel.TypeConverter(typeof(IscsiLunTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTarget.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTarget.PowerShell.cs index f3a8410b76c6..bcb62a1ee855 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTarget.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTarget.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTarget 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTarget(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTarget(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -113,18 +121,18 @@ internal IscsiTarget(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTarget(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTarget(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -149,13 +157,25 @@ internal IscsiTarget(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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 for iSCSI Target requests. [System.ComponentModel.TypeConverter(typeof(IscsiTargetTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreate.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreate.PowerShell.cs index b5ed9b90f0bc..7f97b7d22605 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreate.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreate.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTargetCreate 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTargetCreate(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTargetCreate(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -102,18 +110,18 @@ internal IscsiTargetCreate(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).TargetIqn = (string) content.GetValueForProperty("TargetIqn",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).TargetIqn, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTargetCreate(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTargetCreate(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -127,13 +135,25 @@ internal IscsiTargetCreate(global::System.Management.Automation.PSObject content ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).TargetIqn = (string) content.GetValueForProperty("TargetIqn",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).TargetIqn, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Payload for iSCSI Target create or update requests. [System.ComponentModel.TypeConverter(typeof(IscsiTargetCreateTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreateProperties.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreateProperties.PowerShell.cs index 97115f9fd2f9..4b0374c94179 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreateProperties.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetCreateProperties.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTargetCreateProperties 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTargetCreateProperties(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTargetCreateProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -100,18 +108,18 @@ internal IscsiTargetCreateProperties(global::System.Collections.IDictionary cont ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).TargetIqn = (string) content.GetValueForProperty("TargetIqn",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).TargetIqn, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTargetCreateProperties(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTargetCreateProperties(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -121,13 +129,25 @@ internal IscsiTargetCreateProperties(global::System.Management.Automation.PSObje ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).TargetIqn = (string) content.GetValueForProperty("TargetIqn",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).TargetIqn, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetCreatePropertiesInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties for iSCSI Target create or update request. [System.ComponentModel.TypeConverter(typeof(IscsiTargetCreatePropertiesTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetList.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetList.PowerShell.cs index 93843d6b8746..b8727d67a0b1 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetList.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetList.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTargetList 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTargetList(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTargetList(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -96,18 +104,18 @@ internal IscsiTargetList(global::System.Collections.IDictionary content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTargetList(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTargetList(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -115,13 +123,25 @@ internal IscsiTargetList(global::System.Management.Automation.PSObject content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTarget[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiTargetTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetListInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List of iSCSI Targets. [System.ComponentModel.TypeConverter(typeof(IscsiTargetListTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetProperties.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetProperties.PowerShell.cs index d9060126d5f3..a7312f7b4ca8 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetProperties.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetProperties.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTargetProperties 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTargetProperties(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTargetProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -104,18 +112,18 @@ internal IscsiTargetProperties(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.OperationalStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.OperationalStatus.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Endpoint = (string[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTargetProperties(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTargetProperties(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -129,13 +137,25 @@ internal IscsiTargetProperties(global::System.Management.Automation.PSObject con ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.OperationalStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.OperationalStatus.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Endpoint = (string[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetPropertiesInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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 properties for iSCSI Target operations. [System.ComponentModel.TypeConverter(typeof(IscsiTargetPropertiesTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdate.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdate.PowerShell.cs index 4b5277a26824..c055bbe8484e 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdate.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdate.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTargetUpdate 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTargetUpdate(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTargetUpdate(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -100,18 +108,18 @@ internal IscsiTargetUpdate(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTargetUpdate(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTargetUpdate(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -123,13 +131,25 @@ internal IscsiTargetUpdate(global::System.Management.Automation.PSObject content ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Payload for iSCSI Target update requests. [System.ComponentModel.TypeConverter(typeof(IscsiTargetUpdateTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdateProperties.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdateProperties.PowerShell.cs index 62bf6171bcf8..eb0728e08647 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdateProperties.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/IscsiTargetUpdateProperties.PowerShell.cs @@ -47,6 +47,14 @@ public partial class IscsiTargetUpdateProperties 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal IscsiTargetUpdateProperties(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiTargetUpdateProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -98,18 +106,18 @@ internal IscsiTargetUpdateProperties(global::System.Collections.IDictionary cont // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IscsiTargetUpdateProperties(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiTargetUpdateProperties(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -117,13 +125,25 @@ internal IscsiTargetUpdateProperties(global::System.Management.Automation.PSObje // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).StaticAcls = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IAcl[]) content.GetValueForProperty("StaticAcls",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).StaticAcls, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.AclTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).Lun = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiLun[]) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IIscsiTargetUpdatePropertiesInternal)this).Lun, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IscsiLunTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties for iSCSI Target update request. [System.ComponentModel.TypeConverter(typeof(IscsiTargetUpdatePropertiesTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpoint.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpoint.PowerShell.cs index 94fe3b0abb99..f6fb84c0c678 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpoint.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpoint.PowerShell.cs @@ -49,6 +49,14 @@ public partial class OutboundEnvironmentEndpoint 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 . @@ -85,14 +93,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal OutboundEnvironmentEndpoint(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal OutboundEnvironmentEndpoint(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -100,18 +108,18 @@ internal OutboundEnvironmentEndpoint(global::System.Collections.IDictionary cont // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Category, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependency[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDependencyTypeConverter.ConvertFrom)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OutboundEnvironmentEndpoint(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal OutboundEnvironmentEndpoint(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -119,13 +127,25 @@ internal OutboundEnvironmentEndpoint(global::System.Management.Automation.PSObje // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Category, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IEndpointDependency[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.EndpointDependencyTypeConverter.ConvertFrom)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. [System.ComponentModel.TypeConverter(typeof(OutboundEnvironmentEndpointTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpointList.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpointList.PowerShell.cs index adf78ef19769..1fda441b1d45 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpointList.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/OutboundEnvironmentEndpointList.PowerShell.cs @@ -47,6 +47,14 @@ public partial class OutboundEnvironmentEndpointList 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal OutboundEnvironmentEndpointList(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal OutboundEnvironmentEndpointList(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -98,18 +106,18 @@ internal OutboundEnvironmentEndpointList(global::System.Collections.IDictionary // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpoint[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.OutboundEnvironmentEndpointTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OutboundEnvironmentEndpointList(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal OutboundEnvironmentEndpointList(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -117,13 +125,25 @@ internal OutboundEnvironmentEndpointList(global::System.Management.Automation.PS // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpoint[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.OutboundEnvironmentEndpointTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IOutboundEnvironmentEndpointListInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Collection of Outbound Environment Endpoints [System.ComponentModel.TypeConverter(typeof(OutboundEnvironmentEndpointListTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/ProxyResource.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/ProxyResource.PowerShell.cs index a9c8cf025ba2..1bdc64e039a9 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/ProxyResource.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/ProxyResource.PowerShell.cs @@ -49,6 +49,14 @@ public partial class ProxyResource 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal ProxyResource(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProxyResource(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -99,18 +107,18 @@ internal ProxyResource(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ProxyResource(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal ProxyResource(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -119,13 +127,25 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource model definition for a ARM proxy resource. It will have everything other than required location and tags [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/Resource.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/Resource.PowerShell.cs index 1f73f6c5b709..2f3fd9c807e8 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/Resource.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/Resource.PowerShell.cs @@ -47,6 +47,14 @@ public partial class Resource 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal Resource(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -97,18 +105,18 @@ internal Resource(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Resource(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -117,13 +125,25 @@ internal Resource(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// ARM resource model definition. [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/Sku.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/Sku.PowerShell.cs index 73976969e416..26abc2ee0dc3 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/Sku.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/Sku.PowerShell.cs @@ -47,6 +47,14 @@ public partial class Sku 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal Sku(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal Sku(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -96,18 +104,18 @@ internal Sku(global::System.Collections.IDictionary content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Tier, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Sku(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal Sku(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -115,13 +123,25 @@ internal Sku(global::System.Management.Automation.PSObject content) // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISkuInternal)this).Tier, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Sku for ARM resource [System.ComponentModel.TypeConverter(typeof(SkuTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationDisplay.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationDisplay.PowerShell.cs index d249ed3d2079..dac38b1da701 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationDisplay.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationDisplay.PowerShell.cs @@ -47,6 +47,14 @@ public partial class StoragePoolOperationDisplay 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal StoragePoolOperationDisplay(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal StoragePoolOperationDisplay(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -100,18 +108,18 @@ internal StoragePoolOperationDisplay(global::System.Collections.IDictionary cont ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Resource, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Operation, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Description, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal StoragePoolOperationDisplay(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal StoragePoolOperationDisplay(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -121,13 +129,25 @@ internal StoragePoolOperationDisplay(global::System.Management.Automation.PSObje ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Resource, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Operation, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationDisplayInternal)this).Description, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Metadata about an operation. [System.ComponentModel.TypeConverter(typeof(StoragePoolOperationDisplayTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationListResult.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationListResult.PowerShell.cs index 78f5c0f25231..ce711830d6f9 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationListResult.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolOperationListResult.PowerShell.cs @@ -47,6 +47,14 @@ public partial class StoragePoolOperationListResult 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal StoragePoolOperationListResult(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal StoragePoolOperationListResult(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -98,18 +106,18 @@ internal StoragePoolOperationListResult(global::System.Collections.IDictionary c // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolRpOperationTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal StoragePoolOperationListResult(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal StoragePoolOperationListResult(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -117,13 +125,25 @@ internal StoragePoolOperationListResult(global::System.Management.Automation.PSO // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.StoragePoolRpOperationTypeConverter.ConvertFrom)); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolOperationListResultInternal)this).NextLink, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List of operations supported by the RP. [System.ComponentModel.TypeConverter(typeof(StoragePoolOperationListResultTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolRpOperation.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolRpOperation.PowerShell.cs index 6f01e47f52aa..d311356d45d4 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolRpOperation.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/StoragePoolRpOperation.PowerShell.cs @@ -47,6 +47,14 @@ public partial class StoragePoolRpOperation 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 . @@ -83,14 +91,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal StoragePoolRpOperation(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal StoragePoolRpOperation(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -105,18 +113,18 @@ internal StoragePoolRpOperation(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayResource, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayOperation, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayDescription, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal StoragePoolRpOperation(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal StoragePoolRpOperation(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -131,13 +139,25 @@ internal StoragePoolRpOperation(global::System.Management.Automation.PSObject co ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayResource, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayOperation, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IStoragePoolRpOperationInternal)this).DisplayDescription, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Description of a StoragePool RP Operation [System.ComponentModel.TypeConverter(typeof(StoragePoolRpOperationTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/SystemMetadata.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/SystemMetadata.PowerShell.cs index 6c0af046f085..2bb443022a26 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/SystemMetadata.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/SystemMetadata.PowerShell.cs @@ -47,6 +47,14 @@ public partial class SystemMetadata 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 . @@ -81,14 +89,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal SystemMetadata(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemMetadata(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -100,18 +108,18 @@ internal SystemMetadata(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedBy, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SystemMetadata(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal SystemMetadata(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -123,13 +131,25 @@ internal SystemMetadata(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedBy, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Support.CreatedByType.CreateFrom); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.ISystemMetadataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(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.DiskPool.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(); + } } /// Metadata pertaining to creation and last modification of the resource. [System.ComponentModel.TypeConverter(typeof(SystemMetadataTypeConverter))] diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResource.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResource.PowerShell.cs index 9c2b3db606e6..7373a09de93d 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResource.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResource.PowerShell.cs @@ -47,6 +47,14 @@ public partial class TrackedResource 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 . @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal TrackedResource(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResource(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -104,18 +124,18 @@ internal TrackedResource(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrackedResource(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResource(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -126,7 +146,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Id, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } } /// The resource model definition for a ARM tracked top level resource. diff --git a/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResourceTags.PowerShell.cs b/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResourceTags.PowerShell.cs index f3568711bad3..435d2fb5b8a5 100644 --- a/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResourceTags.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/Api20210401Preview/TrackedResourceTags.PowerShell.cs @@ -47,6 +47,14 @@ public partial class TrackedResourceTags 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 . @@ -87,15 +95,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210401Prev /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal TrackedResourceTags(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -103,18 +123,18 @@ internal TrackedResourceTags(global::System.Collections.IDictionary content) // actually deserialize // this type is a dictionary; copy elements from source to here. CopyFrom(content); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -122,7 +142,7 @@ internal TrackedResourceTags(global::System.Management.Automation.PSObject conte // actually deserialize // this type is a dictionary; copy elements from source to here. CopyFrom(content); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } } /// Resource tags. diff --git a/src/DiskPool/generated/api/Models/DiskPoolIdentity.PowerShell.cs b/src/DiskPool/generated/api/Models/DiskPoolIdentity.PowerShell.cs index 16abc73a9c9f..cfc680cb91a1 100644 --- a/src/DiskPool/generated/api/Models/DiskPoolIdentity.PowerShell.cs +++ b/src/DiskPool/generated/api/Models/DiskPoolIdentity.PowerShell.cs @@ -51,6 +51,14 @@ public partial class DiskPoolIdentity 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 . @@ -78,14 +86,14 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdenti } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiskPoolIdentity(global::System.Collections.IDictionary content) + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiskPoolIdentity(global::System.Management.Automation.PSObject content) { bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); + BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; @@ -97,18 +105,18 @@ internal DiskPoolIdentity(global::System.Collections.IDictionary content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Location, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).IscsiTargetName = (string) content.GetValueForProperty("IscsiTargetName",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).IscsiTargetName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Id, global::System.Convert.ToString); - AfterDeserializeDictionary(content); + AfterDeserializePSObject(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskPoolIdentity(global::System.Management.Automation.PSObject content) + /// The global::System.Collections.IDictionary content that should be used. + internal DiskPoolIdentity(global::System.Collections.IDictionary content) { bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); + BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; @@ -120,7 +128,7 @@ internal DiskPoolIdentity(global::System.Management.Automation.PSObject content) ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Location, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).IscsiTargetName = (string) content.GetValueForProperty("IscsiTargetName",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).IscsiTargetName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentityInternal)this).Id, global::System.Convert.ToString); - AfterDeserializePSObject(content); + AfterDeserializeDictionary(content); } /// @@ -134,6 +142,18 @@ internal DiskPoolIdentity(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(DiskPoolIdentityTypeConverter))] public partial interface IDiskPoolIdentity diff --git a/src/DiskPool/generated/cmdlets/StopAzDiskPool_Deallocate.cs b/src/DiskPool/generated/cmdlets/StopAzDiskPool_Deallocate.cs index b9fb977347b2..6d2bcec5b0d3 100644 --- a/src/DiskPool/generated/cmdlets/StopAzDiskPool_Deallocate.cs +++ b/src/DiskPool/generated/cmdlets/StopAzDiskPool_Deallocate.cs @@ -57,20 +57,6 @@ public partial class StopAzDiskPool_Deallocate : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DiskPool.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - /// Backing field for property. - private string _diskPoolName; - - /// The name of the Disk Pool. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Disk Pool.")] - [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Disk Pool.", - SerializedName = @"diskPoolName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DiskPool.ParameterCategory.Path)] - public string DiskPoolName { get => this._diskPoolName; set => this._diskPoolName = value; } - /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,6 +80,20 @@ public partial class StopAzDiskPool_Deallocate : global::System.Management.Autom /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _name; + + /// The name of the Disk Pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Disk Pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Disk Pool.", + SerializedName = @"diskPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DiskPool.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + /// /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue /// asynchronously. @@ -216,7 +216,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Cmdlets.StopAzDiskPool_Deallo clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; - clone.DiskPoolName = this.DiskPoolName; + clone.Name = this.Name; return clone; } @@ -371,12 +371,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DiskPoolsDeallocate(SubscriptionId, ResourceGroupName, DiskPoolName, onOk, onDefault, this, Pipeline); + await this.Client.DiskPoolsDeallocate(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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,DiskPoolName=DiskPoolName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -430,14 +430,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DiskPoolName=DiskPoolName }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DiskPoolName=DiskPoolName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/src/DiskPool/help/Stop-AzDiskPool.md b/src/DiskPool/help/Stop-AzDiskPool.md index 3c3be6aee8ca..87ecc0ce13dc 100644 --- a/src/DiskPool/help/Stop-AzDiskPool.md +++ b/src/DiskPool/help/Stop-AzDiskPool.md @@ -15,7 +15,7 @@ You are not billed for the compute resources that this Disk Pool uses. ### Deallocate (Default) ``` -Stop-AzDiskPool -DiskPoolName -ResourceGroupName [-SubscriptionId ] +Stop-AzDiskPool -Name -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] ``` @@ -79,34 +79,34 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DiskPoolName -The name of the Disk Pool. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: System.String -Parameter Sets: Deallocate +Type: Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity +Parameter Sets: DeallocateViaIdentity Aliases: Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. +### -Name +The name of the Disk Pool. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.IDiskPoolIdentity -Parameter Sets: DeallocateViaIdentity +Type: System.String +Parameter Sets: Deallocate Aliases: Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/src/DiskPool/readme.md b/src/DiskPool/readme.md index c648723d2326..c1a438033392 100644 --- a/src/DiskPool/readme.md +++ b/src/DiskPool/readme.md @@ -41,6 +41,7 @@ module-version: 0.1.0 title: DiskPool subject-prefix: $(service-name) identity-correction-for-post: true +nested-object-to-string: true directive: # Following is two common directive which are normally required in all the RPs @@ -60,6 +61,12 @@ directive: verb: Stop subject-prefix: '' subject: DiskPool + - where: + verb: Stop + subject: DiskPool + parameter-name: DiskPoolName + set: + parameter-name: Name - where: verb: New subject: DiskPool diff --git a/src/DiskPool/test/Stop-AzDiskPool.Tests.ps1 b/src/DiskPool/test/Stop-AzDiskPool.Tests.ps1 index f15f34c23656..866f0c8ef3e9 100644 --- a/src/DiskPool/test/Stop-AzDiskPool.Tests.ps1 +++ b/src/DiskPool/test/Stop-AzDiskPool.Tests.ps1 @@ -13,7 +13,7 @@ while(-not $mockingPath) { Describe 'Stop-AzDiskPool' { It 'Deallocate' { - Stop-AzDiskPool -DiskPoolName $env.diskPool1 -ResourceGroupName $env.resourceGroup + Stop-AzDiskPool -Name $env.diskPool1 -ResourceGroupName $env.resourceGroup $diskPool = Get-AzDiskPool -ResourceGroupName $env.resourceGroup -Name $env.diskPool1 $diskPool.status | Should -Be 'Stopped (deallocated)' } From 9f9424875a735ceaa0e0b3d2163cef02b5e0539d Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Mon, 7 Jun 2021 14:49:54 +0800 Subject: [PATCH 2/2] Bump version for Az.DiskPool OOB --- src/DiskPool/Az.DiskPool.psd1 | 4 ++-- src/DiskPool/Changelog.md | 3 +++ src/DiskPool/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/DiskPool/Az.DiskPool.psd1 b/src/DiskPool/Az.DiskPool.psd1 index 90b4dae270a5..efd5e13d441f 100644 --- a/src/DiskPool/Az.DiskPool.psd1 +++ b/src/DiskPool/Az.DiskPool.psd1 @@ -12,7 +12,7 @@ RootModule = './Az.DiskPool.psm1' # Version number of this module. -ModuleVersion = '0.1.0' +ModuleVersion = '0.1.1' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' @@ -111,7 +111,7 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - # ReleaseNotes = '' + ReleaseNotes = '* Hotfix for the issue on windows powershell' # Prerelease string of this module # Prerelease = '' diff --git a/src/DiskPool/Changelog.md b/src/DiskPool/Changelog.md index d5c75a321b59..1a678e65020a 100644 --- a/src/DiskPool/Changelog.md +++ b/src/DiskPool/Changelog.md @@ -19,6 +19,9 @@ --> ## Upcoming Release +## Version 0.1.1 +* Hotfix for the issue on windows powershell + ## Version 0.1.0 * First preview release for module Az.DiskPool diff --git a/src/DiskPool/Properties/AssemblyInfo.cs b/src/DiskPool/Properties/AssemblyInfo.cs index 91b99fb2a676..9c46698b64ca 100644 --- a/src/DiskPool/Properties/AssemblyInfo.cs +++ b/src/DiskPool/Properties/AssemblyInfo.cs @@ -24,5 +24,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("cab30302-f17b-4dd6-8c5f-2902b85e7cec")] -[assembly: AssemblyVersion("0.1.0")] -[assembly: AssemblyFileVersion("0.1.0")] +[assembly: AssemblyVersion("0.1.1")] +[assembly: AssemblyFileVersion("0.1.1")]