🔍 Code Extractor

class OnenotePagePreviewLinks

Maturity: 24

A data class representing preview links for a OneNote page, specifically containing a preview image URL.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/onenote/pages/preview_links.py
Lines:
5 - 9
Complexity:
simple

Purpose

This class serves as a data transfer object (DTO) for OneNote page preview links within the Office365 SDK. It encapsulates the preview image URL information for a OneNote page, inheriting from ClientValue which provides serialization capabilities for communication with Office365 services. The class is used to represent and transfer preview link metadata when working with OneNote pages through the Office365 API.

Source Code

class OnenotePagePreviewLinks(ClientValue):
    """"""

    def __init__(self, preview_image_url=ExternalLink()):
        self.previewImageUrl = preview_image_url

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

preview_image_url: An ExternalLink object representing the URL to the preview image of the OneNote page. Defaults to an empty ExternalLink() instance if not provided. This parameter allows initialization with a pre-existing ExternalLink object containing the preview image URL information.

Return Value

Instantiation returns an OnenotePagePreviewLinks object with the previewImageUrl attribute set to the provided ExternalLink instance or a default empty ExternalLink. The class itself doesn't have methods that return values, but the instance can be used in serialization/deserialization operations inherited from ClientValue.

Class Interface

Methods

__init__(self, preview_image_url=ExternalLink()) -> None

Purpose: Initializes a new OnenotePagePreviewLinks instance with an optional preview image URL

Parameters:

  • preview_image_url: An ExternalLink object containing the preview image URL. Defaults to an empty ExternalLink instance.

Returns: None - constructor initializes the instance

Attributes

Name Type Description Scope
previewImageUrl ExternalLink Stores the ExternalLink object representing the URL to the preview image of the OneNote page instance

Dependencies

  • office365

Required Imports

from office365.onenote.pages.external_link import ExternalLink
from office365.onenote.pages.preview_links import OnenotePagePreviewLinks

Usage Example

from office365.onenote.pages.external_link import ExternalLink
from office365.onenote.pages.preview_links import OnenotePagePreviewLinks

# Create with default empty ExternalLink
preview_links = OnenotePagePreviewLinks()

# Create with a specific ExternalLink
external_link = ExternalLink()
preview_links = OnenotePagePreviewLinks(preview_image_url=external_link)

# Access the preview image URL attribute
image_url = preview_links.previewImageUrl

# Typically used as part of OneNote page operations
# The object is serialized/deserialized automatically by the Office365 SDK

Best Practices

  • This class is primarily used internally by the Office365 SDK for data serialization and should be instantiated when working with OneNote page preview operations
  • The class inherits from ClientValue which handles JSON serialization/deserialization, so manual serialization is typically not needed
  • When creating instances, ensure the preview_image_url parameter is a valid ExternalLink object if provided
  • This is an immutable-style data class - attributes should be set during initialization rather than modified after creation
  • The class follows the Office365 SDK naming convention with camelCase for attribute names (previewImageUrl)
  • Instances of this class are typically created and managed by the Office365 SDK during API responses rather than manually by end users

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class PageLinks 74.8% similar

    A data class representing links for opening a OneNote page in different contexts (native client and web browser).

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/onenote/pages/links.py
  • class ExternalLink 71.9% similar

    A simple data class that represents a URL link to a OneNote page or notebook, inheriting from ClientValue.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/onenote/pages/external_link.py
  • class RecentNotebookLinks 66.7% similar

    A data class representing links for opening a OneNote notebook, containing both client and web URLs for accessing the notebook.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/onenote/notebooks/recent_links.py
  • class SharePagePreviewByEmailFieldsData 65.0% similar

    A data class that encapsulates information required for sharing a SharePoint page preview via email, including the message content and recipient email addresses.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/publishing/pages/page.py
  • class PageDetails 61.5% similar

    PageDetails is a minimal data class that inherits from ClientValue, serving as a container for page-related details in the Office365 API context.

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