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