| | 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.CustomVision.Training.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Represents a Tag. |
| | 19 | | /// </summary> |
| | 20 | | public partial class Tag |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the Tag class. |
| | 24 | | /// </summary> |
| 54 | 25 | | public Tag() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 54 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the Tag class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="name">Gets or sets the name of the tag.</param> |
| | 34 | | /// <param name="description">Gets or sets the description of the |
| | 35 | | /// tag.</param> |
| | 36 | | /// <param name="type">Gets or sets the type of the tag. Possible |
| | 37 | | /// values include: 'Regular', 'Negative', 'GeneralProduct'</param> |
| | 38 | | /// <param name="id">Gets the Tag ID.</param> |
| | 39 | | /// <param name="imageCount">Gets the number of images with this |
| | 40 | | /// tag.</param> |
| 0 | 41 | | public Tag(string name, string description, string type, System.Guid id = default(System.Guid), int imageCount = |
| | 42 | | { |
| 0 | 43 | | Id = id; |
| 0 | 44 | | Name = name; |
| 0 | 45 | | Description = description; |
| 0 | 46 | | Type = type; |
| 0 | 47 | | ImageCount = imageCount; |
| | 48 | | CustomInit(); |
| 0 | 49 | | } |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// An initialization method that performs custom operations like setting defaults |
| | 53 | | /// </summary> |
| | 54 | | partial void CustomInit(); |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Gets the Tag ID. |
| | 58 | | /// </summary> |
| | 59 | | [JsonProperty(PropertyName = "id")] |
| 118 | 60 | | public System.Guid Id { get; private set; } |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Gets or sets the name of the tag. |
| | 64 | | /// </summary> |
| | 65 | | [JsonProperty(PropertyName = "name")] |
| 82 | 66 | | public string Name { get; set; } |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Gets or sets the description of the tag. |
| | 70 | | /// </summary> |
| | 71 | | [JsonProperty(PropertyName = "description")] |
| 20 | 72 | | public string Description { get; set; } |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// Gets or sets the type of the tag. Possible values include: |
| | 76 | | /// 'Regular', 'Negative', 'GeneralProduct' |
| | 77 | | /// </summary> |
| | 78 | | [JsonProperty(PropertyName = "type")] |
| 54 | 79 | | public string Type { get; set; } |
| | 80 | |
|
| | 81 | | /// <summary> |
| | 82 | | /// Gets the number of images with this tag. |
| | 83 | | /// </summary> |
| | 84 | | [JsonProperty(PropertyName = "imageCount")] |
| 66 | 85 | | public int ImageCount { get; private set; } |
| | 86 | |
|
| | 87 | | /// <summary> |
| | 88 | | /// Validate the object. |
| | 89 | | /// </summary> |
| | 90 | | /// <exception cref="ValidationException"> |
| | 91 | | /// Thrown if validation fails |
| | 92 | | /// </exception> |
| | 93 | | public virtual void Validate() |
| | 94 | | { |
| 0 | 95 | | if (Name == null) |
| | 96 | | { |
| 0 | 97 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | 98 | | } |
| 0 | 99 | | if (Description == null) |
| | 100 | | { |
| 0 | 101 | | throw new ValidationException(ValidationRules.CannotBeNull, "Description"); |
| | 102 | | } |
| 0 | 103 | | if (Type == null) |
| | 104 | | { |
| 0 | 105 | | throw new ValidationException(ValidationRules.CannotBeNull, "Type"); |
| | 106 | | } |
| 0 | 107 | | } |
| | 108 | | } |
| | 109 | | } |