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

/**
 * Single item in List or Get Event Hub operation
 *
 * @extends models['Resource']
 */
class Eventhub extends models['Resource'] {
  /**
   * Create a Eventhub.
   * @property {array} [partitionIds] Current number of shards on the Event
   * Hub.
   * @property {date} [createdAt] Exact time the Event Hub was created.
   * @property {date} [updatedAt] The exact time the message was updated.
   * @property {number} [messageRetentionInDays] Number of days to retain the
   * events for this Event Hub, value should be 1 to 7 days
   * @property {number} [partitionCount] Number of partitions created for the
   * Event Hub, allowed values are from 1 to 32 partitions.
   * @property {string} [status] Enumerates the possible values for the status
   * of the Event Hub. Possible values include: 'Active', 'Disabled',
   * 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting',
   * 'Renaming', 'Unknown'
   * @property {object} [captureDescription] Properties of capture description
   * @property {boolean} [captureDescription.enabled] A value that indicates
   * whether capture description is enabled.
   * @property {string} [captureDescription.encoding] Enumerates the possible
   * values for the encoding format of capture description. Possible values
   * include: 'Avro', 'AvroDeflate'
   * @property {number} [captureDescription.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} [captureDescription.sizeLimitInBytes] The size window
   * defines the amount of data built up in your Event Hub before an capture
   * operation, value should be between 10485760 and 524288000 bytes
   * @property {object} [captureDescription.destination] Properties of
   * Destination where capture will be stored. (Storage Account, Blob Names)
   * @property {string} [captureDescription.destination.name] Name for capture
   * destination
   * @property {string}
   * [captureDescription.destination.storageAccountResourceId] Resource id of
   * the storage account to be used to create the blobs
   * @property {string} [captureDescription.destination.blobContainer] Blob
   * container Name
   * @property {string} [captureDescription.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
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Eventhub
   *
   * @returns {object} metadata of Eventhub
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Eventhub',
      type: {
        name: 'Composite',
        className: 'Eventhub',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          partitionIds: {
            required: false,
            readOnly: true,
            serializedName: 'properties.partitionIds',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          createdAt: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdAt',
            type: {
              name: 'DateTime'
            }
          },
          updatedAt: {
            required: false,
            readOnly: true,
            serializedName: 'properties.updatedAt',
            type: {
              name: 'DateTime'
            }
          },
          messageRetentionInDays: {
            required: false,
            serializedName: 'properties.messageRetentionInDays',
            constraints: {
              InclusiveMaximum: 7,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          partitionCount: {
            required: false,
            serializedName: 'properties.partitionCount',
            constraints: {
              InclusiveMaximum: 32,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          status: {
            required: false,
            serializedName: 'properties.status',
            type: {
              name: 'Enum',
              allowedValues: [ 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' ]
            }
          },
          captureDescription: {
            required: false,
            serializedName: 'properties.captureDescription',
            type: {
              name: 'Composite',
              className: 'CaptureDescription'
            }
          }
        }
      }
    };
  }
}

module.exports = Eventhub;
