🔍 Code Extractor

class Link

Maturity: 22

A SharePoint Link entity class that represents a directory link object in SharePoint, inheriting from the Entity base class.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/directory/link.py
Lines:
4 - 7
Complexity:
simple

Purpose

This class represents a SharePoint directory link entity and provides the entity type name identifier for SharePoint API operations. It serves as a model for Link objects in the SharePoint directory structure, allowing interaction with SharePoint link resources through the office365 SDK.

Source Code

class Link(Entity):
    @property
    def entity_type_name(self):
        return "SP.Directory.Link"

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

__init__: Inherits constructor from Entity base class. The specific parameters depend on the Entity parent class implementation, typically including context and resource path information for SharePoint API communication.

Return Value

Instantiation returns a Link object that represents a SharePoint directory link entity. The entity_type_name property returns the string 'SP.Directory.Link' which identifies this entity type in SharePoint API calls.

Class Interface

Methods

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type name identifier for Link objects

Returns: String 'SP.Directory.Link' which is the SharePoint entity type identifier for directory links

Attributes

Name Type Description Scope
entity_type_name str Read-only property that returns the SharePoint entity type name 'SP.Directory.Link' used for API operations instance

Dependencies

  • office365

Required Imports

from office365.sharepoint.directory.link import Link
from office365.sharepoint.entity import Entity

Usage Example

from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.directory.link import Link

# Initialize SharePoint context
ctx = ClientContext('https://yourtenant.sharepoint.com/sites/yoursite')
ctx.with_credentials(user_credentials)

# Link objects are typically retrieved from SharePoint rather than instantiated directly
# Example: Getting a link from SharePoint
link = ctx.web.get_property('SomeLink')
print(link.entity_type_name)  # Outputs: 'SP.Directory.Link'

# Execute the query to load data
ctx.execute_query()

Best Practices

  • Link objects are typically retrieved from SharePoint API rather than instantiated directly by users
  • Always ensure proper authentication context is established before working with Link entities
  • Use the entity_type_name property when making SharePoint API calls that require entity type identification
  • The Link class inherits all functionality from Entity base class, so refer to Entity documentation for full method availability
  • Execute queries using the ClientContext.execute_query() method after setting up operations on Link objects

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharePointDirectoryProvider 71.4% similar

    A SharePoint directory provider entity class that represents the SP.Directory.Provider.SharePointDirectoryProvider resource in SharePoint's REST API.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/directory/provider/provider.py
  • class SocialLink 68.5% similar

    SocialLink is a class that represents a social media or web link with a URI and text representation, used to define the location of a website in SharePoint Social contexts.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/social/link.py
  • class SiteLinkingManager 67.3% similar

    SiteLinkingManager is a SharePoint Portal entity class that manages site linking operations, specifically retrieving linked sites information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/linkedsites/manager.py
  • class ShareLinkResponse 66.4% 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 SharingLinkDefaultTemplate 66.1% similar

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

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