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

/**
 * Represents an intent prediction.
 *
 */
class Intent {
  /**
   * Create a Intent.
   * @property {number} [score] The score of the fired intent.
   * @property {object} [childApp] The prediction of the dispatched
   * application.
   * @property {string} [childApp.normalizedQuery] The query after
   * pre-processing and normalization.
   * @property {string} [childApp.alteredQuery] The query after spell checking.
   * Only set if spell check was enabled and a spelling mistake was found.
   * @property {string} [childApp.topIntent] The name of the top scoring
   * intent.
   * @property {object} [childApp.intents] A dictionary representing the
   * intents that fired.
   * @property {object} [childApp.entities] The dictionary representing the
   * entities that fired.
   * @property {object} [childApp.sentiment] The result of the sentiment
   * analysis.
   * @property {number} [childApp.sentiment.score] The sentiment score of the
   * query.
   * @property {string} [childApp.sentiment.label] The label of the sentiment
   * analysis result.
   */
  constructor() {
  }

  /**
   * Defines the metadata of Intent
   *
   * @returns {object} metadata of Intent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Intent',
      type: {
        name: 'Composite',
        className: 'Intent',
        modelProperties: {
          score: {
            required: false,
            serializedName: 'score',
            type: {
              name: 'Number'
            }
          },
          childApp: {
            required: false,
            serializedName: 'childApp',
            type: {
              name: 'Composite',
              className: 'Prediction'
            }
          }
        }
      }
    };
  }
}

module.exports = Intent;
