class CreatableItemInfoCollection
A collection class that wraps and manages a list of CreatableItemInfo objects, inheriting from ClientValue to provide client-side value semantics.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/creatable_item_info.py
13 - 21
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
-
class ChannelInfoCollection 72.8% similar
-
class CurrencyInformationCollection 67.7% similar
-
class CreatablesInfo 67.5% similar
-
class WebInfoCreationInformation 66.7% similar