| | 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 | | /// PersonFace object. |
| | 19 | | /// </summary> |
| | 20 | | public partial class PersistedFace |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the PersistedFace class. |
| | 24 | | /// </summary> |
| 72 | 25 | | public PersistedFace() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 72 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the PersistedFace class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="persistedFaceId">The persistedFaceId of the target |
| | 34 | | /// face, which is persisted and will not expire. Different from faceId |
| | 35 | | /// created by Face - Detect and will expire in 24 hours after the |
| | 36 | | /// detection call.</param> |
| | 37 | | /// <param name="userData">User-provided data attached to the face. The |
| | 38 | | /// size limit is 1KB.</param> |
| 0 | 39 | | public PersistedFace(System.Guid persistedFaceId, string userData = default(string)) |
| | 40 | | { |
| 0 | 41 | | PersistedFaceId = persistedFaceId; |
| 0 | 42 | | UserData = userData; |
| | 43 | | CustomInit(); |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// An initialization method that performs custom operations like setting defaults |
| | 48 | | /// </summary> |
| | 49 | | partial void CustomInit(); |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// Gets or sets the persistedFaceId of the target face, which is |
| | 53 | | /// persisted and will not expire. Different from faceId created by |
| | 54 | | /// Face - Detect and will expire in 24 hours after the detection call. |
| | 55 | | /// </summary> |
| | 56 | | [JsonProperty(PropertyName = "persistedFaceId")] |
| 100 | 57 | | public System.Guid PersistedFaceId { get; set; } |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Gets or sets user-provided data attached to the face. The size |
| | 61 | | /// limit is 1KB. |
| | 62 | | /// </summary> |
| | 63 | | [JsonProperty(PropertyName = "userData")] |
| 0 | 64 | | public string UserData { get; set; } |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Validate the object. |
| | 68 | | /// </summary> |
| | 69 | | /// <exception cref="ValidationException"> |
| | 70 | | /// Thrown if validation fails |
| | 71 | | /// </exception> |
| | 72 | | public virtual void Validate() |
| | 73 | | { |
| 0 | 74 | | if (UserData != null) |
| | 75 | | { |
| 0 | 76 | | if (UserData.Length > 1024) |
| | 77 | | { |
| 0 | 78 | | throw new ValidationException(ValidationRules.MaxLength, "UserData", 1024); |
| | 79 | | } |
| | 80 | | } |
| 0 | 81 | | } |
| | 82 | | } |
| | 83 | | } |