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

/**
 * Defines a response. All schemas that could be returned at the root of a
 * response should inherit from this
 *
 * @extends models['Identifiable']
 */
class Response extends models['Identifiable'] {
  /**
   * Create a Response.
   * @property {array} [contractualRules] A list of rules that you must adhere
   * to if you display the item.
   * @property {string} [webSearchUrl] The URL To Bing's search result for this
   * item.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Response
   *
   * @returns {object} metadata of Response
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Response',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: '_type',
          clientName: '_type'
        },
        uberParent: 'ResponseBase',
        className: 'Response',
        modelProperties: {
          _type: {
            required: true,
            serializedName: '_type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          contractualRules: {
            required: false,
            readOnly: true,
            serializedName: 'contractualRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ContractualRulesContractualRuleElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ContractualRulesContractualRule',
                    className: 'ContractualRulesContractualRule'
                  }
              }
            }
          },
          webSearchUrl: {
            required: false,
            readOnly: true,
            serializedName: 'webSearchUrl',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Response;
