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

/**
 * The Analytics query. Learn more about the [Analytics query
 * syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)
 *
 */
class QueryBody {
  /**
   * Create a QueryBody.
   * @member {string} query The query to execute.
   * @member {string} [timespan] Optional. The timespan over which to query
   * data. This is an ISO8601 time period value.  This timespan is applied in
   * addition to any that are specified in the query expression.
   * @member {array} [applications] A list of Application IDs for
   * cross-application queries.
   */
  constructor() {
  }

  /**
   * Defines the metadata of QueryBody
   *
   * @returns {object} metadata of QueryBody
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'queryBody',
      type: {
        name: 'Composite',
        className: 'QueryBody',
        modelProperties: {
          query: {
            required: true,
            serializedName: 'query',
            type: {
              name: 'String'
            }
          },
          timespan: {
            required: false,
            serializedName: 'timespan',
            type: {
              name: 'String'
            }
          },
          applications: {
            required: false,
            serializedName: 'applications',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = QueryBody;
