| | 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.Face.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// A combination of user defined name and user specified data for the |
| | 19 | | /// person, largePersonGroup/personGroup, and largeFaceList/faceList. |
| | 20 | | /// </summary> |
| | 21 | | public partial class NameAndUserDataContract |
| | 22 | | { |
| | 23 | | /// <summary> |
| | 24 | | /// Initializes a new instance of the NameAndUserDataContract class. |
| | 25 | | /// </summary> |
| 76 | 26 | | public NameAndUserDataContract() |
| | 27 | | { |
| | 28 | | CustomInit(); |
| 76 | 29 | | } |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// Initializes a new instance of the NameAndUserDataContract class. |
| | 33 | | /// </summary> |
| | 34 | | /// <param name="name">User defined name, maximum length is |
| | 35 | | /// 128.</param> |
| | 36 | | /// <param name="userData">User specified data. Length should not |
| | 37 | | /// exceed 16KB.</param> |
| 0 | 38 | | public NameAndUserDataContract(string name = default(string), string userData = default(string)) |
| | 39 | | { |
| 0 | 40 | | Name = name; |
| 0 | 41 | | UserData = userData; |
| | 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 user defined name, maximum length is 128. |
| | 52 | | /// </summary> |
| | 53 | | [JsonProperty(PropertyName = "name")] |
| 100 | 54 | | public string Name { get; set; } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Gets or sets user specified data. Length should not exceed 16KB. |
| | 58 | | /// </summary> |
| | 59 | | [JsonProperty(PropertyName = "userData")] |
| 100 | 60 | | public string UserData { get; set; } |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Validate the object. |
| | 64 | | /// </summary> |
| | 65 | | /// <exception cref="ValidationException"> |
| | 66 | | /// Thrown if validation fails |
| | 67 | | /// </exception> |
| | 68 | | public virtual void Validate() |
| | 69 | | { |
| 0 | 70 | | if (Name != null) |
| | 71 | | { |
| 0 | 72 | | if (Name.Length > 128) |
| | 73 | | { |
| 0 | 74 | | throw new ValidationException(ValidationRules.MaxLength, "Name", 128); |
| | 75 | | } |
| | 76 | | } |
| 0 | 77 | | if (UserData != null) |
| | 78 | | { |
| 0 | 79 | | if (UserData.Length > 16384) |
| | 80 | | { |
| 0 | 81 | | throw new ValidationException(ValidationRules.MaxLength, "UserData", 16384); |
| | 82 | | } |
| | 83 | | } |
| 0 | 84 | | } |
| | 85 | | } |
| | 86 | | } |