| | | 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.ContentModerator.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 | | /// Schema items of the body. |
| | | 17 | | /// </summary> |
| | | 18 | | public partial class TranscriptModerationBodyItem |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the TranscriptModerationBodyItem |
| | | 22 | | /// class. |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public TranscriptModerationBodyItem() |
| | | 25 | | { |
| | | 26 | | CustomInit(); |
| | 0 | 27 | | } |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Initializes a new instance of the TranscriptModerationBodyItem |
| | | 31 | | /// class. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="timestamp">Timestamp of the image.</param> |
| | | 34 | | /// <param name="terms">Optional metadata details.</param> |
| | 0 | 35 | | public TranscriptModerationBodyItem(string timestamp, IList<TranscriptModerationBodyItemTermsItem> terms) |
| | | 36 | | { |
| | 0 | 37 | | Timestamp = timestamp; |
| | 0 | 38 | | Terms = terms; |
| | | 39 | | CustomInit(); |
| | 0 | 40 | | } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// An initialization method that performs custom operations like setting defaults |
| | | 44 | | /// </summary> |
| | | 45 | | partial void CustomInit(); |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets or sets timestamp of the image. |
| | | 49 | | /// </summary> |
| | | 50 | | [JsonProperty(PropertyName = "Timestamp")] |
| | 0 | 51 | | public string Timestamp { get; set; } |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Gets or sets optional metadata details. |
| | | 55 | | /// </summary> |
| | | 56 | | [JsonProperty(PropertyName = "Terms")] |
| | 0 | 57 | | public IList<TranscriptModerationBodyItemTermsItem> Terms { get; set; } |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// Validate the object. |
| | | 61 | | /// </summary> |
| | | 62 | | /// <exception cref="ValidationException"> |
| | | 63 | | /// Thrown if validation fails |
| | | 64 | | /// </exception> |
| | | 65 | | public virtual void Validate() |
| | | 66 | | { |
| | 0 | 67 | | if (Timestamp == null) |
| | | 68 | | { |
| | 0 | 69 | | throw new ValidationException(ValidationRules.CannotBeNull, "Timestamp"); |
| | | 70 | | } |
| | 0 | 71 | | if (Terms == null) |
| | | 72 | | { |
| | 0 | 73 | | throw new ValidationException(ValidationRules.CannotBeNull, "Terms"); |
| | | 74 | | } |
| | 0 | 75 | | if (Terms != null) |
| | | 76 | | { |
| | 0 | 77 | | foreach (var element in Terms) |
| | | 78 | | { |
| | 0 | 79 | | if (element != null) |
| | | 80 | | { |
| | 0 | 81 | | element.Validate(); |
| | | 82 | | } |
| | | 83 | | } |
| | | 84 | | } |
| | 0 | 85 | | } |
| | | 86 | | } |
| | | 87 | | } |