| | | 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 | | /// Person group object. |
| | | 19 | | /// </summary> |
| | | 20 | | public partial class PersonGroup : MetaDataContract |
| | | 21 | | { |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes a new instance of the PersonGroup class. |
| | | 24 | | /// </summary> |
| | 2 | 25 | | public PersonGroup() |
| | | 26 | | { |
| | | 27 | | CustomInit(); |
| | 2 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Initializes a new instance of the PersonGroup class. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="personGroupId">PersonGroupId of the target person |
| | | 34 | | /// group.</param> |
| | | 35 | | /// <param name="name">User defined name, maximum length is |
| | | 36 | | /// 128.</param> |
| | | 37 | | /// <param name="userData">User specified data. Length should not |
| | | 38 | | /// exceed 16KB.</param> |
| | | 39 | | /// <param name="recognitionModel">Possible values include: |
| | | 40 | | /// 'recognition_01', 'recognition_02'</param> |
| | | 41 | | public PersonGroup(string personGroupId, string name = default(string), string userData = default(string), strin |
| | 0 | 42 | | : base(name, userData, recognitionModel) |
| | | 43 | | { |
| | 0 | 44 | | PersonGroupId = personGroupId; |
| | | 45 | | CustomInit(); |
| | 0 | 46 | | } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// An initialization method that performs custom operations like setting defaults |
| | | 50 | | /// </summary> |
| | | 51 | | partial void CustomInit(); |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Gets or sets personGroupId of the target person group. |
| | | 55 | | /// </summary> |
| | | 56 | | [JsonProperty(PropertyName = "personGroupId")] |
| | 0 | 57 | | public string PersonGroupId { get; set; } |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// Validate the object. |
| | | 61 | | /// </summary> |
| | | 62 | | /// <exception cref="ValidationException"> |
| | | 63 | | /// Thrown if validation fails |
| | | 64 | | /// </exception> |
| | | 65 | | public override void Validate() |
| | | 66 | | { |
| | 0 | 67 | | base.Validate(); |
| | 0 | 68 | | if (PersonGroupId == null) |
| | | 69 | | { |
| | 0 | 70 | | throw new ValidationException(ValidationRules.CannotBeNull, "PersonGroupId"); |
| | | 71 | | } |
| | 0 | 72 | | if (PersonGroupId != null) |
| | | 73 | | { |
| | 0 | 74 | | if (PersonGroupId.Length > 64) |
| | | 75 | | { |
| | 0 | 76 | | throw new ValidationException(ValidationRules.MaxLength, "PersonGroupId", 64); |
| | | 77 | | } |
| | 0 | 78 | | if (!System.Text.RegularExpressions.Regex.IsMatch(PersonGroupId, "^[a-z0-9-_]+$")) |
| | | 79 | | { |
| | 0 | 80 | | throw new ValidationException(ValidationRules.Pattern, "PersonGroupId", "^[a-z0-9-_]+$"); |
| | | 81 | | } |
| | | 82 | | } |
| | 0 | 83 | | } |
| | | 84 | | } |
| | | 85 | | } |