🔍 Code Extractor

class PrincipalInfo

Maturity: 32

Provides access to information about a principal.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/utilities/principal_info.py
Lines:
6 - 46
Complexity:
moderate

Purpose

Provides access to information about a principal.

Source Code

class PrincipalInfo(ClientValue):
    """Provides access to information about a principal."""

    def __init__(
        self,
        principal_id=None,
        display_name=None,
        email=None,
        login_name=None,
        department=None,
        job_title=None,
        principal_type=None,
    ):
        """
        :param str principal_id: Specifies an identifier for the principal. It MUST be -1 if the principal
            does not belong to the current site.
        :param str display_name: Specifies the display name of the principal.
        :param str email: Specifies the e-mail address of the principal.
        :param str department: Specifies the department name of the principal.
        :param str job_title: Specifies the job title of the principal.
        :param str login_name: Specifies the login name of the principal.
        :param int principal_type: Specifies the principal type.
        """
        self.PrincipalId = principal_id
        self.DisplayName = display_name
        self.Email = email
        self.LoginName = login_name
        self.Department = department
        self.JobTitle = job_title
        self.PrincipalType = principal_type

    @property
    def entity_type_name(self):
        return "SP.Utilities.PrincipalInfo"

    @property
    def principal_type_name(self):
        return ODataType.resolve_enum_key(PrincipalType, self.PrincipalType)

    def __str__(self):
        return "{0}: {1}".format(self.principal_type_name, self.DisplayName)

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

bases: Parameter of type ClientValue

Return Value

Returns unspecified type

Class Interface

Methods

__init__(self, principal_id, display_name, email, login_name, department, job_title, principal_type)

Purpose: :param str principal_id: Specifies an identifier for the principal. It MUST be -1 if the principal does not belong to the current site. :param str display_name: Specifies the display name of the principal. :param str email: Specifies the e-mail address of the principal. :param str department: Specifies the department name of the principal. :param str job_title: Specifies the job title of the principal. :param str login_name: Specifies the login name of the principal. :param int principal_type: Specifies the principal type.

Parameters:

  • principal_id: Parameter
  • display_name: Parameter
  • email: Parameter
  • login_name: Parameter
  • department: Parameter
  • job_title: Parameter
  • principal_type: Parameter

Returns: None

entity_type_name(self) property

Purpose: Performs entity type name

Returns: None

principal_type_name(self) property

Purpose: Performs principal type name

Returns: None

__str__(self)

Purpose: Internal method: str

Returns: None

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.odata.type import ODataType
from office365.sharepoint.principal.type import PrincipalType

Usage Example

# Example usage:
# result = PrincipalInfo(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class Principal_v1 70.1% similar

    Principal class is a representation of an identity (user/group).

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/principal.py
  • class Principal 67.1% similar

    Represents a user or group that can be assigned permissions to control security.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/principal/principal.py
  • class PickerEntityInformation 58.5% similar

    A class representing additional information about a principal (user, group, or security entity) in SharePoint's people picker system.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/entity_information.py
  • class PrincipalType 58.5% similar

    An enumeration-style class that defines constants representing different types of principals in a SharePoint or similar access control system.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/principal/type.py
  • class PrincipalSource 58.1% similar

    An enumeration-style class that defines constants representing different sources from which a principal (user identity) can be obtained in an authentication/authorization context.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/principal/source.py
← Back to Browse