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

/**
 * Logger details.
 *
 * @extends models['Resource']
 */
class LoggerContract extends models['Resource'] {
  /**
   * Create a LoggerContract.
   * @property {string} loggerType Logger type. Possible values include:
   * 'azureEventHub', 'applicationInsights'
   * @property {string} [description] Logger description.
   * @property {object} credentials The name and SendRule connection string of
   * the event hub for azureEventHub logger.
   * Instrumentation key for applicationInsights logger.
   * @property {boolean} [isBuffered] Whether records are buffered in the
   * logger before publishing. Default is assumed to be true.
   * @property {string} [resourceId] Azure Resource Id of a log target (either
   * Azure Event Hub resource or Azure Application Insights resource).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of LoggerContract
   *
   * @returns {object} metadata of LoggerContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'LoggerContract',
      type: {
        name: 'Composite',
        className: 'LoggerContract',
        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'
            }
          },
          loggerType: {
            required: true,
            serializedName: 'properties.loggerType',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            constraints: {
              MaxLength: 256
            },
            type: {
              name: 'String'
            }
          },
          credentials: {
            required: true,
            serializedName: 'properties.credentials',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          isBuffered: {
            required: false,
            serializedName: 'properties.isBuffered',
            type: {
              name: 'Boolean'
            }
          },
          resourceId: {
            required: false,
            serializedName: 'properties.resourceId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = LoggerContract;
