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

/**
 * Properties to configure capture description for eventhub
 *
 */
class CaptureDescription {
  /**
   * Create a CaptureDescription.
   * @property {boolean} [enabled] A value that indicates whether capture
   * description is enabled.
   * @property {string} [encoding] Enumerates the possible values for the
   * encoding format of capture description. Note: 'AvroDeflate' will be
   * deprecated in New API Version. Possible values include: 'Avro',
   * 'AvroDeflate'
   * @property {number} [intervalInSeconds] The time window allows you to set
   * the frequency with which the capture to Azure Blobs will happen, value
   * should between 60 to 900 seconds
   * @property {number} [sizeLimitInBytes] The size window defines the amount
   * of data built up in your Event Hub before an capture operation, value
   * should be between 10485760 to 524288000 bytes
   * @property {object} [destination] Properties of Destination where capture
   * will be stored. (Storage Account, Blob Names)
   * @property {string} [destination.name] Name for capture destination
   * @property {string} [destination.storageAccountResourceId] Resource id of
   * the storage account to be used to create the blobs
   * @property {string} [destination.blobContainer] Blob container Name
   * @property {string} [destination.archiveNameFormat] Blob naming convention
   * for archive, e.g.
   * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}.
   * Here all the parameters (Namespace,EventHub .. etc) are mandatory
   * irrespective of order
   * @property {boolean} [skipEmptyArchives] A value that indicates whether to
   * Skip Empty Archives
   */
  constructor() {
  }

  /**
   * Defines the metadata of CaptureDescription
   *
   * @returns {object} metadata of CaptureDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CaptureDescription',
      type: {
        name: 'Composite',
        className: 'CaptureDescription',
        modelProperties: {
          enabled: {
            required: false,
            serializedName: 'enabled',
            type: {
              name: 'Boolean'
            }
          },
          encoding: {
            required: false,
            serializedName: 'encoding',
            type: {
              name: 'Enum',
              allowedValues: [ 'Avro', 'AvroDeflate' ]
            }
          },
          intervalInSeconds: {
            required: false,
            serializedName: 'intervalInSeconds',
            constraints: {
              InclusiveMaximum: 900,
              InclusiveMinimum: 60
            },
            type: {
              name: 'Number'
            }
          },
          sizeLimitInBytes: {
            required: false,
            serializedName: 'sizeLimitInBytes',
            constraints: {
              InclusiveMaximum: 524288000,
              InclusiveMinimum: 10485760
            },
            type: {
              name: 'Number'
            }
          },
          destination: {
            required: false,
            serializedName: 'destination',
            type: {
              name: 'Composite',
              className: 'Destination'
            }
          },
          skipEmptyArchives: {
            required: false,
            serializedName: 'skipEmptyArchives',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = CaptureDescription;
