🔍 Code Extractor

class SiteDesignMetadata

Maturity: 29

A class representing metadata for SharePoint site designs, extending SiteDesignCreationInfo with order and version properties.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sitedesigns/metadata.py
Lines:
4 - 12
Complexity:
simple

Purpose

This class is used to represent and manage metadata for SharePoint site designs within the Office365 SharePoint framework. It extends the base SiteDesignCreationInfo class to include additional metadata fields like order and version, which are used for organizing and versioning site design templates. The class provides the entity type name required for SharePoint REST API interactions.

Source Code

class SiteDesignMetadata(SiteDesignCreationInfo):
    def __init__(self, order=None, version=None):
        super().__init__()
        self.Order = order
        self.Version = version

    @property
    def entity_type_name(self):
        return "Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteDesignMetadata"

Parameters

Name Type Default Kind
bases SiteDesignCreationInfo -

Parameter Details

order: Optional parameter that specifies the display order or sequence position of the site design. Can be None if no specific ordering is required. Typically an integer value used for sorting site designs in lists or menus.

version: Optional parameter that indicates the version number of the site design. Can be None if versioning is not tracked. Used to manage different iterations of site design configurations and track changes over time.

Return Value

Instantiation returns a SiteDesignMetadata object that inherits all properties and methods from SiteDesignCreationInfo, with additional Order and Version attributes. The entity_type_name property returns the string 'Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteDesignMetadata' which identifies the SharePoint entity type.

Class Interface

Methods

__init__(order=None, version=None)

Purpose: Initializes a new SiteDesignMetadata instance with optional order and version parameters

Parameters:

  • order: Optional integer or value specifying the display order of the site design
  • version: Optional integer or value indicating the version number of the site design

Returns: None (constructor)

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type name used for REST API operations

Returns: String value 'Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteDesignMetadata' representing the SharePoint entity type

Attributes

Name Type Description Scope
Order Any (typically int or None) Stores the display order or sequence position of the site design instance
Version Any (typically int or None) Stores the version number of the site design for tracking changes and iterations instance

Dependencies

  • office365-rest-python-client

Required Imports

from office365.sharepoint.sitedesigns.creation_info import SiteDesignCreationInfo

Usage Example

from office365.sharepoint.sitedesigns.metadata import SiteDesignMetadata

# Create a site design metadata instance with order and version
site_design = SiteDesignMetadata(order=1, version=2)

# Access the entity type name for SharePoint API calls
entity_type = site_design.entity_type_name
print(entity_type)  # Output: Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteDesignMetadata

# Create without optional parameters
site_design_basic = SiteDesignMetadata()

# Set properties after instantiation
site_design_basic.Order = 5
site_design_basic.Version = 1

Best Practices

  • Always initialize with appropriate order values if multiple site designs need to be displayed in a specific sequence
  • Track version numbers consistently to maintain proper site design history and rollback capabilities
  • Use this class in conjunction with SharePoint client context for proper authentication and API access
  • The entity_type_name property should not be modified as it's required for SharePoint REST API communication
  • Inherit all functionality from SiteDesignCreationInfo, so ensure you understand the parent class capabilities
  • Order and Version can be set to None if not needed, but consider setting them for better organization in production environments

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SiteDesignCreationInfo 77.8% similar

    A data class representing the configuration information needed to create a SharePoint site design, including title, description, template type, and associated site scripts.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sitedesigns/creation_info.py
  • class SiteScriptMetadata 73.2% similar

    A data class representing metadata for a SharePoint site script, including its identifier, content, and description.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sitescripts/metadata.py
  • class SitePageFieldsData 68.1% 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 SiteCreationData 66.2% similar

    A data class representing site creation information for SharePoint Online tenant administration, including creation count and source GUID.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/sites/creation_data.py
  • class SiteScriptUpdateInfo 66.1% similar

    A class representing update information for SharePoint site scripts, inheriting from SiteScriptCreationInfo and providing the specific entity type name for update operations.

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