🔍 Code Extractor

class SharingResult

Maturity: 33

Contains properties generated as a result of sharing.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/result.py
Lines:
13 - 105
Complexity:
moderate

Purpose

Contains properties generated as a result of sharing.

Source Code

class SharingResult(Entity):
    """Contains properties generated as a result of sharing."""

    @property
    def url(self):
        # type: () -> Optional[str]
        """Gets the URL of the securable object being shared."""
        return self.properties.get("Url", None)

    @property
    def error_message(self):
        # type: () -> Optional[str]
        """Gets an error message about the failure if sharing was unsuccessful."""
        return self.properties.get("ErrorMessage", None)

    @property
    def name(self):
        # type: () -> Optional[str]
        """Gets the name of the securable object being shared."""
        return self.properties.get("Name", None)

    @property
    def icon_url(self):
        # type: () -> Optional[str]
        """Gets a URL to an icon that represents the securable object, if one exists."""
        return self.properties.get("IconUrl", None)

    @property
    def status_code(self):
        # type: () -> Optional[int]
        """
        Gets the enumeration value which summarizes the result of the sharing operation.
        """
        return self.properties.get("StatusCode", None)

    @property
    def permissions_page_relative_url(self):
        # type: () -> Optional[str]
        """Gets the relative URL of the page that shows permissions."""
        return self.properties.get("PermissionsPageRelativeUrl", None)

    @property
    def invited_users(self):
        # type: () ->  ClientValueCollection[SPInvitationCreationResult]
        """
        Gets a list of SPInvitationCreationResult (section 3.2.5.325) objects representing the external users being
        invited to have access.
        """
        return self.properties.get(
            "InvitedUsers", ClientValueCollection(SPInvitationCreationResult)
        )

    @property
    def uniquely_permissioned_users(self):
        # type: () ->  ClientValueCollection[UserSharingResult]
        return self.properties.get(
            "UniquelyPermissionedUsers", ClientValueCollection(UserSharingResult)
        )

    @property
    def groups_shared_with(self):
        return self.properties.get(
            "GroupsSharedWith",
            GroupCollection(
                self.context, ResourcePath("GroupsSharedWith", self.resource_path)
            ),
        )

    @property
    def users_added_to_group(self):
        # type: () ->  ClientValueCollection[UserSharingResult]
        """Gets the list of users being added to the SharePoint permissions group."""
        return self.properties.get(
            "UsersAddedToGroup", ClientValueCollection(UserSharingResult)
        )

    def get_property(self, name, default_value=None):
        if default_value is None:
            property_mapping = {
                "GroupsSharedWith": self.groups_shared_with,
                "UsersAddedToGroup": self.users_added_to_group,
            }
            default_value = property_mapping.get(name, None)
        return super(SharingResult, self).get_property(name, default_value)

    def set_property(self, name, value, persist_changes=True):
        super(SharingResult, self).set_property(name, value, persist_changes)
        # fallback: create a new resource path
        if self._resource_path is None:
            if name == "Name":
                pass
                # self._resource_path = ResourcePath(value, self.parent_collection.resource_path)
        return self

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Parameter of type Entity

Return Value

Returns unspecified type

Class Interface

Methods

url(self) property

Purpose: Gets the URL of the securable object being shared.

Returns: None

error_message(self) property

Purpose: Gets an error message about the failure if sharing was unsuccessful.

Returns: None

name(self) property

Purpose: Gets the name of the securable object being shared.

Returns: None

icon_url(self) property

Purpose: Gets a URL to an icon that represents the securable object, if one exists.

Returns: None

status_code(self) property

Purpose: Gets the enumeration value which summarizes the result of the sharing operation.

Returns: None

permissions_page_relative_url(self) property

Purpose: Gets the relative URL of the page that shows permissions.

Returns: None

invited_users(self) property

Purpose: Gets a list of SPInvitationCreationResult (section 3.2.5.325) objects representing the external users being invited to have access.

Returns: None

uniquely_permissioned_users(self) property

Purpose: Performs uniquely permissioned users

Returns: None

groups_shared_with(self) property

Purpose: Performs groups shared with

Returns: None

users_added_to_group(self) property

Purpose: Gets the list of users being added to the SharePoint permissions group.

Returns: None

get_property(self, name, default_value)

Purpose: Retrieves property

Parameters:

  • name: Parameter
  • default_value: Parameter

Returns: None

set_property(self, name, value, persist_changes)

Purpose: Sets property

Parameters:

  • name: Parameter
  • value: Parameter
  • persist_changes: Parameter

Returns: None

Required Imports

from typing import Optional
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.paths.resource_path import ResourcePath
from office365.sharepoint.entity import Entity
from office365.sharepoint.principal.groups.collection import GroupCollection

Usage Example

# Example usage:
# result = SharingResult(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class UserSharingResult 71.2% similar

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

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/user_sharing_result.py
  • class ObjectSharingInformation 57.0% 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 SharingFacet 55.7% similar

    A data class representing sharing information for SharePoint activities, including recipients and sharing type.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/activities/facets/sharing.py
  • class ObjectSharingSettings 54.7% 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 SharingAbilities 54.1% similar

    Represents the matrix of possible sharing abilities for direct sharing and tokenized sharing links along with the state of each capability for the current user in SharePoint.

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