🔍 Code Extractor

class CurrencyInformationCollection

Maturity: 37

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

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/currency_information_collection.py
Lines:
6 - 10
Complexity:
simple

Purpose

This class serves as a container for managing multiple CurrencyInformation objects. It inherits from ClientValue, making it compatible with SharePoint's client-side object model. The class wraps a ClientValueCollection to provide type-safe storage and manipulation of currency information objects, typically used when working with SharePoint lists that support multiple currencies.

Source Code

class CurrencyInformationCollection(ClientValue):
    """List of supported currencies: contains CurrencyInformation objects."""

    def __init__(self, items=None):
        self.Items = ClientValueCollection(CurrencyInformation, items)

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

items: Optional parameter that accepts an initial collection of CurrencyInformation objects or compatible data to populate the collection. Can be None (default) to create an empty collection, a list of CurrencyInformation objects, or data that can be converted to CurrencyInformation objects.

Return Value

Instantiation returns a CurrencyInformationCollection object with an Items attribute containing a ClientValueCollection of CurrencyInformation objects. The collection can be empty or pre-populated based on the items parameter.

Class Interface

Methods

__init__(self, items=None)

Purpose: Initializes a new CurrencyInformationCollection instance with an optional list of currency items

Parameters:

  • items: Optional initial collection of CurrencyInformation objects or compatible data. Defaults to None for an empty collection.

Returns: None (constructor)

Attributes

Name Type Description Scope
Items ClientValueCollection[CurrencyInformation] A ClientValueCollection instance that stores and manages CurrencyInformation objects. Provides collection operations like iteration, adding, and removing currency information items. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.lists.currency_information import CurrencyInformation

Usage Example

from office365.sharepoint.lists.currency_information_collection import CurrencyInformationCollection
from office365.sharepoint.lists.currency_information import CurrencyInformation

# Create an empty collection
currency_collection = CurrencyInformationCollection()

# Create a collection with initial items
initial_currencies = [
    CurrencyInformation(),
    CurrencyInformation()
]
currency_collection = CurrencyInformationCollection(items=initial_currencies)

# Access the items in the collection
for currency in currency_collection.Items:
    # Process each CurrencyInformation object
    pass

# Add items to the collection
currency_collection.Items.add(CurrencyInformation())

Best Practices

  • Always initialize the collection before accessing the Items attribute to avoid AttributeError
  • Use the Items attribute to access the underlying ClientValueCollection for iteration and manipulation
  • When passing initial items, ensure they are CurrencyInformation objects or compatible data structures
  • This class is typically instantiated by SharePoint API responses rather than manually created
  • The collection inherits from ClientValue, so it can be serialized/deserialized for SharePoint API communication
  • Do not directly modify the Items attribute; use the collection methods provided by ClientValueCollection (add, remove, etc.)
  • This class is immutable in terms of its structure - the Items attribute is set once during initialization

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class CurrencyInformation 76.9% similar

    A data class that encapsulates currency information including display formatting, language/culture settings, and locale identifiers for UI presentation.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/currency_information.py
  • class CurrencyList 75.0% similar

    A SharePoint entity class that provides access to the list of supported currencies in SharePoint currency columns.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/currency.py
  • class ChannelInfoCollection 71.2% 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 FieldCurrency 68.5% similar

    A SharePoint field class that represents currency values, extending FieldNumber with currency-specific formatting capabilities.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/fields/currency.py
  • class CreatableItemInfoCollection 67.7% similar

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

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