/*
 * 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 the data and time of one or more geographic locations.
 *
 * @extends models['SearchResultsAnswer']
 */
class TimeZone extends models['SearchResultsAnswer'] {
  /**
   * Create a TimeZone.
   * @property {object} primaryCityTime The data and time, in UTC, of the
   * geographic location specified in the query. If the query specified a
   * specific geographic location (for example, a city), this object contains
   * the name of the geographic location and the current date and time of the
   * location, in UTC. If the query specified a general geographic location,
   * such as a state or country, this object contains the date and time of the
   * primary city or state found in the specified state or country. If the
   * location contains additional time zones, the otherCityTimes field contains
   * the data and time of cities or states located in the other time zones.
   * @property {string} [primaryCityTime.location] The name of the geographical
   * location.For example, County; City; City, State; City, State, Country; or
   * Time Zone.
   * @property {string} [primaryCityTime.time] The data and time specified in
   * the form, YYYY-MM-DDThh;mm:ss.ssssssZ.
   * @property {string} [primaryCityTime.utcOffset] The offset from UTC. For
   * example, UTC-7.
   * @property {array} [otherCityTimes] A list of dates and times of nearby
   * time zones.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of TimeZone
   *
   * @returns {object} metadata of TimeZone
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TimeZone',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: '_type',
          clientName: '_type'
        },
        uberParent: 'ResponseBase',
        className: 'TimeZone',
        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'
                  }
              }
            }
          },
          queryContext: {
            required: false,
            readOnly: true,
            serializedName: 'queryContext',
            type: {
              name: 'Composite',
              className: 'QueryContext'
            }
          },
          totalEstimatedMatches: {
            required: false,
            readOnly: true,
            serializedName: 'totalEstimatedMatches',
            type: {
              name: 'Number'
            }
          },
          isFamilyFriendly: {
            required: false,
            readOnly: true,
            serializedName: 'isFamilyFriendly',
            type: {
              name: 'Boolean'
            }
          },
          primaryCityTime: {
            required: true,
            serializedName: 'primaryCityTime',
            type: {
              name: 'Composite',
              className: 'TimeZoneTimeZoneInformation'
            }
          },
          otherCityTimes: {
            required: false,
            readOnly: true,
            serializedName: 'otherCityTimes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'TimeZoneTimeZoneInformationElementType',
                  type: {
                    name: 'Composite',
                    className: 'TimeZoneTimeZoneInformation'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = TimeZone;
