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

/**
 * Class representing a EntityRecord.
 */
class EntityRecord {
  /**
   * Create a EntityRecord.
   * @property {string} [name] Entity formal name.
   * @property {array} [matches] List of instances this entity appears in the
   * text.
   * @property {string} [wikipediaLanguage] Wikipedia language for which the
   * WikipediaId and WikipediaUrl refers to.
   * @property {string} [wikipediaId] Wikipedia unique identifier of the
   * recognized entity.
   * @property {string} [wikipediaUrl] URL for the entity's Wikipedia page.
   * @property {string} [bingId] Bing unique identifier of the recognized
   * entity. Use in conjunction with the Bing Entity Search API to fetch
   * additional relevant information.
   * @property {string} [type] Entity type from Named Entity Recognition model
   * @property {string} [subType] Entity sub type from Named Entity Recognition
   * model
   */
  constructor() {
  }

  /**
   * Defines the metadata of EntityRecord
   *
   * @returns {object} metadata of EntityRecord
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EntityRecord',
      type: {
        name: 'Composite',
        className: 'EntityRecord',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          matches: {
            required: false,
            serializedName: 'matches',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MatchRecordElementType',
                  type: {
                    name: 'Composite',
                    className: 'MatchRecord'
                  }
              }
            }
          },
          wikipediaLanguage: {
            required: false,
            serializedName: 'wikipediaLanguage',
            type: {
              name: 'String'
            }
          },
          wikipediaId: {
            required: false,
            serializedName: 'wikipediaId',
            type: {
              name: 'String'
            }
          },
          wikipediaUrl: {
            required: false,
            readOnly: true,
            serializedName: 'wikipediaUrl',
            type: {
              name: 'String'
            }
          },
          bingId: {
            required: false,
            serializedName: 'bingId',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          subType: {
            required: false,
            serializedName: 'subType',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = EntityRecord;
