/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

  1. namespace Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320
  2. {
  3. using Microsoft.Azure.PowerShell.Cmdlets.VMWare.Runtime.PowerShell;
  4. /// <summary>API error response</summary>
  5. [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))]
  6. public partial class CloudError
  7. {
  8. /// <summary>
  9. /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the
  10. /// object before it is returned. Implement this method in a partial class to enable this behavior
  11. /// </summary>
  12. /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
  13. partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
  14. /// <summary>
  15. /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object
  16. /// before it is returned. Implement this method in a partial class to enable this behavior
  17. /// </summary>
  18. /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
  19. partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
  20. /// <summary>
  21. /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization
  22. /// of the object before it is deserialized.
  23. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
  24. /// Implement this method in a partial class to enable this behavior.
  25. /// </summary>
  26. /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
  27. /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
  28. /// instantly.</param>
  29. partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
  30. /// <summary>
  31. /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization
  32. /// of the object before it is deserialized.
  33. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
  34. /// Implement this method in a partial class to enable this behavior.
  35. /// </summary>
  36. /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
  37. /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
  38. /// instantly.</param>
  39. partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
  40. /// <summary>
  41. /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
  42. /// />.
  43. /// </summary>
  44. /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
  45. internal CloudError(global::System.Collections.IDictionary content)
  46. {
  47. bool returnNow = false;
  48. BeforeDeserializeDictionary(content, ref returnNow);
  49. if (returnNow)
  50. {
  51. return;
  52. }
  53. // actually deserialize
  54. ((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);
  55. ((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));
  56. ((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);
  57. ((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);
  58. ((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);
  59. ((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));
  60. AfterDeserializeDictionary(content);
  61. }
  62. /// <summary>
  63. /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
  64. /// />.
  65. /// </summary>
  66. /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
  67. internal CloudError(global::System.Management.Automation.PSObject content)
  68. {
  69. bool returnNow = false;
  70. BeforeDeserializePSObject(content, ref returnNow);
  71. if (returnNow)
  72. {
  73. return;
  74. }
  75. // actually deserialize
  76. ((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);
  77. ((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));
  78. ((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);
  79. ((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);
  80. ((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);
  81. ((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));
  82. AfterDeserializePSObject(content);
  83. }
  84. /// <summary>
  85. /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
  86. /// />.
  87. /// </summary>
  88. /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
  89. /// <returns>
  90. /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError" />.
  91. /// </returns>
  92. public static Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content)
  93. {
  94. return new CloudError(content);
  95. }
  96. /// <summary>
  97. /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.CloudError"
  98. /// />.
  99. /// </summary>
  100. /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
  101. /// <returns>
  102. /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError" />.
  103. /// </returns>
  104. public static Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
  105. {
  106. return new CloudError(content);
  107. }
  108. /// <summary>
  109. /// Creates a new instance of <see cref="CloudError" />, deserializing the content from a json string.
  110. /// </summary>
  111. /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param>
  112. /// <returns>an instance of the <see cref="className" /> model class.</returns>
  113. public static Microsoft.Azure.PowerShell.Cmdlets.VMWare.Models.Api20200320.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMWare.Runtime.Json.JsonNode.Parse(jsonText));
  114. /// <summary>Serializes this instance to a json string.</summary>
  115. /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
  116. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.VMWare.Runtime.SerializationMode.IncludeAll)?.ToString();
  117. }
  118. /// API error response
  119. [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))]
  120. public partial interface ICloudError
  121. {
  122. }
  123. }