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

/**
 * A class representing database principal entity.
 *
 */
class DatabasePrincipal {
  /**
   * Create a DatabasePrincipal.
   * @property {string} role Database principal role. Possible values include:
   * 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'
   * @property {string} name Database principal name.
   * @property {string} type Database principal type. Possible values include:
   * 'App', 'Group', 'User'
   * @property {string} [fqn] Database principal fully qualified name.
   * @property {string} [email] Database principal email if exists.
   * @property {string} [appId] Application id - relevant only for application
   * principal type.
   */
  constructor() {
  }

  /**
   * Defines the metadata of DatabasePrincipal
   *
   * @returns {object} metadata of DatabasePrincipal
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DatabasePrincipal',
      type: {
        name: 'Composite',
        className: 'DatabasePrincipal',
        modelProperties: {
          role: {
            required: true,
            serializedName: 'role',
            type: {
              name: 'String'
            }
          },
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          fqn: {
            required: false,
            serializedName: 'fqn',
            type: {
              name: 'String'
            }
          },
          email: {
            required: false,
            serializedName: 'email',
            type: {
              name: 'String'
            }
          },
          appId: {
            required: false,
            serializedName: 'appId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = DatabasePrincipal;
