class SharingLinkDefaultTemplate
A data class representing a default template for sharing links in SharePoint, containing link details information.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/links/default_template.py
5 - 9
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
-
class ShareLinkRequest 76.8% similar
-
class ShareLinkResponse 76.3% similar
-
class SharingAbilities 74.8% similar
-
class SharingLinkAccessRequest 73.9% similar