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

/**
 * Properties of the EventHub event source.
 *
 * @extends models['AzureEventSourceProperties']
 */
class EventHubEventSourceCommonProperties extends models['AzureEventSourceProperties'] {
  /**
   * Create a EventHubEventSourceCommonProperties.
   * @member {string} serviceBusNamespace The name of the service bus that
   * contains the event hub.
   * @member {string} eventHubName The name of the event hub.
   * @member {string} consumerGroupName The name of the event hub's consumer
   * group that holds the partitions from which events will be read.
   * @member {string} keyName The name of the SAS key that grants the Time
   * Series Insights service access to the event hub. The shared access
   * policies for this key must grant 'Listen' permissions to the event hub.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of EventHubEventSourceCommonProperties
   *
   * @returns {object} metadata of EventHubEventSourceCommonProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EventHubEventSourceCommonProperties',
      type: {
        name: 'Composite',
        className: 'EventHubEventSourceCommonProperties',
        modelProperties: {
          provisioningState: {
            required: false,
            serializedName: 'provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ]
            }
          },
          creationTime: {
            required: false,
            readOnly: true,
            serializedName: 'creationTime',
            type: {
              name: 'DateTime'
            }
          },
          timestampPropertyName: {
            required: false,
            serializedName: 'timestampPropertyName',
            type: {
              name: 'String'
            }
          },
          eventSourceResourceId: {
            required: true,
            serializedName: 'eventSourceResourceId',
            type: {
              name: 'String'
            }
          },
          serviceBusNamespace: {
            required: true,
            serializedName: 'serviceBusNamespace',
            type: {
              name: 'String'
            }
          },
          eventHubName: {
            required: true,
            serializedName: 'eventHubName',
            type: {
              name: 'String'
            }
          },
          consumerGroupName: {
            required: true,
            serializedName: 'consumerGroupName',
            type: {
              name: 'String'
            }
          },
          keyName: {
            required: true,
            serializedName: 'keyName',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = EventHubEventSourceCommonProperties;
