🔍 Code Extractor

class WebCreationInformation

Maturity: 44

A data transfer object (DTO) class that encapsulates metadata required for creating a new SharePoint site (web).

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/webs/creation_information.py
Lines:
4 - 14
Complexity:
simple

Purpose

WebCreationInformation serves as a container for site creation parameters in SharePoint operations. It inherits from ClientValue, making it serializable for transmission to SharePoint REST/CSOM APIs. This class is typically used when programmatically creating new SharePoint sites or subsites, providing the necessary metadata like title and URL to the creation operation.

Source Code

class WebCreationInformation(ClientValue):
    """Represents metadata about site creation."""

    def __init__(self):
        super(WebCreationInformation, self).__init__()
        self.Title = None
        self.Url = None

    @property
    def entity_type_name(self):
        return "SP.WebCreationInformation"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

__init__: The constructor takes no parameters. It initializes the instance by calling the parent ClientValue constructor and setting Title and Url attributes to None. These attributes should be populated after instantiation before using the object in site creation operations.

Return Value

Instantiation returns a WebCreationInformation object with Title and Url attributes initialized to None. The entity_type_name property returns the string 'SP.WebCreationInformation', which is used for SharePoint API serialization and type identification.

Class Interface

Methods

__init__(self) -> None

Purpose: Initializes a new WebCreationInformation instance with Title and Url set to None

Returns: None - constructor initializes the instance

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type name used for API serialization and type identification

Returns: String 'SP.WebCreationInformation' representing the SharePoint entity type

Attributes

Name Type Description Scope
Title str | None The display title/name for the new SharePoint site to be created. Should be set to a non-empty string before using in creation operations. instance
Url str | None The relative URL path for the new SharePoint site. Should be a valid URL segment without special characters, typically lowercase with no spaces. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue

Usage Example

from office365.runtime.client_value import ClientValue

class WebCreationInformation(ClientValue):
    def __init__(self):
        super(WebCreationInformation, self).__init__()
        self.Title = None
        self.Url = None
    
    @property
    def entity_type_name(self):
        return "SP.WebCreationInformation"

# Create an instance
web_info = WebCreationInformation()

# Set the required properties
web_info.Title = "My New Subsite"
web_info.Url = "mynewsubsite"

# This object would typically be passed to a SharePoint context method
# Example: ctx.web.webs.add(web_info).execute_query()

Best Practices

  • Always set both Title and Url properties before using the object in site creation operations
  • The Url property should be a relative URL (site-relative path) without leading or trailing slashes
  • Ensure the Title is descriptive and follows your organization's naming conventions
  • This object is immutable after being passed to SharePoint API calls; create a new instance for each site creation operation
  • Validate that the Url doesn't contain special characters that are invalid in SharePoint URLs
  • The entity_type_name property should not be modified as it's used internally by the SharePoint API for type resolution

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class WebInfoCreationInformation 82.8% similar

    WebInfoCreationInformation is a data transfer object class that inherits from ClientValue, used to encapsulate information required for creating web instances in Office 365/SharePoint operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/webs/info_creation_information.py
  • class ContentTypeCreationInformation 79.3% similar

    A data transfer object that encapsulates properties required to create a new SharePoint content type, inheriting from ClientValue for serialization support.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/contenttypes/creation_information.py
  • class ViewCreationInformation 78.3% similar

    A data transfer object (DTO) class that encapsulates the properties required to create a new SharePoint list view, inheriting from ClientValue for serialization support.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/views/create_information.py
  • class SiteDesignCreationInfo 77.7% 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 GroupCreationInformation 77.4% similar

    A data transfer object (DTO) class that encapsulates information required to create a cross-site SharePoint group.

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