🔍 Code Extractor

class CreatableItemInfoCollection

Maturity: 40

A collection class that wraps and manages a list of CreatableItemInfo objects, inheriting from ClientValue to provide client-side value semantics.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/creatable_item_info.py
Lines:
13 - 21
Complexity:
simple

Purpose

This class serves as a specialized container for CreatableItemInfo objects in the Office365 API context. It provides a structured way to handle collections of creatable item information, likely used when working with SharePoint or other Office365 services that need to manage multiple creatable items. The class leverages ClientValueCollection for internal storage and management of the items, ensuring proper serialization and deserialization in client-server communications.

Source Code

class CreatableItemInfoCollection(ClientValue):
    """Represents a collection of CreatableItemInfo (section 3.2.5.283) objects."""

    def __init__(self, items=None):
        """
        :param list[CreatableItemInfo] items:
        """
        super(CreatableItemInfoCollection, self).__init__()
        self.Items = ClientValueCollection(CreatableItemInfo, items)

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

items: An optional list of CreatableItemInfo objects to initialize the collection with. Can be None to create an empty collection, or a list of pre-existing CreatableItemInfo instances. This parameter is passed directly to the ClientValueCollection constructor for proper initialization.

Return Value

Instantiation returns a CreatableItemInfoCollection object that contains a ClientValueCollection of CreatableItemInfo objects accessible via the Items attribute. The collection can be empty or pre-populated based on the items parameter provided during initialization.

Class Interface

Methods

__init__(self, items=None) -> None

Purpose: Initializes a new CreatableItemInfoCollection instance with an optional list of CreatableItemInfo objects

Parameters:

  • items: Optional list of CreatableItemInfo objects to populate the collection. Defaults to None for an empty collection.

Returns: None - this is a constructor

Attributes

Name Type Description Scope
Items ClientValueCollection[CreatableItemInfo] A ClientValueCollection that stores and manages the CreatableItemInfo objects in this collection. Provides methods for adding, removing, and iterating over items. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection

Usage Example

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.listitems.creatable_item_info import CreatableItemInfo

# Create an empty collection
collection = CreatableItemInfoCollection()

# Create a collection with existing items
item1 = CreatableItemInfo()
item2 = CreatableItemInfo()
collection_with_items = CreatableItemInfoCollection([item1, item2])

# Access the items
items = collection_with_items.Items

# Add more items to the collection
new_item = CreatableItemInfo()
collection_with_items.Items.add(new_item)

Best Practices

  • Always initialize with a list of CreatableItemInfo objects or None, not other types
  • Access items through the Items attribute which is a ClientValueCollection
  • The class inherits from ClientValue, so it supports serialization for Office365 API calls
  • Use ClientValueCollection methods (like add, remove) to manipulate the Items collection
  • This class is typically used as part of larger Office365 API operations, not in isolation
  • The collection is mutable through the Items attribute, allowing dynamic addition/removal of items

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class CreatableItemInfo 79.1% similar

    A data class representing information about a creatable item in SharePoint/Office 365, including what the item is and where to create it.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/creatable_item_info.py
  • class ChannelInfoCollection 72.8% similar

    A collection class that manages and stores multiple ChannelInfo objects, inheriting from ClientValue to provide SharePoint Portal channel information collection functionality.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/channels/info_collection.py
  • class CurrencyInformationCollection 67.7% similar

    A collection class that holds a list of CurrencyInformation objects representing supported currencies in SharePoint.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/currency_information_collection.py
  • class CreatablesInfo 67.5% similar

    A SharePoint entity class that provides information about what types of content (folders, items, files) can be created in a SharePoint list, along with links to create them.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/creatables_info.py
  • class WebInfoCreationInformation 66.7% 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
← Back to Browse