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

/**
 * Specifies the log search query.
 *
 */
class Source {
  /**
   * Create a Source.
   * @property {string} [query] Log search query. Required for action type -
   * AlertingAction
   * @property {array} [authorizedResources] List of  Resource referred into
   * query
   * @property {string} dataSourceId The resource uri over which log search
   * query is to be run.
   * @property {string} [queryType] Set value to 'ResultCount'. Possible values
   * include: 'ResultCount'
   */
  constructor() {
  }

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

module.exports = Source;
