🔍 Code Extractor

class EmbedDataV1

Maturity: 44

A class representing embedded metadata of a SharePoint page, providing access to URL, video ID, and website ID properties.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/publishing/embed_data_v1.py
Lines:
4 - 29
Complexity:
simple

Purpose

EmbedDataV1 is a data model class that encapsulates embedded metadata for SharePoint pages. It inherits from Entity and provides convenient property accessors for retrieving page URL, video identifier (if the page represents a video), and website identifier (if the page belongs to a website). This class is used within the Office365 SharePoint API to represent and access page metadata in a structured way.

Source Code

class EmbedDataV1(Entity):
    """Represents embedded meta data of the page."""

    def url(self):
        """
        The URL of the page.

        :rtype: str
        """
        return self.properties.get("Url", None)

    def video_id(self):
        """
        If the page represents a video, the value will be video id.

        :rtype: str
        """
        return self.properties.get("VideoId", None)

    def web_id(self):
        """
        If the page belongs to website, the value will be website id, otherwise the value will be empty.

        :rtype: str
        """
        return self.properties.get("WebId", None)

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

Entity_base_class: Inherits from Entity base class which provides the underlying 'properties' dictionary that stores the actual metadata values. The Entity base class handles the storage and retrieval of properties.

Return Value

Instantiation returns an EmbedDataV1 object that wraps SharePoint page metadata. The three public methods (url, video_id, web_id) each return a string value or None if the corresponding property is not present in the underlying properties dictionary.

Class Interface

Methods

url() -> str

Purpose: Retrieves the URL of the SharePoint page from the embedded metadata

Returns: The URL of the page as a string, or None if the 'Url' property is not present in the metadata

video_id() -> str

Purpose: Retrieves the video identifier if the page represents a video content

Returns: The video ID as a string if the page represents a video, or None if the 'VideoId' property is not present

web_id() -> str

Purpose: Retrieves the website identifier if the page belongs to a website

Returns: The website ID as a string if the page belongs to a website, or None/empty if the 'WebId' property is not present or the page is standalone

Attributes

Name Type Description Scope
properties dict Inherited from Entity base class. Dictionary containing the actual metadata key-value pairs including 'Url', 'VideoId', and 'WebId' instance

Dependencies

  • office365.sharepoint.entity

Required Imports

from office365.sharepoint.entity import Entity

Usage Example

from office365.sharepoint.entity import Entity
from office365.sharepoint.pages.embed_data_v1 import EmbedDataV1

# Typically instantiated by the SharePoint API, not directly by users
# Example assumes you have a SharePoint context and page object
embed_data = EmbedDataV1()

# Access the URL of the page
page_url = embed_data.url()
if page_url:
    print(f"Page URL: {page_url}")

# Check if page represents a video
video_id = embed_data.video_id()
if video_id:
    print(f"Video ID: {video_id}")

# Check if page belongs to a website
web_id = embed_data.web_id()
if web_id:
    print(f"Website ID: {web_id}")
else:
    print("Page does not belong to a website")

Best Practices

  • This class is typically instantiated by the Office365 SharePoint API framework rather than directly by users
  • Always check for None return values from the property methods before using them, as not all pages will have all properties
  • The underlying 'properties' dictionary is inherited from the Entity base class and should be populated before calling the accessor methods
  • This is a read-only data model class - it provides accessors but no setters for modifying the metadata
  • Use video_id() to determine if a page represents a video content before attempting video-specific operations
  • Use web_id() to determine if a page belongs to a website context, as empty/None values indicate standalone pages

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class EmbedService 75.1% similar

    EmbedService is a SharePoint service class that retrieves embed metadata for web pages, allowing applications to fetch rich preview information for URLs.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/publishing/embed_service.py
  • class SitePageFieldsData 67.7% similar

    A data class representing metadata fields for SharePoint Site Pages, used in page authoring operations to store and transfer page properties like title, banner image, canvas content, and publishing information.

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

    A SharePoint entity class representing microfeed data, which is part of the SharePoint Microfeed API for managing activity feeds and social interactions.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/microfeed/data.py
  • class VideoItem 66.5% similar

    VideoItem is a SharePoint entity class that represents a video item in SharePoint Publishing, providing methods to retrieve video embed codes and manage video ownership.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/publishing/video/item.py
  • class ContentTypeEntityData 66.1% similar

    A data class representing SharePoint content type entity metadata, inheriting from ClientValue to provide serialization capabilities for SharePoint API interactions.

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