/*
 * 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 consisting of coordinates specifying the four corners of a
 * cropped rectangle within the input image.
 *
 */
class CropArea {
  /**
   * Create a CropArea.
   * @property {number} 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} 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} 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} 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 CropArea
   *
   * @returns {object} metadata of CropArea
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CropArea',
      type: {
        name: 'Composite',
        className: 'CropArea',
        modelProperties: {
          top: {
            required: true,
            serializedName: 'top',
            type: {
              name: 'Number'
            }
          },
          bottom: {
            required: true,
            serializedName: 'bottom',
            type: {
              name: 'Number'
            }
          },
          left: {
            required: true,
            serializedName: 'left',
            type: {
              name: 'Number'
            }
          },
          right: {
            required: true,
            serializedName: 'right',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = CropArea;
