/*
 * 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 merchant's offer.
 *
 * @extends models['Thing']
 */
class Offer extends models['Thing'] {
  /**
   * Create a Offer.
   * @property {object} [seller] Seller for this offer.
   * @property {number} [price] The item's price.
   * @property {string} [priceCurrency] The monetary currency. For example,
   * USD. Possible values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY',
   * 'CNY', 'AUD', 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS',
   * 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND',
   * 'BOB', 'BOV', 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE',
   * 'CHF', 'CHW', 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK',
   * 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL',
   * 'GHS', 'GIP', 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG',
   * 'HUF', 'IDR', 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS',
   * 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR',
   * 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP',
   * 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN',
   * 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR',
   * 'PLN', 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR',
   * 'SDG', 'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP',
   * 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS',
   * 'UAH', 'UGX', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD',
   * 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW'. Default value: 'USD' .
   * @property {string} [availability] The item's availability. The following
   * are the possible values: Discontinued, InStock, InStoreOnly,
   * LimitedAvailability, OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible
   * values include: 'Discontinued', 'InStock', 'InStoreOnly',
   * 'LimitedAvailability', 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut'
   * @property {object} [aggregateRating] An aggregated rating that indicates
   * how well the product has been rated by others.
   * @property {number} [aggregateRating.reviewCount] The number of times the
   * recipe has been rated or reviewed.
   * @property {string} [lastUpdated] The last date that the offer was updated.
   * The date is in the form YYYY-MM-DD.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Offer
   *
   * @returns {object} metadata of Offer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Offer',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: '_type',
          clientName: '_type'
        },
        uberParent: 'ResponseBase',
        className: 'Offer',
        modelProperties: {
          _type: {
            required: true,
            serializedName: '_type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          readLink: {
            required: false,
            readOnly: true,
            serializedName: 'readLink',
            type: {
              name: 'String'
            }
          },
          webSearchUrl: {
            required: false,
            readOnly: true,
            serializedName: 'webSearchUrl',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            readOnly: true,
            serializedName: 'url',
            type: {
              name: 'String'
            }
          },
          image: {
            required: false,
            readOnly: true,
            serializedName: 'image',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'ImageObject'
            }
          },
          description: {
            required: false,
            readOnly: true,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          alternateName: {
            required: false,
            readOnly: true,
            serializedName: 'alternateName',
            type: {
              name: 'String'
            }
          },
          bingId: {
            required: false,
            readOnly: true,
            serializedName: 'bingId',
            type: {
              name: 'String'
            }
          },
          seller: {
            required: false,
            readOnly: true,
            serializedName: 'seller',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'Organization'
            }
          },
          price: {
            required: false,
            readOnly: true,
            serializedName: 'price',
            type: {
              name: 'Number'
            }
          },
          priceCurrency: {
            required: false,
            readOnly: true,
            serializedName: 'priceCurrency',
            defaultValue: 'USD',
            type: {
              name: 'String'
            }
          },
          availability: {
            required: false,
            readOnly: true,
            serializedName: 'availability',
            type: {
              name: 'String'
            }
          },
          aggregateRating: {
            required: false,
            readOnly: true,
            serializedName: 'aggregateRating',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'PropertiesItem',
              className: 'AggregateRating'
            }
          },
          lastUpdated: {
            required: false,
            readOnly: true,
            serializedName: 'lastUpdated',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Offer;
