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

/**
 * Describes an Azure Table output data source.
 *
 * @extends models['OutputDataSource']
 */
class AzureTableOutputDataSource extends models['OutputDataSource'] {
  /**
   * Create a AzureTableOutputDataSource.
   * @member {string} [accountName] The name of the Azure Storage account.
   * Required on PUT (CreateOrReplace) requests.
   * @member {string} [accountKey] The account key for the Azure Storage
   * account. Required on PUT (CreateOrReplace) requests.
   * @member {string} [table] The name of the Azure Table. Required on PUT
   * (CreateOrReplace) requests.
   * @member {string} [partitionKey] This element indicates the name of a
   * column from the SELECT statement in the query that will be used as the
   * partition key for the Azure Table. Required on PUT (CreateOrReplace)
   * requests.
   * @member {string} [rowKey] This element indicates the name of a column from
   * the SELECT statement in the query that will be used as the row key for the
   * Azure Table. Required on PUT (CreateOrReplace) requests.
   * @member {array} [columnsToRemove] If specified, each item in the array is
   * the name of a column to remove (if present) from output event entities.
   * @member {number} [batchSize] The number of rows to write to the Azure
   * Table at a time.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AzureTableOutputDataSource
   *
   * @returns {object} metadata of AzureTableOutputDataSource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Microsoft.Storage/Table',
      type: {
        name: 'Composite',
        className: 'AzureTableOutputDataSource',
        modelProperties: {
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          accountName: {
            required: false,
            serializedName: 'properties.accountName',
            type: {
              name: 'String'
            }
          },
          accountKey: {
            required: false,
            serializedName: 'properties.accountKey',
            type: {
              name: 'String'
            }
          },
          table: {
            required: false,
            serializedName: 'properties.table',
            type: {
              name: 'String'
            }
          },
          partitionKey: {
            required: false,
            serializedName: 'properties.partitionKey',
            type: {
              name: 'String'
            }
          },
          rowKey: {
            required: false,
            serializedName: 'properties.rowKey',
            type: {
              name: 'String'
            }
          },
          columnsToRemove: {
            required: false,
            serializedName: 'properties.columnsToRemove',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          batchSize: {
            required: false,
            serializedName: 'properties.batchSize',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = AzureTableOutputDataSource;
