class ChannelInfoCollection
A collection class that manages and stores multiple ChannelInfo objects, inheriting from ClientValue to provide SharePoint Portal channel information collection functionality.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/channels/info_collection.py
6 - 12
simple
Purpose
ChannelInfoCollection serves as a container for managing collections of ChannelInfo objects within the SharePoint Portal context. It wraps a ClientValueCollection to provide type-safe storage and manipulation of channel information, with proper entity type identification for SharePoint API interactions. This class is typically used when working with multiple channels in SharePoint Portal operations.
Source Code
class ChannelInfoCollection(ClientValue):
def __init__(self, value=None):
self.value = ClientValueCollection(ChannelInfo, value)
@property
def entity_type_name(self):
return "Microsoft.SharePoint.Portal.ChannelInfoCollection"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
value: Optional initial value to populate the collection. Can be None (creates empty collection), a list of ChannelInfo objects, or compatible data structure that ClientValueCollection can process. Defaults to None if not provided.
Return Value
Instantiation returns a ChannelInfoCollection object containing a ClientValueCollection of ChannelInfo objects. The entity_type_name property returns the string 'Microsoft.SharePoint.Portal.ChannelInfoCollection' which identifies this collection type in SharePoint API operations.
Class Interface
Methods
__init__(self, value=None)
Purpose: Initializes a new ChannelInfoCollection instance with an optional initial value
Parameters:
value: Optional initial collection data, can be None, a list of ChannelInfo objects, or compatible data structure
Returns: None (constructor)
@property entity_type_name(self) -> str
property
Purpose: Returns the SharePoint entity type name for this collection, used in API operations
Returns: String 'Microsoft.SharePoint.Portal.ChannelInfoCollection' identifying the collection type in SharePoint
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
value |
ClientValueCollection | The underlying collection that stores ChannelInfo objects, providing collection management functionality | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.portal.channels.info import ChannelInfo
Usage Example
from office365.sharepoint.portal.channels.info import ChannelInfo
from office365.sharepoint.portal.channels.info_collection import ChannelInfoCollection
# Create an empty collection
channel_collection = ChannelInfoCollection()
# Create collection with initial values
initial_channels = [ChannelInfo(), ChannelInfo()]
channel_collection = ChannelInfoCollection(value=initial_channels)
# Access the underlying collection
channels = channel_collection.value
# Get the entity type name for SharePoint API operations
entity_type = channel_collection.entity_type_name
print(entity_type) # Output: Microsoft.SharePoint.Portal.ChannelInfoCollection
Best Practices
- Always initialize with appropriate ChannelInfo objects or None to ensure type safety
- Use the entity_type_name property when making SharePoint API calls that require entity type identification
- Access the underlying collection through the 'value' attribute for iteration and manipulation
- This class is immutable in terms of its entity_type_name, which is fixed for SharePoint API compatibility
- Ensure proper SharePoint context is established before creating and using instances of this class
- The class inherits from ClientValue, so it can be serialized for SharePoint API requests
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ChannelInfo 83.4% similar
-
class VideoChannelCollection 75.2% similar
-
class CreatableItemInfoCollection 72.8% similar
-
class CurrencyInformationCollection 71.2% similar
-
class WebInformationCollection 66.8% similar