| | 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.CognitiveServices.Vision.ComputerVision.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Details about the API request error. |
| | 19 | | /// </summary> |
| | 20 | | public partial class ComputerVisionError |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the ComputerVisionError class. |
| | 24 | | /// </summary> |
| 0 | 25 | | public ComputerVisionError() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the ComputerVisionError class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="code">The error code.</param> |
| | 34 | | /// <param name="message">A message explaining the error reported by |
| | 35 | | /// the service.</param> |
| | 36 | | /// <param name="requestId">A unique request identifier.</param> |
| 0 | 37 | | public ComputerVisionError(object code, string message, string requestId = default(string)) |
| | 38 | | { |
| 0 | 39 | | Code = code; |
| 0 | 40 | | Message = message; |
| 0 | 41 | | RequestId = requestId; |
| | 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 the error code. |
| | 52 | | /// </summary> |
| | 53 | | [JsonProperty(PropertyName = "code")] |
| 0 | 54 | | public object Code { get; set; } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Gets or sets a message explaining the error reported by the |
| | 58 | | /// service. |
| | 59 | | /// </summary> |
| | 60 | | [JsonProperty(PropertyName = "message")] |
| 0 | 61 | | public string Message { get; set; } |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// Gets or sets a unique request identifier. |
| | 65 | | /// </summary> |
| | 66 | | [JsonProperty(PropertyName = "requestId")] |
| 0 | 67 | | public string RequestId { get; set; } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Validate the object. |
| | 71 | | /// </summary> |
| | 72 | | /// <exception cref="ValidationException"> |
| | 73 | | /// Thrown if validation fails |
| | 74 | | /// </exception> |
| | 75 | | public virtual void Validate() |
| | 76 | | { |
| 0 | 77 | | if (Code == null) |
| | 78 | | { |
| 0 | 79 | | throw new ValidationException(ValidationRules.CannotBeNull, "Code"); |
| | 80 | | } |
| 0 | 81 | | if (Message == null) |
| | 82 | | { |
| 0 | 83 | | throw new ValidationException(ValidationRules.CannotBeNull, "Message"); |
| | 84 | | } |
| 0 | 85 | | } |
| | 86 | | } |
| | 87 | | } |