/*
 * 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';

/**
 * An object detected in an image.
 *
 */
class DetectedObject {
  /**
   * Create a DetectedObject.
   * @property {object} [rectangle] Approximate location of the detected
   * object.
   * @property {number} [rectangle.x] X-coordinate of the top left point of the
   * area, in pixels.
   * @property {number} [rectangle.y] Y-coordinate of the top left point of the
   * area, in pixels.
   * @property {number} [rectangle.w] Width measured from the top-left point of
   * the area, in pixels.
   * @property {number} [rectangle.h] Height measured from the top-left point
   * of the area, in pixels.
   * @property {string} [object] Label for the object.
   * @property {number} [confidence] Confidence score of having observed the
   * object in the image, as a value ranging from 0 to 1.
   * @property {object} [parent] The parent object, from a taxonomy
   * perspective.
   * The parent object is a more generic form of this object.  For example, a
   * 'bulldog' would have a parent of 'dog'.
   * @property {string} [parent.object] Label for the object.
   * @property {number} [parent.confidence] Confidence score of having observed
   * the object in the image, as a value ranging from 0 to 1.
   * @property {object} [parent.parent] The parent object, from a taxonomy
   * perspective.
   * The parent object is a more generic form of this object.  For example, a
   * 'bulldog' would have a parent of 'dog'.
   */
  constructor() {
  }

  /**
   * Defines the metadata of DetectedObject
   *
   * @returns {object} metadata of DetectedObject
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DetectedObject',
      type: {
        name: 'Composite',
        className: 'DetectedObject',
        modelProperties: {
          rectangle: {
            required: false,
            readOnly: true,
            serializedName: 'rectangle',
            type: {
              name: 'Composite',
              className: 'BoundingRect'
            }
          },
          object: {
            required: false,
            nullable: true,
            serializedName: 'object',
            type: {
              name: 'String'
            }
          },
          confidence: {
            required: false,
            nullable: false,
            serializedName: 'confidence',
            type: {
              name: 'Number'
            }
          },
          parent: {
            required: false,
            serializedName: 'parent',
            type: {
              name: 'Composite',
              className: 'ObjectHierarchy'
            }
          }
        }
      }
    };
  }
}

module.exports = DetectedObject;
