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

/**
 * Defines a search result item to display
 *
 */
class RankingRankingItem {
  /**
   * Create a RankingRankingItem.
   * @property {string} answerType The answer that contains the item to
   * display. Use the type to find the answer in the SearchResponse object. The
   * type is the name of a SearchResponse field. Possible values include:
   * 'WebPages', 'Images', 'SpellSuggestions', 'News', 'RelatedSearches',
   * 'Videos', 'Computation', 'TimeZone'. Default value: 'WebPages' .
   * @property {number} [resultIndex] A zero-based index of the item in the
   * answer.If the item does not include this field, display all items in the
   * answer. For example, display all news articles in the News answer.
   * @property {object} [value] The ID that identifies either an answer to
   * display or an item of an answer to display. If the ID identifies an
   * answer, display all items of the answer.
   * @property {string} [value.id] A String identifier.
   * @property {number} [htmlIndex]
   * @property {number} [textualIndex]
   * @property {number} [screenshotIndex]
   */
  constructor() {
  }

  /**
   * Defines the metadata of RankingRankingItem
   *
   * @returns {object} metadata of RankingRankingItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Ranking/RankingItem',
      type: {
        name: 'Composite',
        className: 'RankingRankingItem',
        modelProperties: {
          answerType: {
            required: true,
            serializedName: 'answerType',
            defaultValue: 'WebPages',
            type: {
              name: 'String'
            }
          },
          resultIndex: {
            required: false,
            readOnly: true,
            serializedName: 'resultIndex',
            type: {
              name: 'Number'
            }
          },
          value: {
            required: false,
            readOnly: true,
            serializedName: 'value',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'Identifiable'
            }
          },
          htmlIndex: {
            required: false,
            readOnly: true,
            serializedName: 'htmlIndex',
            type: {
              name: 'Number'
            }
          },
          textualIndex: {
            required: false,
            readOnly: true,
            serializedName: 'textualIndex',
            type: {
              name: 'Number'
            }
          },
          screenshotIndex: {
            required: false,
            readOnly: true,
            serializedName: 'screenshotIndex',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = RankingRankingItem;
