# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::Kusto::Mgmt::V2020_09_18
  module Models
    #
    # Class representing a database principal assignment.
    #
    class DatabasePrincipalAssignment < ProxyResource

      include MsRestAzure

      # @return [String] The principal ID assigned to the database principal.
      # It can be a user email, application ID, or security group name.
      attr_accessor :principal_id

      # @return [DatabasePrincipalRole] Database principal role. Possible
      # values include: 'Admin', 'Ingestor', 'Monitor', 'User',
      # 'UnrestrictedViewers', 'Viewer'
      attr_accessor :role

      # @return [String] The tenant id of the principal
      attr_accessor :tenant_id

      # @return [PrincipalType] Principal type. Possible values include: 'App',
      # 'Group', 'User'
      attr_accessor :principal_type

      # @return [String] The tenant name of the principal
      attr_accessor :tenant_name

      # @return [String] The principal name
      attr_accessor :principal_name

      # @return [ProvisioningState] The provisioned state of the resource.
      # Possible values include: 'Running', 'Creating', 'Deleting',
      # 'Succeeded', 'Failed', 'Moving'
      attr_accessor :provisioning_state


      #
      # Mapper for DatabasePrincipalAssignment class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'DatabasePrincipalAssignment',
          type: {
            name: 'Composite',
            class_name: 'DatabasePrincipalAssignment',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              principal_id: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.principalId',
                type: {
                  name: 'String'
                }
              },
              role: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.role',
                type: {
                  name: 'String'
                }
              },
              tenant_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.tenantId',
                type: {
                  name: 'String'
                }
              },
              principal_type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.principalType',
                type: {
                  name: 'String'
                }
              },
              tenant_name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.tenantName',
                type: {
                  name: 'String'
                }
              },
              principal_name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.principalName',
                type: {
                  name: 'String'
                }
              },
              provisioning_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.provisioningState',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
