class WebCreationInformation
A data transfer object (DTO) class that encapsulates metadata required for creating a new SharePoint site (web).
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/webs/creation_information.py
4 - 14
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
-
class ContentTypeCreationInformation 79.3% similar
-
class ViewCreationInformation 78.3% similar
-
class SiteDesignCreationInfo 77.7% similar
-
class GroupCreationInformation 77.4% similar