🔍 Code Extractor

class UserSharingResult

Maturity: 34

Specifies a sharing result for an individual user that method UpdateDocumentSharingInfo (section 3.2.5.187.2.1.1) returns.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/user_sharing_result.py
Lines:
7 - 59
Complexity:
moderate

Purpose

Specifies a sharing result for an individual user that method UpdateDocumentSharingInfo (section 3.2.5.187.2.1.1) returns.

Source Code

class UserSharingResult(ClientValue):
    """Specifies a sharing result for an individual user that method UpdateDocumentSharingInfo
    (section 3.2.5.187.2.1.1) returns."""

    def __init__(
        self,
        allowed_roles=None,
        current_role=None,
        display_name=None,
        email=None,
        invitation_link=None,
        is_user_known=None,
        message=None,
        status=None,
        user=None,
    ):
        """
        :param list[int] allowed_roles: Specifies a set of roles that can be assigned to the user.
        :param int current_role: Specifies the role that the user is currently assigned to.
        :param str display_name: Gets the display name of the user.
        :param str email: Gets the user email.
        :param str invitation_link: Gets the invitation link.
        :param bool is_user_known: Specifies whether the user is known to the server. If "true", the user is known to
            the server; if "false", user is unknown.
        :param str message: Specifies a message string that explains the reason when the Status  property is "false".
        :param bool status: Specifies whether the sharing update for the user was completed successfully. If "true",
            the sharing update completed successfully for the user; if "false", the sharing update failed for the user.
        :param str user: Specifies the identifier of a user.
        """
        super(UserSharingResult, self).__init__()
        self.AllowedRoles = ClientValueCollection(int, allowed_roles)
        self.CurrentRole = current_role
        self.DisplayName = display_name
        self.Email = email
        self.InvitationLink = invitation_link
        self.IsUserKnown = is_user_known
        self.Message = message
        self.Status = status
        self.User = user

    @property
    def current_role_name(self):
        return ODataType.resolve_enum_key(Role, self.CurrentRole)

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

    def __str__(self):
        return "{0}: {1}".format(self.User, self.current_role_name)

    def __repr__(self):
        return "{0}: {1}".format(self.User, self.current_role_name)

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

bases: Parameter of type ClientValue

Return Value

Returns unspecified type

Class Interface

Methods

__init__(self, allowed_roles, current_role, display_name, email, invitation_link, is_user_known, message, status, user)

Purpose: :param list[int] allowed_roles: Specifies a set of roles that can be assigned to the user. :param int current_role: Specifies the role that the user is currently assigned to. :param str display_name: Gets the display name of the user. :param str email: Gets the user email. :param str invitation_link: Gets the invitation link. :param bool is_user_known: Specifies whether the user is known to the server. If "true", the user is known to the server; if "false", user is unknown. :param str message: Specifies a message string that explains the reason when the Status property is "false". :param bool status: Specifies whether the sharing update for the user was completed successfully. If "true", the sharing update completed successfully for the user; if "false", the sharing update failed for the user. :param str user: Specifies the identifier of a user.

Parameters:

  • allowed_roles: Parameter
  • current_role: Parameter
  • display_name: Parameter
  • email: Parameter
  • invitation_link: Parameter
  • is_user_known: Parameter
  • message: Parameter
  • status: Parameter
  • user: Parameter

Returns: None

current_role_name(self) property

Purpose: Performs current role name

Returns: None

entity_type_name(self) property

Purpose: Performs entity type name

Returns: None

__str__(self)

Purpose: Internal method: str

Returns: None

__repr__(self)

Purpose: Internal method: repr

Returns: None

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.odata.type import ODataType
from office365.sharepoint.sharing.role import Role

Usage Example

# Example usage:
# result = UserSharingResult(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharingResult 71.2% similar

    Contains properties generated as a result of sharing.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/result.py
  • class ObjectSharingInformation 61.8% similar

    A class that provides comprehensive information about the sharing state of SharePoint securable objects (documents, list items, sites), including permissions, sharing links, and user access details.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_information.py
  • class ObjectSharingInformationUser 60.1% similar

    A class representing information about a principal (user or group) with whom a SharePoint securable object is shared, providing access to their email, SIP address, login name, and related principal/user objects.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_information_user.py
  • class ObjectSharingSettings 57.6% similar

    This class contains the information necessary to read and change the sharing status of a SharePoint object. It also contains a reference to SharePoint specific settings denoted by "SharePointSettings".

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_settings.py
  • class SharedWithUser 57.1% similar

    A data class representing a user with whom content has been shared, capturing their email and name for change log tracking in sharing actions.

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