| | | 1 | | // <auto-generated> |
| | | 2 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 3 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 4 | | // regenerated. |
| | | 5 | | // </auto-generated> |
| | | 6 | | |
| | | 7 | | namespace Microsoft.Azure.OperationalInsights.Models |
| | | 8 | | { |
| | | 9 | | using Microsoft.Rest; |
| | | 10 | | using Newtonsoft.Json; |
| | | 11 | | using System.Collections; |
| | | 12 | | using System.Collections.Generic; |
| | | 13 | | using System.Linq; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// The code and message for an error. |
| | | 17 | | /// </summary> |
| | | 18 | | public partial class ErrorInfo |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the ErrorInfo class. |
| | | 22 | | /// </summary> |
| | 5 | 23 | | public ErrorInfo() |
| | | 24 | | { |
| | | 25 | | CustomInit(); |
| | 5 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Initializes a new instance of the ErrorInfo class. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <param name="code">A machine readable error code.</param> |
| | | 32 | | /// <param name="message">A human readable error message.</param> |
| | | 33 | | /// <param name="details">error details.</param> |
| | | 34 | | /// <param name="innererror">Inner error details if they exist.</param> |
| | 0 | 35 | | public ErrorInfo(string code, string message, IList<ErrorDetail> details = default(IList<ErrorDetail>), ErrorInf |
| | | 36 | | { |
| | 0 | 37 | | Code = code; |
| | 0 | 38 | | Message = message; |
| | 0 | 39 | | Details = details; |
| | 0 | 40 | | Innererror = innererror; |
| | 0 | 41 | | AdditionalProperties = additionalProperties; |
| | | 42 | | CustomInit(); |
| | 0 | 43 | | } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// An initialization method that performs custom operations like setting defaults |
| | | 47 | | /// </summary> |
| | | 48 | | partial void CustomInit(); |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Gets or sets a machine readable error code. |
| | | 52 | | /// </summary> |
| | | 53 | | [JsonProperty(PropertyName = "code")] |
| | 9 | 54 | | public string Code { get; set; } |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Gets or sets a human readable error message. |
| | | 58 | | /// </summary> |
| | | 59 | | [JsonProperty(PropertyName = "message")] |
| | 0 | 60 | | public string Message { get; set; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Gets or sets error details. |
| | | 64 | | /// </summary> |
| | | 65 | | [JsonProperty(PropertyName = "details")] |
| | 0 | 66 | | public IList<ErrorDetail> Details { get; set; } |
| | | 67 | | |
| | | 68 | | /// <summary> |
| | | 69 | | /// Gets or sets inner error details if they exist. |
| | | 70 | | /// </summary> |
| | | 71 | | [JsonProperty(PropertyName = "innererror")] |
| | 8 | 72 | | public ErrorInfo Innererror { get; set; } |
| | | 73 | | |
| | | 74 | | /// <summary> |
| | | 75 | | /// </summary> |
| | | 76 | | [JsonProperty(PropertyName = "additionalProperties")] |
| | 0 | 77 | | public object AdditionalProperties { get; set; } |
| | | 78 | | |
| | | 79 | | /// <summary> |
| | | 80 | | /// Validate the object. |
| | | 81 | | /// </summary> |
| | | 82 | | /// <exception cref="ValidationException"> |
| | | 83 | | /// Thrown if validation fails |
| | | 84 | | /// </exception> |
| | | 85 | | public virtual void Validate() |
| | | 86 | | { |
| | 0 | 87 | | if (Code == null) |
| | | 88 | | { |
| | 0 | 89 | | throw new ValidationException(ValidationRules.CannotBeNull, "Code"); |
| | | 90 | | } |
| | 0 | 91 | | if (Message == null) |
| | | 92 | | { |
| | 0 | 93 | | throw new ValidationException(ValidationRules.CannotBeNull, "Message"); |
| | | 94 | | } |
| | 0 | 95 | | if (Details != null) |
| | | 96 | | { |
| | 0 | 97 | | foreach (var element in Details) |
| | | 98 | | { |
| | 0 | 99 | | if (element != null) |
| | | 100 | | { |
| | 0 | 101 | | element.Validate(); |
| | | 102 | | } |
| | | 103 | | } |
| | | 104 | | } |
| | 0 | 105 | | if (Innererror != null) |
| | | 106 | | { |
| | 0 | 107 | | Innererror.Validate(); |
| | | 108 | | } |
| | 0 | 109 | | } |
| | | 110 | | } |
| | | 111 | | } |