🔍 Code Extractor

class SiteCreationSource

Maturity: 29

A client value class representing a source for SharePoint site creation, containing a collection of site creation data objects.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/sites/creation_source.py
Lines:
8 - 16
Complexity:
simple

Purpose

This class serves as a container for SharePoint Online tenant administration site creation sources. It encapsulates a collection of SiteCreationData objects and provides the entity type name required for SharePoint REST API operations. It inherits from ClientValue, making it serializable for communication with SharePoint services.

Source Code

class SiteCreationSource(ClientValue):
    def __init__(self, site_creation_data=None):
        self.SiteCreationData = ClientValueCollection(
            SiteCreationData, site_creation_data
        )

    @property
    def entity_type_name(self):
        return "Microsoft.Online.SharePoint.TenantAdministration.SiteCreationSource"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

site_creation_data: Optional parameter that can be a list or iterable of SiteCreationData objects. If provided, these objects will be used to initialize the SiteCreationData collection. Can be None to create an empty collection.

Return Value

Instantiation returns a SiteCreationSource object with an initialized SiteCreationData collection. The entity_type_name property returns a string identifying the SharePoint entity type: 'Microsoft.Online.SharePoint.TenantAdministration.SiteCreationSource'.

Class Interface

Methods

__init__(self, site_creation_data=None)

Purpose: Initializes a new SiteCreationSource instance with an optional collection of site creation data

Parameters:

  • site_creation_data: Optional iterable of SiteCreationData objects to initialize the collection. Defaults to None for an empty collection.

Returns: None (constructor)

@property entity_type_name(self) -> str property

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

Returns: String value 'Microsoft.Online.SharePoint.TenantAdministration.SiteCreationSource' representing the SharePoint entity type

Attributes

Name Type Description Scope
SiteCreationData ClientValueCollection[SiteCreationData] A collection of SiteCreationData objects representing individual site creation configurations. This collection can be iterated over and modified to manage multiple site creation data entries. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.tenant.administration.sites.creation_data import SiteCreationData

Usage Example

from office365.sharepoint.tenant.administration.sites.creation_data import SiteCreationData
from office365.sharepoint.tenant.administration.sites.creation_source import SiteCreationSource

# Create an empty site creation source
source = SiteCreationSource()

# Create with initial data
site_data1 = SiteCreationData()
site_data2 = SiteCreationData()
source_with_data = SiteCreationSource([site_data1, site_data2])

# Access the collection
data_collection = source_with_data.SiteCreationData

# Get entity type name for API operations
entity_type = source.entity_type_name
print(entity_type)  # Output: Microsoft.Online.SharePoint.TenantAdministration.SiteCreationSource

Best Practices

  • Always ensure that items added to the SiteCreationData collection are valid SiteCreationData objects
  • This class is typically used as part of SharePoint tenant administration operations and should be instantiated within the context of an authenticated SharePoint connection
  • The entity_type_name property is used internally by the office365 library for serialization and should not be modified
  • When passing site_creation_data to the constructor, ensure it's an iterable of SiteCreationData objects or None
  • This class inherits from ClientValue, which means it's designed to be serialized and sent to SharePoint REST APIs
  • The SiteCreationData collection can be manipulated after instantiation through the SiteCreationData attribute

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SiteCreationData 85.3% 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 SiteCreationProperties 77.1% similar

    A data class that encapsulates the properties required to create a new SharePoint site, including URL, owner, title, and template information.

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

    SiteScriptCreationInfo is a data transfer object class that inherits from ClientValue, used to encapsulate information required for creating site scripts in SharePoint/Office 365.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sitescripts/creation_info.py
  • class SiteCreationDefaultStorageQuota 73.4% similar

    A class representing the default storage quota configuration for SharePoint site creation, inheriting from ClientValue to provide serialization capabilities for Microsoft Online SharePoint Tenant Administration.

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

    A data transfer object representing site information for SharePoint site picker operations in Microsoft Online SharePoint Tenant Administration.

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