🔍 Code Extractor

class SharingLinkDefaultTemplate

Maturity: 24

A data class representing a default template for sharing links in SharePoint, containing link details information.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/links/default_template.py
Lines:
5 - 9
Complexity:
simple

Purpose

This class serves as a data container (ClientValue) for SharePoint sharing link default templates. It encapsulates sharing link information through a SharingLinkInfo object, providing a structured way to represent and transmit sharing link template data between client and server in the Office365 SharePoint API. It inherits from ClientValue, which typically provides serialization/deserialization capabilities for client-server communication.

Source Code

class SharingLinkDefaultTemplate(ClientValue):
    """"""

    def __init__(self, link_details=SharingLinkInfo()):
        self.linkDetails = link_details

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

link_details: A SharingLinkInfo object containing the details of the sharing link. Defaults to an empty SharingLinkInfo() instance if not provided. This parameter holds metadata about the sharing link such as permissions, expiration, scope, and other link-specific properties.

Return Value

Instantiation returns a SharingLinkDefaultTemplate object with the linkDetails attribute set to the provided or default SharingLinkInfo instance. This object can be used in SharePoint API operations related to sharing link templates.

Class Interface

Methods

__init__(self, link_details=SharingLinkInfo()) -> None

Purpose: Initializes a new SharingLinkDefaultTemplate instance with optional link details

Parameters:

  • link_details: A SharingLinkInfo object containing sharing link configuration. Defaults to an empty SharingLinkInfo() instance.

Returns: None (constructor)

Attributes

Name Type Description Scope
linkDetails SharingLinkInfo Stores the sharing link information including permissions, scope, expiration, and other link-specific properties instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.sharepoint.sharing.links.info import SharingLinkInfo

Usage Example

from office365.runtime.client_value import ClientValue
from office365.sharepoint.sharing.links.info import SharingLinkInfo
from office365.sharepoint.sharing.links.default_template import SharingLinkDefaultTemplate

# Create with default link details
template = SharingLinkDefaultTemplate()

# Create with specific link details
link_info = SharingLinkInfo()
# Configure link_info properties as needed
template_with_details = SharingLinkDefaultTemplate(link_details=link_info)

# Access the link details
details = template.linkDetails

Best Practices

  • This class is primarily a data container and should be instantiated with appropriate SharingLinkInfo objects when specific link configurations are needed
  • The class inherits from ClientValue, which means it's designed for serialization in Office365 API calls - do not add complex logic or state management
  • Always ensure the link_details parameter is a valid SharingLinkInfo instance or leave it as default
  • This class is typically used as part of larger SharePoint sharing operations and should be passed to appropriate SharePoint API methods
  • The linkDetails attribute can be accessed and modified after instantiation if needed
  • Since it inherits from ClientValue, the object can be serialized to JSON for API transmission automatically by the Office365 library

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharingLinkDefaultTemplatesCollection 91.3% similar

    A collection class that manages a set of SharingLinkDefaultTemplate objects, providing a container for default sharing link templates in SharePoint.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/links/default_templates_collection.py
  • class ShareLinkRequest 76.8% similar

    A data class representing a request for retrieving or creating a tokenized sharing link in SharePoint, encapsulating all necessary parameters for link configuration.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/links/share_request.py
  • class ShareLinkResponse 76.3% similar

    A response class that encapsulates information about a tokenized sharing link in SharePoint, including its retrieval or creation/update status.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/links/share_response.py
  • class SharingAbilities 74.8% 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
  • class SharingLinkAccessRequest 73.9% similar

    A data class representing extended values required for requesting access to SharePoint objects exposed through tokenized sharing links, including password and access persistence options.

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