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

/**
 * A copy activity source for a Cassandra database.
 *
 * @extends models['CopySource']
 */
class CassandraSource extends models['CopySource'] {
  /**
   * Create a CassandraSource.
   * @member {object} [query] Database query. Should be a SQL-92 query
   * expression or Cassandra Query Language (CQL) command. Type: string (or
   * Expression with resultType string).
   * @member {string} [consistencyLevel] The consistency level specifies how
   * many Cassandra servers must respond to a read request before returning
   * data to the client application. Cassandra checks the specified number of
   * Cassandra servers for data to satisfy the read request. Must be one of
   * cassandraSourceReadConsistencyLevels. The default value is 'ONE'. It is
   * case-insensitive. Possible values include: 'ALL', 'EACH_QUORUM', 'QUORUM',
   * 'LOCAL_QUORUM', 'ONE', 'TWO', 'THREE', 'LOCAL_ONE', 'SERIAL',
   * 'LOCAL_SERIAL'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CassandraSource
   *
   * @returns {object} metadata of CassandraSource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CassandraSource',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'CopySource',
        className: 'CassandraSource',
        modelProperties: {
          sourceRetryCount: {
            required: false,
            serializedName: 'sourceRetryCount',
            type: {
              name: 'Object'
            }
          },
          sourceRetryWait: {
            required: false,
            serializedName: 'sourceRetryWait',
            type: {
              name: 'Object'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          query: {
            required: false,
            serializedName: 'query',
            type: {
              name: 'Object'
            }
          },
          consistencyLevel: {
            required: false,
            serializedName: 'consistencyLevel',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CassandraSource;
