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

const models = require('./index');

/**
 * Class representing a SearchResultsAnswer.
 * @extends models['Answer']
 */
class SearchResultsAnswer extends models['Answer'] {
  /**
   * Create a SearchResultsAnswer.
   * @member {number} [totalEstimatedMatches] The estimated number of webpages
   * that are relevant to the query. Use this number along with the count and
   * offset query parameters to page the results.
   * @member {boolean} [isFamilyFriendly]
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SearchResultsAnswer
   *
   * @returns {object} metadata of SearchResultsAnswer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SearchResultsAnswer',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: '_type',
          clientName: '_type'
        },
        uberParent: 'ResponseBase',
        className: 'SearchResultsAnswer',
        modelProperties: {
          _type: {
            required: true,
            serializedName: '_type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          webSearchUrl: {
            required: false,
            readOnly: true,
            serializedName: 'webSearchUrl',
            type: {
              name: 'String'
            }
          },
          followUpQueries: {
            required: false,
            readOnly: true,
            serializedName: 'followUpQueries',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'QueryElementType',
                  type: {
                    name: 'Composite',
                    className: 'Query'
                  }
              }
            }
          },
          totalEstimatedMatches: {
            required: false,
            readOnly: true,
            serializedName: 'totalEstimatedMatches',
            type: {
              name: 'Number'
            }
          },
          isFamilyFriendly: {
            required: false,
            readOnly: true,
            serializedName: 'isFamilyFriendly',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = SearchResultsAnswer;
