| | | 1 | | // <auto-generated> |
| | | 2 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 3 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 4 | | // regenerated. |
| | | 5 | | // </auto-generated> |
| | | 6 | | |
| | | 7 | | namespace Microsoft.Azure.CognitiveServices.Search.ImageSearch.Models |
| | | 8 | | { |
| | | 9 | | using Microsoft.Rest; |
| | | 10 | | using Newtonsoft.Json; |
| | | 11 | | using System.Collections; |
| | | 12 | | using System.Collections.Generic; |
| | | 13 | | using System.Linq; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Defines a group of previously recognized entities. |
| | | 17 | | /// </summary> |
| | | 18 | | public partial class RecognizedEntityGroup |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the RecognizedEntityGroup class. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public RecognizedEntityGroup() |
| | | 24 | | { |
| | | 25 | | CustomInit(); |
| | 0 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Initializes a new instance of the RecognizedEntityGroup class. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <param name="recognizedEntityRegions">The regions of the image that |
| | | 32 | | /// contain entities.</param> |
| | | 33 | | /// <param name="name">The name of the group where images of the entity |
| | | 34 | | /// were also found. The following are possible groups. |
| | | 35 | | /// CelebRecognitionAnnotations: Similar to CelebrityAnnotations but |
| | | 36 | | /// provides a higher probability of an accurate match. |
| | | 37 | | /// CelebrityAnnotations: Contains celebrities such as actors, |
| | | 38 | | /// politicians, athletes, and historical figures.</param> |
| | 0 | 39 | | public RecognizedEntityGroup(IList<RecognizedEntityRegion> recognizedEntityRegions, string name) |
| | | 40 | | { |
| | 0 | 41 | | RecognizedEntityRegions = recognizedEntityRegions; |
| | 0 | 42 | | Name = name; |
| | | 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 regions of the image that contain entities. |
| | | 53 | | /// </summary> |
| | | 54 | | [JsonProperty(PropertyName = "recognizedEntityRegions")] |
| | 0 | 55 | | public IList<RecognizedEntityRegion> RecognizedEntityRegions { get; set; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets or sets the name of the group where images of the entity were |
| | | 59 | | /// also found. The following are possible groups. |
| | | 60 | | /// CelebRecognitionAnnotations: Similar to CelebrityAnnotations but |
| | | 61 | | /// provides a higher probability of an accurate match. |
| | | 62 | | /// CelebrityAnnotations: Contains celebrities such as actors, |
| | | 63 | | /// politicians, athletes, and historical figures. |
| | | 64 | | /// </summary> |
| | | 65 | | [JsonProperty(PropertyName = "name")] |
| | 0 | 66 | | public string Name { get; set; } |
| | | 67 | | |
| | | 68 | | /// <summary> |
| | | 69 | | /// Validate the object. |
| | | 70 | | /// </summary> |
| | | 71 | | /// <exception cref="ValidationException"> |
| | | 72 | | /// Thrown if validation fails |
| | | 73 | | /// </exception> |
| | | 74 | | public virtual void Validate() |
| | | 75 | | { |
| | 0 | 76 | | if (RecognizedEntityRegions == null) |
| | | 77 | | { |
| | 0 | 78 | | throw new ValidationException(ValidationRules.CannotBeNull, "RecognizedEntityRegions"); |
| | | 79 | | } |
| | 0 | 80 | | if (Name == null) |
| | | 81 | | { |
| | 0 | 82 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | | 83 | | } |
| | 0 | 84 | | if (RecognizedEntityRegions != null) |
| | | 85 | | { |
| | 0 | 86 | | foreach (var element in RecognizedEntityRegions) |
| | | 87 | | { |
| | 0 | 88 | | if (element != null) |
| | | 89 | | { |
| | 0 | 90 | | element.Validate(); |
| | | 91 | | } |
| | | 92 | | } |
| | | 93 | | } |
| | 0 | 94 | | } |
| | | 95 | | } |
| | | 96 | | } |