/*
 * Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

import * as moment from "moment";


/**
 * @class
 * Initializes a new instance of the Entity class.
 * @constructor
 * Luis entity. Look at https://www.luis.ai/Help for more information.
 *
 * @member {string} [role] Role of the entity.
 * @member {string} [entity] Entity extracted by LUIS.
 * @member {string} type Type of the entity.
 * @member {number} [startIndex] Start index of the entity in the LUIS query
 * string.
 * @member {number} [endIndex] End index of the entity in the LUIS query
 * string.
 * @member {number} [score] Score assigned by LUIS to detected entity.
 * @member {object} [resolution] A machine interpretable resolution of the
 * entity.  For example the string "one thousand" would have the resolution
 * "1000".  The exact form of the resolution is defined by the entity type and
 * is documented here: https://www.luis.ai/Help#PreBuiltEntities.
 */
export interface Entity {
  role?: string;
  entity?: string;
  type: string;
  startIndex?: number;
  endIndex?: number;
  score?: number;
  resolution?: { [propertyName: string]: any };
}

/**
 * @class
 * Initializes a new instance of the ActionParameter class.
 * @constructor
 * @member {string} [name] Name of the parameter.
 * @member {boolean} [required] True if the parameter is required, false
 * otherwise.
 * @member {array} [value] Value of extracted entities for this parameter.
 */
export interface ActionParameter {
  name?: string;
  required?: boolean;
  value?: Entity[];
}

/**
 * @class
 * Initializes a new instance of the Action class.
 * @constructor
 * @member {boolean} [triggered] True if the Luis action is triggered, false
 * otherwise.
 * @member {string} [name] Name of the action.
 * @member {array} [parameters] The parameters for the action.
 */
export interface Action {
  triggered?: boolean;
  name?: string;
  parameters?: ActionParameter[];
}

/**
 * @class
 * Initializes a new instance of the Intent class.
 * @constructor
 * LUIS intent. Look at https://www.luis.ai/Help for more information.
 *
 * @member {string} [intent] The LUIS intent detected by LUIS service in
 * response to a query.
 * @member {number} [score] The score for the detected intent.
 * @member {array} [actions] The action associated with this Luis intent.
 */
export interface Intent {
  intent?: string;
  score?: number;
  actions?: Action[];
}

/**
 * @class
 * Initializes a new instance of the CompositeChild class.
 * @constructor
 * Child entity in Luis composite entity.
 *
 * @member {string} type Type of child entity.
 * @member {string} value Value extracted by Luis.
 */
export interface CompositeChild {
  type: string;
  value: string;
}

/**
 * @class
 * Initializes a new instance of the CompositeEntity class.
 * @constructor
 * Luis composite entity. Look at https://www.luis.ai/Help for more
 * information.
 *
 * @member {string} parentType Type of parent entity.
 * @member {string} value Value for entity extracted by LUIS.
 * @member {array} children
 */
export interface CompositeEntity {
  parentType: string;
  value: string;
  children: CompositeChild[];
}

/**
 * @class
 * Initializes a new instance of the DialogResponse class.
 * @constructor
 * The dialog response.
 *
 * @member {string} [prompt] Prompt that should be asked.
 * @member {string} [parameterName] Name of the parameter.
 * @member {string} [parameterType] Type of the parameter.
 * @member {string} [contextId] The context id for dialog.
 * @member {string} [status] The dialog status. Possible values include:
 * 'Question', 'Finished'
 */
export interface DialogResponse {
  prompt?: string;
  parameterName?: string;
  parameterType?: string;
  contextId?: string;
  status?: string;
}

/**
 * @class
 * Initializes a new instance of the LuisResult class.
 * @constructor
 * @member {string} query The query sent to LUIS.
 * @member {object} [topScoringIntent]
 * @member {string} [topScoringIntent.intent] The LUIS intent detected by LUIS
 * service in response to a query.
 * @member {number} [topScoringIntent.score] The score for the detected intent.
 * @member {array} [topScoringIntent.actions] The action associated with this
 * Luis intent.
 * @member {array} [intents] The intents found in the query text.
 * @member {array} entities The entities found in the query text.
 * @member {array} [compositeEntities] The composite entities found in the
 * utterance.
 * @member {object} [dialog]
 * @member {string} [dialog.prompt] Prompt that should be asked.
 * @member {string} [dialog.parameterName] Name of the parameter.
 * @member {string} [dialog.parameterType] Type of the parameter.
 * @member {string} [dialog.contextId] The context id for dialog.
 * @member {string} [dialog.status] The dialog status. Possible values include:
 * 'Question', 'Finished'
 * @member {string} [alteredQuery] The altered query used by LUIS to extract
 * intent and entities. For example, when Bing spell check is enabled for a
 * model, this field will contain the spell checked utterance.
 */
export interface LuisResult {
  query: string;
  topScoringIntent?: Intent;
  intents?: Intent[];
  entities: Entity[];
  compositeEntities?: CompositeEntity[];
  dialog?: DialogResponse;
  alteredQuery?: string;
}
