| | 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.FormRecognizer.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Contract to initiate a train request. |
| | 19 | | /// </summary> |
| | 20 | | public partial class TrainRequest |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the TrainRequest class. |
| | 24 | | /// </summary> |
| 0 | 25 | | public TrainRequest() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the TrainRequest class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="source">Get or set source path.</param> |
| 0 | 34 | | public TrainRequest(string source) |
| | 35 | | { |
| 0 | 36 | | Source = source; |
| | 37 | | CustomInit(); |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// An initialization method that performs custom operations like setting defaults |
| | 42 | | /// </summary> |
| | 43 | | partial void CustomInit(); |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Gets or sets get or set source path. |
| | 47 | | /// </summary> |
| | 48 | | [JsonProperty(PropertyName = "source")] |
| 0 | 49 | | public string Source { get; set; } |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// Validate the object. |
| | 53 | | /// </summary> |
| | 54 | | /// <exception cref="ValidationException"> |
| | 55 | | /// Thrown if validation fails |
| | 56 | | /// </exception> |
| | 57 | | public virtual void Validate() |
| | 58 | | { |
| 0 | 59 | | if (Source == null) |
| | 60 | | { |
| 0 | 61 | | throw new ValidationException(ValidationRules.CannotBeNull, "Source"); |
| | 62 | | } |
| 0 | 63 | | if (Source != null) |
| | 64 | | { |
| 0 | 65 | | if (Source.Length > 2048) |
| | 66 | | { |
| 0 | 67 | | throw new ValidationException(ValidationRules.MaxLength, "Source", 2048); |
| | 68 | | } |
| 0 | 69 | | if (Source.Length < 0) |
| | 70 | | { |
| 0 | 71 | | throw new ValidationException(ValidationRules.MinLength, "Source", 0); |
| | 72 | | } |
| | 73 | | } |
| 0 | 74 | | } |
| | 75 | | } |
| | 76 | | } |