| | 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.Linq; |
| | 11 | |
|
| | 12 | | /// <summary> |
| | 13 | | /// The top-level object that the response includes when an image insights |
| | 14 | | /// request succeeds. For information about requesting image insights, see |
| | 15 | | /// the |
| | 16 | | /// [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insight |
| | 17 | | /// query parameter. The modules query parameter affects the fields that |
| | 18 | | /// Bing includes in the response. If you set |
| | 19 | | /// [modules](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#modulesreques |
| | 20 | | /// to only Caption, then this object includes only the imageCaption field. |
| | 21 | | /// </summary> |
| | 22 | | public partial class ImageInsights : Response |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Initializes a new instance of the ImageInsights class. |
| | 26 | | /// </summary> |
| 2 | 27 | | public ImageInsights() |
| | 28 | | { |
| | 29 | | CustomInit(); |
| 2 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the ImageInsights class. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="id">A String identifier.</param> |
| | 36 | | /// <param name="readLink">The URL that returns this resource.</param> |
| | 37 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 38 | | /// item.</param> |
| | 39 | | /// <param name="imageInsightsToken">A token that you use in a |
| | 40 | | /// subsequent call to the Image Search API to get more information |
| | 41 | | /// about the image. For information about using this token, see the |
| | 42 | | /// insightsToken query parameter. This token has the same usage as the |
| | 43 | | /// token in the Image object.</param> |
| | 44 | | /// <param name="bestRepresentativeQuery">The query term that best |
| | 45 | | /// represents the image. Clicking the link in the Query object, takes |
| | 46 | | /// the user to a webpage with more pictures of the image.</param> |
| | 47 | | /// <param name="imageCaption">The caption to use for the |
| | 48 | | /// image.</param> |
| | 49 | | /// <param name="relatedCollections">A list of links to webpages that |
| | 50 | | /// contain related images.</param> |
| | 51 | | /// <param name="pagesIncluding">A list of webpages that contain the |
| | 52 | | /// image. To access the webpage, use the URL in the image's |
| | 53 | | /// hostPageUrl field.</param> |
| | 54 | | /// <param name="shoppingSources">A list of merchants that offer items |
| | 55 | | /// related to the image. For example, if the image is of an apple pie, |
| | 56 | | /// the list contains merchants that are selling apple pies.</param> |
| | 57 | | /// <param name="relatedSearches">A list of related queries made by |
| | 58 | | /// others.</param> |
| | 59 | | /// <param name="recipes">A list of recipes related to the image. For |
| | 60 | | /// example, if the image is of an apple pie, the list contains recipes |
| | 61 | | /// for making an apple pie.</param> |
| | 62 | | /// <param name="visuallySimilarImages">A list of images that are |
| | 63 | | /// visually similar to the original image. For example, if the |
| | 64 | | /// specified image is of a sunset over a body of water, the list of |
| | 65 | | /// similar images are of a sunset over a body of water. If the |
| | 66 | | /// specified image is of a person, similar images might be of the same |
| | 67 | | /// person or they might be of persons dressed similarly or in a |
| | 68 | | /// similar setting. The criteria for similarity continues to |
| | 69 | | /// evolve.</param> |
| | 70 | | /// <param name="visuallySimilarProducts">A list of images that contain |
| | 71 | | /// products that are visually similar to products found in the |
| | 72 | | /// original image. For example, if the specified image contains a |
| | 73 | | /// dress, the list of similar images contain a dress. The image |
| | 74 | | /// provides summary information about offers that Bing found online |
| | 75 | | /// for the product.</param> |
| | 76 | | /// <param name="recognizedEntityGroups">A list of groups that contain |
| | 77 | | /// images of entities that match the entity found in the specified |
| | 78 | | /// image. For example, the response might include images from the |
| | 79 | | /// general celebrity group if the entity was recognized in that |
| | 80 | | /// group.</param> |
| | 81 | | /// <param name="imageTags">A list of characteristics of the content |
| | 82 | | /// found in the image. For example, if the image is of a person, the |
| | 83 | | /// tags might indicate the person's gender and the type of clothes |
| | 84 | | /// they're wearing.</param> |
| | 85 | | public ImageInsights(string id = default(string), string readLink = default(string), string webSearchUrl = defau |
| 0 | 86 | | : base(id, readLink, webSearchUrl) |
| | 87 | | { |
| 0 | 88 | | ImageInsightsToken = imageInsightsToken; |
| 0 | 89 | | BestRepresentativeQuery = bestRepresentativeQuery; |
| 0 | 90 | | ImageCaption = imageCaption; |
| 0 | 91 | | RelatedCollections = relatedCollections; |
| 0 | 92 | | PagesIncluding = pagesIncluding; |
| 0 | 93 | | ShoppingSources = shoppingSources; |
| 0 | 94 | | RelatedSearches = relatedSearches; |
| 0 | 95 | | Recipes = recipes; |
| 0 | 96 | | VisuallySimilarImages = visuallySimilarImages; |
| 0 | 97 | | VisuallySimilarProducts = visuallySimilarProducts; |
| 0 | 98 | | RecognizedEntityGroups = recognizedEntityGroups; |
| 0 | 99 | | ImageTags = imageTags; |
| | 100 | | CustomInit(); |
| 0 | 101 | | } |
| | 102 | |
|
| | 103 | | /// <summary> |
| | 104 | | /// An initialization method that performs custom operations like setting defaults |
| | 105 | | /// </summary> |
| | 106 | | partial void CustomInit(); |
| | 107 | |
|
| | 108 | | /// <summary> |
| | 109 | | /// Gets a token that you use in a subsequent call to the Image Search |
| | 110 | | /// API to get more information about the image. For information about |
| | 111 | | /// using this token, see the insightsToken query parameter. This token |
| | 112 | | /// has the same usage as the token in the Image object. |
| | 113 | | /// </summary> |
| | 114 | | [JsonProperty(PropertyName = "imageInsightsToken")] |
| 0 | 115 | | public string ImageInsightsToken { get; private set; } |
| | 116 | |
|
| | 117 | | /// <summary> |
| | 118 | | /// Gets the query term that best represents the image. Clicking the |
| | 119 | | /// link in the Query object, takes the user to a webpage with more |
| | 120 | | /// pictures of the image. |
| | 121 | | /// </summary> |
| | 122 | | [JsonProperty(PropertyName = "bestRepresentativeQuery")] |
| 4 | 123 | | public Query BestRepresentativeQuery { get; private set; } |
| | 124 | |
|
| | 125 | | /// <summary> |
| | 126 | | /// Gets the caption to use for the image. |
| | 127 | | /// </summary> |
| | 128 | | [JsonProperty(PropertyName = "imageCaption")] |
| 4 | 129 | | public ImageInsightsImageCaption ImageCaption { get; private set; } |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// Gets a list of links to webpages that contain related images. |
| | 133 | | /// </summary> |
| | 134 | | [JsonProperty(PropertyName = "relatedCollections")] |
| 0 | 135 | | public RelatedCollectionsModule RelatedCollections { get; private set; } |
| | 136 | |
|
| | 137 | | /// <summary> |
| | 138 | | /// Gets a list of webpages that contain the image. To access the |
| | 139 | | /// webpage, use the URL in the image's hostPageUrl field. |
| | 140 | | /// </summary> |
| | 141 | | [JsonProperty(PropertyName = "pagesIncluding")] |
| 8 | 142 | | public ImagesModule PagesIncluding { get; private set; } |
| | 143 | |
|
| | 144 | | /// <summary> |
| | 145 | | /// Gets a list of merchants that offer items related to the image. For |
| | 146 | | /// example, if the image is of an apple pie, the list contains |
| | 147 | | /// merchants that are selling apple pies. |
| | 148 | | /// </summary> |
| | 149 | | [JsonProperty(PropertyName = "shoppingSources")] |
| 0 | 150 | | public AggregateOffer ShoppingSources { get; private set; } |
| | 151 | |
|
| | 152 | | /// <summary> |
| | 153 | | /// Gets a list of related queries made by others. |
| | 154 | | /// </summary> |
| | 155 | | [JsonProperty(PropertyName = "relatedSearches")] |
| 8 | 156 | | public RelatedSearchesModule RelatedSearches { get; private set; } |
| | 157 | |
|
| | 158 | | /// <summary> |
| | 159 | | /// Gets a list of recipes related to the image. For example, if the |
| | 160 | | /// image is of an apple pie, the list contains recipes for making an |
| | 161 | | /// apple pie. |
| | 162 | | /// </summary> |
| | 163 | | [JsonProperty(PropertyName = "recipes")] |
| 0 | 164 | | public RecipesModule Recipes { get; private set; } |
| | 165 | |
|
| | 166 | | /// <summary> |
| | 167 | | /// Gets a list of images that are visually similar to the original |
| | 168 | | /// image. For example, if the specified image is of a sunset over a |
| | 169 | | /// body of water, the list of similar images are of a sunset over a |
| | 170 | | /// body of water. If the specified image is of a person, similar |
| | 171 | | /// images might be of the same person or they might be of persons |
| | 172 | | /// dressed similarly or in a similar setting. The criteria for |
| | 173 | | /// similarity continues to evolve. |
| | 174 | | /// </summary> |
| | 175 | | [JsonProperty(PropertyName = "visuallySimilarImages")] |
| 8 | 176 | | public ImagesModule VisuallySimilarImages { get; private set; } |
| | 177 | |
|
| | 178 | | /// <summary> |
| | 179 | | /// Gets a list of images that contain products that are visually |
| | 180 | | /// similar to products found in the original image. For example, if |
| | 181 | | /// the specified image contains a dress, the list of similar images |
| | 182 | | /// contain a dress. The image provides summary information about |
| | 183 | | /// offers that Bing found online for the product. |
| | 184 | | /// </summary> |
| | 185 | | [JsonProperty(PropertyName = "visuallySimilarProducts")] |
| 0 | 186 | | public ImagesModule VisuallySimilarProducts { get; private set; } |
| | 187 | |
|
| | 188 | | /// <summary> |
| | 189 | | /// Gets a list of groups that contain images of entities that match |
| | 190 | | /// the entity found in the specified image. For example, the response |
| | 191 | | /// might include images from the general celebrity group if the entity |
| | 192 | | /// was recognized in that group. |
| | 193 | | /// </summary> |
| | 194 | | [JsonProperty(PropertyName = "recognizedEntityGroups")] |
| 0 | 195 | | public RecognizedEntitiesModule RecognizedEntityGroups { get; private set; } |
| | 196 | |
|
| | 197 | | /// <summary> |
| | 198 | | /// Gets a list of characteristics of the content found in the image. |
| | 199 | | /// For example, if the image is of a person, the tags might indicate |
| | 200 | | /// the person's gender and the type of clothes they're wearing. |
| | 201 | | /// </summary> |
| | 202 | | [JsonProperty(PropertyName = "imageTags")] |
| 0 | 203 | | public ImageTagsModule ImageTags { get; private set; } |
| | 204 | |
|
| | 205 | | /// <summary> |
| | 206 | | /// Validate the object. |
| | 207 | | /// </summary> |
| | 208 | | /// <exception cref="Rest.ValidationException"> |
| | 209 | | /// Thrown if validation fails |
| | 210 | | /// </exception> |
| | 211 | | public virtual void Validate() |
| | 212 | | { |
| 0 | 213 | | if (BestRepresentativeQuery != null) |
| | 214 | | { |
| 0 | 215 | | BestRepresentativeQuery.Validate(); |
| | 216 | | } |
| 0 | 217 | | if (ImageCaption != null) |
| | 218 | | { |
| 0 | 219 | | ImageCaption.Validate(); |
| | 220 | | } |
| 0 | 221 | | if (ImageTags != null) |
| | 222 | | { |
| 0 | 223 | | ImageTags.Validate(); |
| | 224 | | } |
| 0 | 225 | | } |
| | 226 | | } |
| | 227 | | } |