| | | 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.CognitiveServices.Search.VideoSearch.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 top-level response that represents a failed request. |
| | | 17 | | /// </summary> |
| | | 18 | | public partial class ErrorResponse : Response |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the ErrorResponse class. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public ErrorResponse() |
| | | 24 | | { |
| | | 25 | | CustomInit(); |
| | 0 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Initializes a new instance of the ErrorResponse class. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <param name="errors">A list of errors that describe the reasons why |
| | | 32 | | /// the request failed.</param> |
| | | 33 | | /// <param name="id">A String identifier.</param> |
| | | 34 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | | 35 | | /// item.</param> |
| | | 36 | | public ErrorResponse(IList<Error> errors, string id = default(string), string webSearchUrl = default(string)) |
| | 0 | 37 | | : base(id, webSearchUrl) |
| | | 38 | | { |
| | 0 | 39 | | Errors = errors; |
| | | 40 | | CustomInit(); |
| | 0 | 41 | | } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// An initialization method that performs custom operations like setting defaults |
| | | 45 | | /// </summary> |
| | | 46 | | partial void CustomInit(); |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Gets or sets a list of errors that describe the reasons why the |
| | | 50 | | /// request failed. |
| | | 51 | | /// </summary> |
| | | 52 | | [JsonProperty(PropertyName = "errors")] |
| | 0 | 53 | | public IList<Error> Errors { get; set; } |
| | | 54 | | |
| | | 55 | | /// <summary> |
| | | 56 | | /// Validate the object. |
| | | 57 | | /// </summary> |
| | | 58 | | /// <exception cref="ValidationException"> |
| | | 59 | | /// Thrown if validation fails |
| | | 60 | | /// </exception> |
| | | 61 | | public virtual void Validate() |
| | | 62 | | { |
| | 0 | 63 | | if (Errors == null) |
| | | 64 | | { |
| | 0 | 65 | | throw new ValidationException(ValidationRules.CannotBeNull, "Errors"); |
| | | 66 | | } |
| | 0 | 67 | | if (Errors != null) |
| | | 68 | | { |
| | 0 | 69 | | foreach (var element in Errors) |
| | | 70 | | { |
| | 0 | 71 | | if (element != null) |
| | | 72 | | { |
| | 0 | 73 | | element.Validate(); |
| | | 74 | | } |
| | | 75 | | } |
| | | 76 | | } |
| | 0 | 77 | | } |
| | | 78 | | } |
| | | 79 | | } |