| | 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.VisualSearch.Models |
| | 8 | | { |
| | 9 | | using Newtonsoft.Json; |
| | 10 | | using System.Linq; |
| | 11 | |
|
| | 12 | | /// <summary> |
| | 13 | | /// A JSON object that identities the image to get insights of . It also |
| | 14 | | /// includes the optional crop area that you use to identify the region of |
| | 15 | | /// interest in the image. |
| | 16 | | /// </summary> |
| | 17 | | public partial class ImageInfo |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// Initializes a new instance of the ImageInfo class. |
| | 21 | | /// </summary> |
| 0 | 22 | | public ImageInfo() |
| | 23 | | { |
| | 24 | | CustomInit(); |
| 0 | 25 | | } |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// Initializes a new instance of the ImageInfo class. |
| | 29 | | /// </summary> |
| | 30 | | /// <param name="imageInsightsToken">An image insights token. To get |
| | 31 | | /// the insights token, call one of the Image Search APIs (for example, |
| | 32 | | /// /images/search). In the search results, the |
| | 33 | | /// [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) |
| | 34 | | /// object's |
| | 35 | | /// [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-referenc |
| | 36 | | /// field contains the token. The imageInsightsToken and url fields |
| | 37 | | /// mutually exclusive; do not specify both. Do not specify an insights |
| | 38 | | /// token if the request includes the image form data.</param> |
| | 39 | | /// <param name="url">The URL of the input image. The |
| | 40 | | /// imageInsightsToken and url fields are mutually exclusive; do not |
| | 41 | | /// specify both. Do not specify the URL if the request includes the |
| | 42 | | /// image form data.</param> |
| | 43 | | /// <param name="cropArea">A JSON object consisting of coordinates |
| | 44 | | /// specifying the four corners of a cropped rectangle within the input |
| | 45 | | /// image. Use the crop area to identify the region of interest in the |
| | 46 | | /// image. You can apply the crop area to the images specified using |
| | 47 | | /// the imageInsightsToken or url fields, or an image binary specified |
| | 48 | | /// in an image form data.</param> |
| 6 | 49 | | public ImageInfo(string imageInsightsToken = default(string), string url = default(string), CropArea cropArea = |
| | 50 | | { |
| 6 | 51 | | ImageInsightsToken = imageInsightsToken; |
| 6 | 52 | | Url = url; |
| 6 | 53 | | CropArea = cropArea; |
| | 54 | | CustomInit(); |
| 6 | 55 | | } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// An initialization method that performs custom operations like setting defaults |
| | 59 | | /// </summary> |
| | 60 | | partial void CustomInit(); |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Gets or sets an image insights token. To get the insights token, |
| | 64 | | /// call one of the Image Search APIs (for example, /images/search). In |
| | 65 | | /// the search results, the |
| | 66 | | /// [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) |
| | 67 | | /// object's |
| | 68 | | /// [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-referenc |
| | 69 | | /// field contains the token. The imageInsightsToken and url fields |
| | 70 | | /// mutually exclusive; do not specify both. Do not specify an insights |
| | 71 | | /// token if the request includes the image form data. |
| | 72 | | /// </summary> |
| | 73 | | [JsonProperty(PropertyName = "imageInsightsToken")] |
| 12 | 74 | | public string ImageInsightsToken { get; set; } |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Gets or sets the URL of the input image. The imageInsightsToken and |
| | 78 | | /// url fields are mutually exclusive; do not specify both. Do not |
| | 79 | | /// specify the URL if the request includes the image form data. |
| | 80 | | /// </summary> |
| | 81 | | [JsonProperty(PropertyName = "url")] |
| 12 | 82 | | public string Url { get; set; } |
| | 83 | |
|
| | 84 | | /// <summary> |
| | 85 | | /// Gets or sets a JSON object consisting of coordinates specifying the |
| | 86 | | /// four corners of a cropped rectangle within the input image. Use the |
| | 87 | | /// crop area to identify the region of interest in the image. You can |
| | 88 | | /// apply the crop area to the images specified using the |
| | 89 | | /// imageInsightsToken or url fields, or an image binary specified in |
| | 90 | | /// an image form data. |
| | 91 | | /// </summary> |
| | 92 | | [JsonProperty(PropertyName = "cropArea")] |
| 12 | 93 | | public CropArea CropArea { get; set; } |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Validate the object. |
| | 97 | | /// </summary> |
| | 98 | | /// <exception cref="Rest.ValidationException"> |
| | 99 | | /// Thrown if validation fails |
| | 100 | | /// </exception> |
| | 101 | | public virtual void Validate() |
| | 102 | | { |
| 0 | 103 | | if (CropArea != null) |
| | 104 | | { |
| 0 | 105 | | CropArea.Validate(); |
| | 106 | | } |
| 0 | 107 | | } |
| | 108 | | } |
| | 109 | | } |