/src/VMWare/generated/api/Models/Api20200320/CloudError.PowerShell.cs
https://github.com/Azure/azure-powershell · C# · 141 lines · 58 code · 18 blank · 65 comment · 2 complexity · 773cb320d627d5ee6ce02c8f3245d8a4 MD5 · raw file
- namespace Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320
- {
- using Microsoft.Azure.PowerShell.Cmdlets.VMWare.Runtime.PowerShell;
-
- /// <summary>API error response</summary>
- [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))]
- public partial class CloudError
- {
-
- /// <summary>
- /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the
- /// object before it is returned. Implement this method in a partial class to enable this behavior
- /// </summary>
- /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
-
- partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
-
- /// <summary>
- /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object
- /// before it is returned. Implement this method in a partial class to enable this behavior
- /// </summary>
- /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
-
- partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
-
- /// <summary>
- /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization
- /// of the object before it is deserialized.
- /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
- /// Implement this method in a partial class to enable this behavior.
- /// </summary>
- /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
- /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
- /// instantly.</param>
-
- partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
-
- /// <summary>
- /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization
- /// of the object before it is deserialized.
- /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
- /// Implement this method in a partial class to enable this behavior.
- /// </summary>
- /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
- /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
- /// instantly.</param>
-
- partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
-
- /// <summary>
- /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
- /// />.
- /// </summary>
- /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
- internal CloudError(global::System.Collections.IDictionary content)
- {
- bool returnNow = false;
- BeforeDeserializeDictionary(content, ref returnNow);
- if (returnNow)
- {
- return;
- }
- // actually deserialize
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.ErrorResponseTypeConverter.ConvertFrom);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray<Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorAdditionalInfo>(__y, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom));
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Code, global::System.Convert.ToString);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Message, global::System.Convert.ToString);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Target, global::System.Convert.ToString);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray<Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorResponse>(__y, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.ErrorResponseTypeConverter.ConvertFrom));
- AfterDeserializeDictionary(content);
- }
-
- /// <summary>
- /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
- /// />.
- /// </summary>
- /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
- internal CloudError(global::System.Management.Automation.PSObject content)
- {
- bool returnNow = false;
- BeforeDeserializePSObject(content, ref returnNow);
- if (returnNow)
- {
- return;
- }
- // actually deserialize
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.ErrorResponseTypeConverter.ConvertFrom);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray<Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorAdditionalInfo>(__y, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom));
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Code, global::System.Convert.ToString);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Message, global::System.Convert.ToString);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Target, global::System.Convert.ToString);
- ((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray<Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.IErrorResponse>(__y, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api10.ErrorResponseTypeConverter.ConvertFrom));
- AfterDeserializePSObject(content);
- }
-
- /// <summary>
- /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
- /// />.
- /// </summary>
- /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
- /// <returns>
- /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError" />.
- /// </returns>
- public static Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content)
- {
- return new CloudError(content);
- }
-
- /// <summary>
- /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
- /// />.
- /// </summary>
- /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
- /// <returns>
- /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError" />.
- /// </returns>
- public static Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
- {
- return new CloudError(content);
- }
-
- /// <summary>
- /// Creates a new instance of <see cref="CloudError" />, deserializing the content from a json string.
- /// </summary>
- /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param>
- /// <returns>an instance of the <see cref="className" /> model class.</returns>
- public static Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMWare.Runtime.Json.JsonNode.Parse(jsonText));
-
- /// <summary>Serializes this instance to a json string.</summary>
-
- /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
- public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Runtime.SerializationMode.IncludeAll)?.ToString();
- }
- /// API error response
- [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))]
- public partial interface ICloudError
-
- {
-
- }
- }