| | 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 | | /// Snapshot object. |
| | 21 | | /// </summary> |
| | 22 | | public partial class Snapshot |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Initializes a new instance of the Snapshot class. |
| | 26 | | /// </summary> |
| 0 | 27 | | public Snapshot() |
| | 28 | | { |
| | 29 | | CustomInit(); |
| 0 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the Snapshot class. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="id">Snapshot id.</param> |
| | 36 | | /// <param name="account">Azure Cognitive Service Face account id of |
| | 37 | | /// the subscriber who created the snapshot by Snapshot - Take.</param> |
| | 38 | | /// <param name="type">Type of the source object in the snapshot, |
| | 39 | | /// specified by the subscriber who created the snapshot when calling |
| | 40 | | /// Snapshot - Take. Currently FaceList, PersonGroup, LargeFaceList and |
| | 41 | | /// LargePersonGroup are supported. Possible values include: |
| | 42 | | /// 'FaceList', 'LargeFaceList', 'LargePersonGroup', |
| | 43 | | /// 'PersonGroup'</param> |
| | 44 | | /// <param name="applyScope">Array of the target Face subscription ids |
| | 45 | | /// for the snapshot, specified by the user who created the snapshot |
| | 46 | | /// when calling Snapshot - Take. For each snapshot, only subscriptions |
| | 47 | | /// included in the applyScope of Snapshot - Take can apply it.</param> |
| | 48 | | /// <param name="createdTime">A combined UTC date and time string that |
| | 49 | | /// describes the created time of the snapshot. E.g. |
| | 50 | | /// 2018-12-25T11:41:02.2331413Z.</param> |
| | 51 | | /// <param name="lastUpdateTime">A combined UTC date and time string |
| | 52 | | /// that describes the last time when the snapshot was created or |
| | 53 | | /// updated by Snapshot - Update. E.g. |
| | 54 | | /// 2018-12-25T11:51:27.8705696Z.</param> |
| | 55 | | /// <param name="userData">User specified data about the snapshot for |
| | 56 | | /// any purpose. Length should not exceed 16KB.</param> |
| 0 | 57 | | public Snapshot(System.Guid id, string account, SnapshotObjectType type, IList<System.Guid> applyScope, System.D |
| | 58 | | { |
| 0 | 59 | | Id = id; |
| 0 | 60 | | Account = account; |
| 0 | 61 | | Type = type; |
| 0 | 62 | | ApplyScope = applyScope; |
| 0 | 63 | | UserData = userData; |
| 0 | 64 | | CreatedTime = createdTime; |
| 0 | 65 | | LastUpdateTime = lastUpdateTime; |
| | 66 | | CustomInit(); |
| 0 | 67 | | } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// An initialization method that performs custom operations like setting defaults |
| | 71 | | /// </summary> |
| | 72 | | partial void CustomInit(); |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// Gets or sets snapshot id. |
| | 76 | | /// </summary> |
| | 77 | | [JsonProperty(PropertyName = "id")] |
| 0 | 78 | | public System.Guid Id { get; set; } |
| | 79 | |
|
| | 80 | | /// <summary> |
| | 81 | | /// Gets or sets azure Cognitive Service Face account id of the |
| | 82 | | /// subscriber who created the snapshot by Snapshot - Take. |
| | 83 | | /// </summary> |
| | 84 | | [JsonProperty(PropertyName = "account")] |
| 0 | 85 | | public string Account { get; set; } |
| | 86 | |
|
| | 87 | | /// <summary> |
| | 88 | | /// Gets or sets type of the source object in the snapshot, specified |
| | 89 | | /// by the subscriber who created the snapshot when calling Snapshot - |
| | 90 | | /// Take. Currently FaceList, PersonGroup, LargeFaceList and |
| | 91 | | /// LargePersonGroup are supported. Possible values include: |
| | 92 | | /// 'FaceList', 'LargeFaceList', 'LargePersonGroup', 'PersonGroup' |
| | 93 | | /// </summary> |
| | 94 | | [JsonProperty(PropertyName = "type")] |
| 0 | 95 | | public SnapshotObjectType Type { get; set; } |
| | 96 | |
|
| | 97 | | /// <summary> |
| | 98 | | /// Gets or sets array of the target Face subscription ids for the |
| | 99 | | /// snapshot, specified by the user who created the snapshot when |
| | 100 | | /// calling Snapshot - Take. For each snapshot, only subscriptions |
| | 101 | | /// included in the applyScope of Snapshot - Take can apply it. |
| | 102 | | /// </summary> |
| | 103 | | [JsonProperty(PropertyName = "applyScope")] |
| 0 | 104 | | public IList<System.Guid> ApplyScope { get; set; } |
| | 105 | |
|
| | 106 | | /// <summary> |
| | 107 | | /// Gets or sets user specified data about the snapshot for any |
| | 108 | | /// purpose. Length should not exceed 16KB. |
| | 109 | | /// </summary> |
| | 110 | | [JsonProperty(PropertyName = "userData")] |
| 0 | 111 | | public string UserData { get; set; } |
| | 112 | |
|
| | 113 | | /// <summary> |
| | 114 | | /// Gets or sets a combined UTC date and time string that describes the |
| | 115 | | /// created time of the snapshot. E.g. 2018-12-25T11:41:02.2331413Z. |
| | 116 | | /// </summary> |
| | 117 | | [JsonProperty(PropertyName = "createdTime")] |
| 0 | 118 | | public System.DateTime CreatedTime { get; set; } |
| | 119 | |
|
| | 120 | | /// <summary> |
| | 121 | | /// Gets or sets a combined UTC date and time string that describes the |
| | 122 | | /// last time when the snapshot was created or updated by Snapshot - |
| | 123 | | /// Update. E.g. 2018-12-25T11:51:27.8705696Z. |
| | 124 | | /// </summary> |
| | 125 | | [JsonProperty(PropertyName = "lastUpdateTime")] |
| 0 | 126 | | public System.DateTime LastUpdateTime { get; set; } |
| | 127 | |
|
| | 128 | | /// <summary> |
| | 129 | | /// Validate the object. |
| | 130 | | /// </summary> |
| | 131 | | /// <exception cref="ValidationException"> |
| | 132 | | /// Thrown if validation fails |
| | 133 | | /// </exception> |
| | 134 | | public virtual void Validate() |
| | 135 | | { |
| 0 | 136 | | if (Account == null) |
| | 137 | | { |
| 0 | 138 | | throw new ValidationException(ValidationRules.CannotBeNull, "Account"); |
| | 139 | | } |
| 0 | 140 | | if (ApplyScope == null) |
| | 141 | | { |
| 0 | 142 | | throw new ValidationException(ValidationRules.CannotBeNull, "ApplyScope"); |
| | 143 | | } |
| 0 | 144 | | if (UserData != null) |
| | 145 | | { |
| 0 | 146 | | if (UserData.Length > 16384) |
| | 147 | | { |
| 0 | 148 | | throw new ValidationException(ValidationRules.MaxLength, "UserData", 16384); |
| | 149 | | } |
| | 150 | | } |
| 0 | 151 | | } |
| | 152 | | } |
| | 153 | | } |