class PlannerChecklistItems
A specialized collection class that manages checklist items for Microsoft Planner tasks, inheriting from ClientValueCollection to provide collection operations for PlannerChecklistItem objects.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/planner/tasks/check_list_items.py
5 - 14
simple
Purpose
This class represents the collection of checklist items associated with a Microsoft Planner task. It serves as a container for PlannerChecklistItem objects and is part of the task details object in the Microsoft Graph API. As an Open Type collection, it provides type-safe management of checklist items with all the collection operations inherited from ClientValueCollection (such as adding, removing, and iterating over items).
Source Code
class PlannerChecklistItems(ClientValueCollection):
"""The plannerChecklistItemCollection resource represents the collection of checklist items on a task.
It is an Open Type. It is part of the task details object.
The value in the property-value pair is the checklistItem object.
"""
def __init__(self, initial_values=None):
super(PlannerChecklistItems, self).__init__(
PlannerChecklistItem, initial_values
)
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValueCollection | - |
Parameter Details
initial_values: Optional parameter that accepts an initial collection of checklist items to populate the collection upon instantiation. Can be None (default) for an empty collection, or a list/iterable of PlannerChecklistItem objects or compatible data structures that can be converted to PlannerChecklistItem instances.
Return Value
Instantiation returns a PlannerChecklistItems object that acts as a typed collection container for PlannerChecklistItem objects. The collection inherits all methods from ClientValueCollection, which typically include methods for adding, removing, accessing, and iterating over items. Individual method returns depend on the inherited ClientValueCollection interface (e.g., add methods may return the added item, iteration yields PlannerChecklistItem objects).
Class Interface
Methods
__init__(self, initial_values=None)
Purpose: Initializes a new PlannerChecklistItems collection with optional initial checklist items
Parameters:
initial_values: Optional collection of initial PlannerChecklistItem objects or compatible data to populate the collection
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
_item_type |
type | Inherited from ClientValueCollection, stores the type of items in the collection (PlannerChecklistItem) | instance |
_data |
list | Inherited from ClientValueCollection, stores the actual collection of PlannerChecklistItem objects | instance |
Dependencies
office365
Required Imports
from office365.planner.tasks.checklist_items import PlannerChecklistItems
from office365.planner.tasks.check_list_item import PlannerChecklistItem
Usage Example
from office365.planner.tasks.checklist_items import PlannerChecklistItems
from office365.planner.tasks.check_list_item import PlannerChecklistItem
# Create an empty checklist items collection
checklist_items = PlannerChecklistItems()
# Create with initial values
initial_items = [
PlannerChecklistItem(),
PlannerChecklistItem()
]
checklist_items = PlannerChecklistItems(initial_values=initial_items)
# Typically used as part of task details
# task.details.checklist = checklist_items
# Inherited collection operations (from ClientValueCollection)
# checklist_items.add(new_item)
# for item in checklist_items:
# print(item)
# item_count = len(checklist_items)
Best Practices
- Always instantiate with the appropriate initial_values if you have existing checklist items to avoid multiple operations
- Use inherited collection methods from ClientValueCollection for adding, removing, and accessing items rather than direct manipulation
- This collection is typically accessed through a PlannerTask's details object rather than instantiated directly in most use cases
- Ensure proper authentication and permissions are configured before attempting to read or modify checklist items
- The collection is part of the task details object, so changes may need to be persisted through the parent task object's update methods
- As an Open Type, the collection can accept additional properties beyond the standard schema
- Remember that this is a client-side collection representation; actual persistence requires API calls through the parent task object
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class PlannerChecklistItem 87.2% similar
-
class PlannerPlanCollection 70.4% similar
-
class ChecklistItem 70.3% similar
-
class TodoTaskListCollection 62.2% similar
-
class PlannerPlan 61.6% similar