/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * A JSON object that identities the image to get insights of . It also
 * includes the optional crop area that you use to identify the region of
 * interest in the image.
 *
 */
class ImageInfo {
  /**
   * Create a ImageInfo.
   * @property {string} [imageInsightsToken] An image insights token. To get
   * the insights token, call one of the Image Search APIs (for example,
   * /images/search). In the search results, the
   * [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image)
   * object's
   * [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image-imageinsightstoken)
   * field contains the token. The imageInsightsToken and url fields mutually
   * exclusive; do not specify both. Do not specify an insights token if the
   * request includes the image form data.
   * @property {string} [url] The URL of the input image. The
   * imageInsightsToken and url fields are mutually exclusive; do not specify
   * both. Do not specify the URL if the request includes the image form data.
   * @property {object} [cropArea] A JSON object consisting of coordinates
   * specifying the four corners of a cropped rectangle within the input image.
   * Use the crop area to identify the region of interest in the image. You can
   * apply the crop area to the images specified using the imageInsightsToken
   * or url fields, or an image binary specified in an image form data.
   * @property {number} [cropArea.top] The top coordinate of the region to be
   * cropped. The coordinate is a fractional value of the original image's
   * height and is measured from the top edge of the image. Specify the
   * coordinate as a value from 0.0 through 1.0.
   * @property {number} [cropArea.bottom] The bottom coordinate of the region
   * to be cropped. The coordinate is a fractional value of the original
   * image's height and is measured from the top edge of the image. Specify the
   * coordinate as a value from 0.0 through 1.0.
   * @property {number} [cropArea.left] The left coordinate of the region to be
   * cropped. The coordinate is a fractional value of the original image's
   * width and is measured from the left edge of the image. Specify the
   * coordinate as a value from 0.0 through 1.0.
   * @property {number} [cropArea.right] The right coordinate of the region to
   * be cropped. The coordinate is a fractional value of the original image's
   * width and is measured from the left edge of the image. Specify the
   * coordinate as a value from 0.0 through 1.0.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ImageInfo
   *
   * @returns {object} metadata of ImageInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ImageInfo',
      type: {
        name: 'Composite',
        className: 'ImageInfo',
        modelProperties: {
          imageInsightsToken: {
            required: false,
            serializedName: 'imageInsightsToken',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            serializedName: 'url',
            type: {
              name: 'String'
            }
          },
          cropArea: {
            required: false,
            serializedName: 'cropArea',
            type: {
              name: 'Composite',
              className: 'CropArea'
            }
          }
        }
      }
    };
  }
}

module.exports = ImageInfo;
