| | | 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 Newtonsoft.Json; |
| | | 10 | | using System.Collections; |
| | | 11 | | using System.Collections.Generic; |
| | | 12 | | using System.Linq; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Defines a region of the image where an entity was found and a list of |
| | | 16 | | /// entities that might match it. |
| | | 17 | | /// </summary> |
| | | 18 | | public partial class RecognizedEntityRegion : Response |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the RecognizedEntityRegion class. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public RecognizedEntityRegion() |
| | | 24 | | { |
| | | 25 | | CustomInit(); |
| | 0 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Initializes a new instance of the RecognizedEntityRegion class. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <param name="id">A String identifier.</param> |
| | | 32 | | /// <param name="readLink">The URL that returns this resource.</param> |
| | | 33 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | | 34 | | /// item.</param> |
| | | 35 | | /// <param name="region">A region of the image that contains an entity. |
| | | 36 | | /// The values of the rectangle are relative to the width and height of |
| | | 37 | | /// the original image and are in the range 0.0 through 1.0. For |
| | | 38 | | /// example, if the image is 300x200 and the region's top, left corner |
| | | 39 | | /// is at point (10, 20) and the bottom, right corner is at point (290, |
| | | 40 | | /// 150), then the normalized rectangle is: Left = 0.0333333333333333, |
| | | 41 | | /// Top = 0.1, Right = 0.9666666666666667, Bottom = 0.75. For people, |
| | | 42 | | /// the region represents the person's face.</param> |
| | | 43 | | /// <param name="matchingEntities">A list of entities that Bing |
| | | 44 | | /// believes match the entity found in the region. The entities are in |
| | | 45 | | /// descending order of confidence (see the matchConfidence field of |
| | | 46 | | /// RecognizedEntity).</param> |
| | | 47 | | public RecognizedEntityRegion(string id = default(string), string readLink = default(string), string webSearchUr |
| | 0 | 48 | | : base(id, readLink, webSearchUrl) |
| | | 49 | | { |
| | 0 | 50 | | Region = region; |
| | 0 | 51 | | MatchingEntities = matchingEntities; |
| | | 52 | | CustomInit(); |
| | 0 | 53 | | } |
| | | 54 | | |
| | | 55 | | /// <summary> |
| | | 56 | | /// An initialization method that performs custom operations like setting defaults |
| | | 57 | | /// </summary> |
| | | 58 | | partial void CustomInit(); |
| | | 59 | | |
| | | 60 | | /// <summary> |
| | | 61 | | /// Gets a region of the image that contains an entity. The values of |
| | | 62 | | /// the rectangle are relative to the width and height of the original |
| | | 63 | | /// image and are in the range 0.0 through 1.0. For example, if the |
| | | 64 | | /// image is 300x200 and the region's top, left corner is at point (10, |
| | | 65 | | /// 20) and the bottom, right corner is at point (290, 150), then the |
| | | 66 | | /// normalized rectangle is: Left = 0.0333333333333333, Top = 0.1, |
| | | 67 | | /// Right = 0.9666666666666667, Bottom = 0.75. For people, the region |
| | | 68 | | /// represents the person's face. |
| | | 69 | | /// </summary> |
| | | 70 | | [JsonProperty(PropertyName = "region")] |
| | 0 | 71 | | public NormalizedRectangle Region { get; private set; } |
| | | 72 | | |
| | | 73 | | /// <summary> |
| | | 74 | | /// Gets a list of entities that Bing believes match the entity found |
| | | 75 | | /// in the region. The entities are in descending order of confidence |
| | | 76 | | /// (see the matchConfidence field of RecognizedEntity). |
| | | 77 | | /// </summary> |
| | | 78 | | [JsonProperty(PropertyName = "matchingEntities")] |
| | 0 | 79 | | public IList<RecognizedEntity> MatchingEntities { get; private set; } |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// Validate the object. |
| | | 83 | | /// </summary> |
| | | 84 | | /// <exception cref="Rest.ValidationException"> |
| | | 85 | | /// Thrown if validation fails |
| | | 86 | | /// </exception> |
| | | 87 | | public virtual void Validate() |
| | | 88 | | { |
| | 0 | 89 | | if (Region != null) |
| | | 90 | | { |
| | 0 | 91 | | Region.Validate(); |
| | | 92 | | } |
| | 0 | 93 | | } |
| | | 94 | | } |
| | | 95 | | } |