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

/**
 * Role Assignments
 *
 */
class RoleAssignment {
  /**
   * Create a RoleAssignment.
   * @property {string} [id] The role assignment ID.
   * @property {string} [name] The role assignment name.
   * @property {string} [type] The role assignment type.
   * @property {string} [scope] The role assignment scope.
   * @property {string} [roleDefinitionId] The role definition ID.
   * @property {string} [principalId] The principal ID.
   * @property {boolean} [canDelegate] The Delegation flag for the
   * roleassignment
   */
  constructor() {
  }

  /**
   * Defines the metadata of RoleAssignment
   *
   * @returns {object} metadata of RoleAssignment
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RoleAssignment',
      type: {
        name: 'Composite',
        className: 'RoleAssignment',
        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'
            }
          },
          scope: {
            required: false,
            serializedName: 'properties.scope',
            type: {
              name: 'String'
            }
          },
          roleDefinitionId: {
            required: false,
            serializedName: 'properties.roleDefinitionId',
            type: {
              name: 'String'
            }
          },
          principalId: {
            required: false,
            serializedName: 'properties.principalId',
            type: {
              name: 'String'
            }
          },
          canDelegate: {
            required: false,
            serializedName: 'properties.canDelegate',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = RoleAssignment;
