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

/**
 * A notification.
 *
 * @extends models['Resource']
 */
class NotificationChannel extends models['Resource'] {
  /**
   * Create a NotificationChannel.
   * @property {string} [webHookUrl] The webhook URL to send notifications to.
   * @property {string} [emailRecipient] The email recipient to send
   * notifications to (can be a list of semi-colon separated email addresses).
   * @property {string} [notificationLocale] The locale to use when sending a
   * notification (fallback for unsupported languages is EN).
   * @property {string} [description] Description of notification.
   * @property {array} [events] The list of event for which this notification
   * is enabled.
   * @property {date} [createdDate] The creation date of the notification
   * channel.
   * @property {string} [provisioningState] The provisioning status of the
   * resource.
   * @property {string} [uniqueIdentifier] The unique immutable identifier of a
   * resource (Guid).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of NotificationChannel
   *
   * @returns {object} metadata of NotificationChannel
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NotificationChannel',
      type: {
        name: 'Composite',
        className: 'NotificationChannel',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          webHookUrl: {
            required: false,
            serializedName: 'properties.webHookUrl',
            type: {
              name: 'String'
            }
          },
          emailRecipient: {
            required: false,
            serializedName: 'properties.emailRecipient',
            type: {
              name: 'String'
            }
          },
          notificationLocale: {
            required: false,
            serializedName: 'properties.notificationLocale',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          events: {
            required: false,
            serializedName: 'properties.events',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EventElementType',
                  type: {
                    name: 'Composite',
                    className: 'Event'
                  }
              }
            }
          },
          createdDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdDate',
            type: {
              name: 'DateTime'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          uniqueIdentifier: {
            required: false,
            readOnly: true,
            serializedName: 'properties.uniqueIdentifier',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = NotificationChannel;
