class RecentNotebookLinks
A data class representing links for opening a OneNote notebook, containing both client and web URLs for accessing the notebook.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/onenote/notebooks/recent_links.py
5 - 14
simple
Purpose
This class serves as a data container for OneNote notebook access links. It inherits from ClientValue and is designed to be used as a property on a recentNotebook resource, providing two types of links: one for opening the notebook in the OneNote client application and another for opening it in a web browser. This class is part of the Office 365 OneNote API integration and facilitates multi-platform access to OneNote notebooks.
Source Code
class RecentNotebookLinks(ClientValue):
"""
Links for opening a OneNote notebook. This resource type exists as a property on a recentNotebook resource.
"""
def __init__(
self, onenote_client_url=ExternalLink(), onenote_web_url=ExternalLink()
):
self.oneNoteClientUrl = onenote_client_url
self.oneNoteWebUrl = onenote_web_url
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
onenote_client_url: An ExternalLink object representing the URL to open the notebook in the OneNote desktop or mobile client application. Defaults to an empty ExternalLink() instance if not provided.
onenote_web_url: An ExternalLink object representing the URL to open the notebook in the OneNote web interface. Defaults to an empty ExternalLink() instance if not provided.
Return Value
Instantiation returns a RecentNotebookLinks object with two attributes: oneNoteClientUrl and oneNoteWebUrl, both of type ExternalLink. These attributes store the respective URLs for accessing the OneNote notebook through different interfaces.
Class Interface
Methods
__init__(self, onenote_client_url=ExternalLink(), onenote_web_url=ExternalLink())
Purpose: Initializes a RecentNotebookLinks instance with URLs for accessing a OneNote notebook via client and web interfaces
Parameters:
onenote_client_url: ExternalLink object for the OneNote client application URL, defaults to empty ExternalLink()onenote_web_url: ExternalLink object for the OneNote web interface URL, defaults to empty ExternalLink()
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
oneNoteClientUrl |
ExternalLink | Stores the URL link for opening the notebook in the OneNote client application (desktop or mobile) | instance |
oneNoteWebUrl |
ExternalLink | Stores the URL link for opening the notebook in the OneNote web interface | instance |
Dependencies
office365
Required Imports
from office365.onenote.pages.external_link import ExternalLink
from office365.runtime.client_value import ClientValue
from office365.onenote.recent_notebook_links import RecentNotebookLinks
Usage Example
from office365.onenote.pages.external_link import ExternalLink
from office365.onenote.recent_notebook_links import RecentNotebookLinks
# Create ExternalLink objects
client_link = ExternalLink()
client_link.href = 'onenote:https://example.com/notebook'
web_link = ExternalLink()
web_link.href = 'https://www.onenote.com/notebooks/example'
# Instantiate RecentNotebookLinks with custom links
notebook_links = RecentNotebookLinks(
onenote_client_url=client_link,
onenote_web_url=web_link
)
# Access the links
print(notebook_links.oneNoteClientUrl.href)
print(notebook_links.oneNoteWebUrl.href)
# Or use default empty links
default_links = RecentNotebookLinks()
print(default_links.oneNoteClientUrl)
print(default_links.oneNoteWebUrl)
Best Practices
- This class is a simple data container with no methods beyond initialization, so it should be instantiated with appropriate ExternalLink objects
- The class uses camelCase for attribute names (oneNoteClientUrl, oneNoteWebUrl) to match Microsoft Graph API conventions, even though constructor parameters use snake_case
- Always ensure ExternalLink objects are properly initialized with valid URLs before passing them to this class
- This class is typically not instantiated directly by end users but rather populated by the Office 365 API when retrieving recent notebook information
- Since it inherits from ClientValue, it may be serialized/deserialized as part of API requests and responses
- The class is immutable after construction - attributes should be set during initialization rather than modified later
- When using in API contexts, the class will be automatically serialized to match the expected JSON structure for Microsoft Graph API
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ExternalLink 80.8% similar
-
class RecentNotebook 80.7% similar
-
class PageLinks 79.7% similar
-
class OnenotePagePreviewLinks 66.7% similar
-
class Onenote 63.5% similar