| | | 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.Collections; |
| | | 16 | | using System.Collections.Generic; |
| | | 17 | | using System.Linq; |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// Response body for identify face operation. |
| | | 21 | | /// </summary> |
| | | 22 | | public partial class IdentifyResult |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Initializes a new instance of the IdentifyResult class. |
| | | 26 | | /// </summary> |
| | 4 | 27 | | public IdentifyResult() |
| | | 28 | | { |
| | | 29 | | CustomInit(); |
| | 4 | 30 | | } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Initializes a new instance of the IdentifyResult class. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <param name="faceId">FaceId of the query face</param> |
| | | 36 | | /// <param name="candidates">Identified person candidates for that face |
| | | 37 | | /// (ranked by confidence). Array size should be no larger than input |
| | | 38 | | /// maxNumOfCandidatesReturned. If no person is identified, will return |
| | | 39 | | /// an empty array.</param> |
| | 0 | 40 | | public IdentifyResult(System.Guid faceId, IList<IdentifyCandidate> candidates) |
| | | 41 | | { |
| | 0 | 42 | | FaceId = faceId; |
| | 0 | 43 | | Candidates = candidates; |
| | | 44 | | CustomInit(); |
| | 0 | 45 | | } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// An initialization method that performs custom operations like setting defaults |
| | | 49 | | /// </summary> |
| | | 50 | | partial void CustomInit(); |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets or sets faceId of the query face |
| | | 54 | | /// </summary> |
| | | 55 | | [JsonProperty(PropertyName = "faceId")] |
| | 0 | 56 | | public System.Guid FaceId { get; set; } |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Gets or sets identified person candidates for that face (ranked by |
| | | 60 | | /// confidence). Array size should be no larger than input |
| | | 61 | | /// maxNumOfCandidatesReturned. If no person is identified, will return |
| | | 62 | | /// an empty array. |
| | | 63 | | /// </summary> |
| | | 64 | | [JsonProperty(PropertyName = "candidates")] |
| | 16 | 65 | | public IList<IdentifyCandidate> Candidates { get; set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Validate the object. |
| | | 69 | | /// </summary> |
| | | 70 | | /// <exception cref="ValidationException"> |
| | | 71 | | /// Thrown if validation fails |
| | | 72 | | /// </exception> |
| | | 73 | | public virtual void Validate() |
| | | 74 | | { |
| | 0 | 75 | | if (Candidates == null) |
| | | 76 | | { |
| | 0 | 77 | | throw new ValidationException(ValidationRules.CannotBeNull, "Candidates"); |
| | | 78 | | } |
| | 0 | 79 | | if (Candidates != null) |
| | | 80 | | { |
| | 0 | 81 | | foreach (var element in Candidates) |
| | | 82 | | { |
| | 0 | 83 | | if (element != null) |
| | | 84 | | { |
| | 0 | 85 | | element.Validate(); |
| | | 86 | | } |
| | | 87 | | } |
| | | 88 | | } |
| | 0 | 89 | | } |
| | | 90 | | } |
| | | 91 | | } |