| | | 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 | | /// Request body for face to person verification. |
| | | 19 | | /// </summary> |
| | | 20 | | public partial class VerifyFaceToPersonRequest |
| | | 21 | | { |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes a new instance of the VerifyFaceToPersonRequest class. |
| | | 24 | | /// </summary> |
| | 8 | 25 | | public VerifyFaceToPersonRequest() |
| | | 26 | | { |
| | | 27 | | CustomInit(); |
| | 8 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Initializes a new instance of the VerifyFaceToPersonRequest class. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="faceId">FaceId of the face, comes from Face - |
| | | 34 | | /// Detect</param> |
| | | 35 | | /// <param name="personId">Specify a certain person in a person group |
| | | 36 | | /// or a large person group. personId is created in PersonGroup Person |
| | | 37 | | /// - Create or LargePersonGroup Person - Create.</param> |
| | | 38 | | /// <param name="personGroupId">Using existing personGroupId and |
| | | 39 | | /// personId for fast loading a specified person. personGroupId is |
| | | 40 | | /// created in PersonGroup - Create. Parameter personGroupId and |
| | | 41 | | /// largePersonGroupId should not be provided at the same time.</param> |
| | | 42 | | /// <param name="largePersonGroupId">Using existing largePersonGroupId |
| | | 43 | | /// and personId for fast loading a specified person. |
| | | 44 | | /// largePersonGroupId is created in LargePersonGroup - Create. |
| | | 45 | | /// Parameter personGroupId and largePersonGroupId should not be |
| | | 46 | | /// provided at the same time.</param> |
| | 0 | 47 | | public VerifyFaceToPersonRequest(System.Guid faceId, System.Guid personId, string personGroupId = default(string |
| | | 48 | | { |
| | 0 | 49 | | FaceId = faceId; |
| | 0 | 50 | | PersonGroupId = personGroupId; |
| | 0 | 51 | | LargePersonGroupId = largePersonGroupId; |
| | 0 | 52 | | PersonId = personId; |
| | | 53 | | CustomInit(); |
| | 0 | 54 | | } |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// An initialization method that performs custom operations like setting defaults |
| | | 58 | | /// </summary> |
| | | 59 | | partial void CustomInit(); |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Gets or sets faceId of the face, comes from Face - Detect |
| | | 63 | | /// </summary> |
| | | 64 | | [JsonProperty(PropertyName = "faceId")] |
| | 16 | 65 | | public System.Guid FaceId { get; set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets or sets using existing personGroupId and personId for fast |
| | | 69 | | /// loading a specified person. personGroupId is created in PersonGroup |
| | | 70 | | /// - Create. Parameter personGroupId and largePersonGroupId should not |
| | | 71 | | /// be provided at the same time. |
| | | 72 | | /// </summary> |
| | | 73 | | [JsonProperty(PropertyName = "personGroupId")] |
| | 16 | 74 | | public string PersonGroupId { get; set; } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Gets or sets using existing largePersonGroupId and personId for |
| | | 78 | | /// fast loading a specified person. largePersonGroupId is created in |
| | | 79 | | /// LargePersonGroup - Create. Parameter personGroupId and |
| | | 80 | | /// largePersonGroupId should not be provided at the same time. |
| | | 81 | | /// </summary> |
| | | 82 | | [JsonProperty(PropertyName = "largePersonGroupId")] |
| | 16 | 83 | | public string LargePersonGroupId { get; set; } |
| | | 84 | | |
| | | 85 | | /// <summary> |
| | | 86 | | /// Gets or sets specify a certain person in a person group or a large |
| | | 87 | | /// person group. personId is created in PersonGroup Person - Create or |
| | | 88 | | /// LargePersonGroup Person - Create. |
| | | 89 | | /// </summary> |
| | | 90 | | [JsonProperty(PropertyName = "personId")] |
| | 16 | 91 | | public System.Guid PersonId { get; set; } |
| | | 92 | | |
| | | 93 | | /// <summary> |
| | | 94 | | /// Validate the object. |
| | | 95 | | /// </summary> |
| | | 96 | | /// <exception cref="ValidationException"> |
| | | 97 | | /// Thrown if validation fails |
| | | 98 | | /// </exception> |
| | | 99 | | public virtual void Validate() |
| | | 100 | | { |
| | 0 | 101 | | if (PersonGroupId != null) |
| | | 102 | | { |
| | 0 | 103 | | if (PersonGroupId.Length > 64) |
| | | 104 | | { |
| | 0 | 105 | | throw new ValidationException(ValidationRules.MaxLength, "PersonGroupId", 64); |
| | | 106 | | } |
| | 0 | 107 | | if (!System.Text.RegularExpressions.Regex.IsMatch(PersonGroupId, "^[a-z0-9-_]+$")) |
| | | 108 | | { |
| | 0 | 109 | | throw new ValidationException(ValidationRules.Pattern, "PersonGroupId", "^[a-z0-9-_]+$"); |
| | | 110 | | } |
| | | 111 | | } |
| | 0 | 112 | | if (LargePersonGroupId != null) |
| | | 113 | | { |
| | 0 | 114 | | if (LargePersonGroupId.Length > 64) |
| | | 115 | | { |
| | 0 | 116 | | throw new ValidationException(ValidationRules.MaxLength, "LargePersonGroupId", 64); |
| | | 117 | | } |
| | 0 | 118 | | if (!System.Text.RegularExpressions.Regex.IsMatch(LargePersonGroupId, "^[a-z0-9-_]+$")) |
| | | 119 | | { |
| | 0 | 120 | | throw new ValidationException(ValidationRules.Pattern, "LargePersonGroupId", "^[a-z0-9-_]+$"); |
| | | 121 | | } |
| | | 122 | | } |
| | 0 | 123 | | } |
| | | 124 | | } |
| | | 125 | | } |