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

/**
 * Description of queue Resource.
 *
 * @extends models['Resource']
 */
class SBQueue extends models['Resource'] {
  /**
   * Create a SBQueue.
   * @property {object} [countDetails] Message Count Details.
   * @property {number} [countDetails.activeMessageCount] Number of active
   * messages in the queue, topic, or subscription.
   * @property {number} [countDetails.deadLetterMessageCount] Number of
   * messages that are dead lettered.
   * @property {number} [countDetails.scheduledMessageCount] Number of
   * scheduled messages.
   * @property {number} [countDetails.transferMessageCount] Number of messages
   * transferred to another queue, topic, or subscription.
   * @property {number} [countDetails.transferDeadLetterMessageCount] Number of
   * messages transferred into dead letters.
   * @property {date} [createdAt] The exact time the message was created.
   * @property {date} [updatedAt] The exact time the message was updated.
   * @property {date} [accessedAt] Last time a message was sent, or the last
   * time there was a receive request to this queue.
   * @property {number} [sizeInBytes] The size of the queue, in bytes.
   * @property {number} [messageCount] The number of messages in the queue.
   * @property {moment.duration} [lockDuration] ISO 8601 timespan duration of a
   * peek-lock; that is, the amount of time that the message is locked for
   * other receivers. The maximum value for LockDuration is 5 minutes; the
   * default value is 1 minute.
   * @property {number} [maxSizeInMegabytes] The maximum size of the queue in
   * megabytes, which is the size of memory allocated for the queue. Default is
   * 1024.
   * @property {boolean} [requiresDuplicateDetection] A value indicating if
   * this queue requires duplicate detection.
   * @property {boolean} [requiresSession] A value that indicates whether the
   * queue supports the concept of sessions.
   * @property {moment.duration} [defaultMessageTimeToLive] ISO 8601 default
   * message timespan to live value. This is the duration after which the
   * message expires, starting from when the message is sent to Service Bus.
   * This is the default value used when TimeToLive is not set on a message
   * itself.
   * @property {boolean} [deadLetteringOnMessageExpiration] A value that
   * indicates whether this queue has dead letter support when a message
   * expires.
   * @property {moment.duration} [duplicateDetectionHistoryTimeWindow] ISO 8601
   * timeSpan structure that defines the duration of the duplicate detection
   * history. The default value is 10 minutes.
   * @property {number} [maxDeliveryCount] The maximum delivery count. A
   * message is automatically deadlettered after this number of deliveries.
   * default value is 10.
   * @property {string} [status] Enumerates the possible values for the status
   * of a messaging entity. Possible values include: 'Active', 'Disabled',
   * 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting',
   * 'Renaming', 'Unknown'
   * @property {boolean} [enableBatchedOperations] Value that indicates whether
   * server-side batched operations are enabled.
   * @property {moment.duration} [autoDeleteOnIdle] ISO 8061 timeSpan idle
   * interval after which the queue is automatically deleted. The minimum
   * duration is 5 minutes.
   * @property {boolean} [enablePartitioning] A value that indicates whether
   * the queue is to be partitioned across multiple message brokers.
   * @property {boolean} [enableExpress] A value that indicates whether Express
   * Entities are enabled. An express queue holds a message in memory
   * temporarily before writing it to persistent storage.
   * @property {string} [forwardTo] Queue/Topic name to forward the messages
   * @property {string} [forwardDeadLetteredMessagesTo] Queue/Topic name to
   * forward the Dead Letter message
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SBQueue
   *
   * @returns {object} metadata of SBQueue
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SBQueue',
      type: {
        name: 'Composite',
        className: 'SBQueue',
        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'
            }
          },
          countDetails: {
            required: false,
            readOnly: true,
            serializedName: 'properties.countDetails',
            type: {
              name: 'Composite',
              className: 'MessageCountDetails'
            }
          },
          createdAt: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdAt',
            type: {
              name: 'DateTime'
            }
          },
          updatedAt: {
            required: false,
            readOnly: true,
            serializedName: 'properties.updatedAt',
            type: {
              name: 'DateTime'
            }
          },
          accessedAt: {
            required: false,
            readOnly: true,
            serializedName: 'properties.accessedAt',
            type: {
              name: 'DateTime'
            }
          },
          sizeInBytes: {
            required: false,
            readOnly: true,
            serializedName: 'properties.sizeInBytes',
            type: {
              name: 'Number'
            }
          },
          messageCount: {
            required: false,
            readOnly: true,
            serializedName: 'properties.messageCount',
            type: {
              name: 'Number'
            }
          },
          lockDuration: {
            required: false,
            serializedName: 'properties.lockDuration',
            type: {
              name: 'TimeSpan'
            }
          },
          maxSizeInMegabytes: {
            required: false,
            serializedName: 'properties.maxSizeInMegabytes',
            type: {
              name: 'Number'
            }
          },
          requiresDuplicateDetection: {
            required: false,
            serializedName: 'properties.requiresDuplicateDetection',
            type: {
              name: 'Boolean'
            }
          },
          requiresSession: {
            required: false,
            serializedName: 'properties.requiresSession',
            type: {
              name: 'Boolean'
            }
          },
          defaultMessageTimeToLive: {
            required: false,
            serializedName: 'properties.defaultMessageTimeToLive',
            type: {
              name: 'TimeSpan'
            }
          },
          deadLetteringOnMessageExpiration: {
            required: false,
            serializedName: 'properties.deadLetteringOnMessageExpiration',
            type: {
              name: 'Boolean'
            }
          },
          duplicateDetectionHistoryTimeWindow: {
            required: false,
            serializedName: 'properties.duplicateDetectionHistoryTimeWindow',
            type: {
              name: 'TimeSpan'
            }
          },
          maxDeliveryCount: {
            required: false,
            serializedName: 'properties.maxDeliveryCount',
            type: {
              name: 'Number'
            }
          },
          status: {
            required: false,
            serializedName: 'properties.status',
            type: {
              name: 'Enum',
              allowedValues: [ 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' ]
            }
          },
          enableBatchedOperations: {
            required: false,
            serializedName: 'properties.enableBatchedOperations',
            type: {
              name: 'Boolean'
            }
          },
          autoDeleteOnIdle: {
            required: false,
            serializedName: 'properties.autoDeleteOnIdle',
            type: {
              name: 'TimeSpan'
            }
          },
          enablePartitioning: {
            required: false,
            serializedName: 'properties.enablePartitioning',
            type: {
              name: 'Boolean'
            }
          },
          enableExpress: {
            required: false,
            serializedName: 'properties.enableExpress',
            type: {
              name: 'Boolean'
            }
          },
          forwardTo: {
            required: false,
            serializedName: 'properties.forwardTo',
            type: {
              name: 'String'
            }
          },
          forwardDeadLetteredMessagesTo: {
            required: false,
            serializedName: 'properties.forwardDeadLetteredMessagesTo',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = SBQueue;
