class ListItemDeleteParameters
A parameter class that encapsulates configuration options for deleting list items in SharePoint/Office365, specifically controlling whether to bypass shared locks during deletion.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/listitems/delete_parameters.py
4 - 9
simple
Purpose
This class serves as a data transfer object (DTO) for specifying parameters when deleting list items in SharePoint/Office365 environments. It inherits from ClientValue, which is part of the Office365 REST API client framework, and is used to serialize deletion parameters when making API calls to delete list items. The primary use case is to control whether shared locks should be bypassed during the deletion operation, which can be important in collaborative environments where items may be locked by other users or processes.
Source Code
class ListItemDeleteParameters(ClientValue):
def __init__(self, bypass_shared_lock=None):
"""
:param bool bypass_shared_lock:
"""
self.BypassSharedLock = bypass_shared_lock
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
bypass_shared_lock: A boolean flag that determines whether to bypass shared locks when deleting a list item. When set to True, the deletion will proceed even if the item has a shared lock from another user or process. When set to False or None, the deletion will respect existing shared locks and may fail if the item is locked. This parameter is optional and defaults to None if not specified.
Return Value
Instantiation of this class returns a ListItemDeleteParameters object that can be passed to SharePoint/Office365 API methods for deleting list items. The object itself doesn't return values from methods (as it has no public methods beyond the constructor), but serves as a container for deletion parameters that will be serialized and sent to the API.
Class Interface
Methods
__init__(self, bypass_shared_lock=None)
Purpose: Initializes a new instance of ListItemDeleteParameters with optional configuration for bypassing shared locks
Parameters:
bypass_shared_lock: Optional boolean flag to control whether shared locks should be bypassed during deletion. Defaults to None.
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
BypassSharedLock |
bool or None | Stores the bypass shared lock flag that determines whether to bypass shared locks when deleting a list item. This attribute follows PascalCase naming convention typical of SharePoint/Office365 API properties for proper serialization. | instance |
Dependencies
office365-runtime
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
from office365.sharepoint.listitems.delete_parameters import ListItemDeleteParameters
# Create parameters to delete a list item while bypassing shared locks
delete_params = ListItemDeleteParameters(bypass_shared_lock=True)
# Create parameters with default behavior (respecting shared locks)
delete_params_default = ListItemDeleteParameters()
# Create parameters explicitly respecting shared locks
delete_params_respect_lock = ListItemDeleteParameters(bypass_shared_lock=False)
# Typically used with a list item deletion method:
# list_item.delete_object(delete_params).execute_query()
Best Practices
- Always consider the implications of bypassing shared locks - this should only be done when you have appropriate permissions and understand the collaborative context
- This class is immutable after instantiation - create a new instance if you need different parameters
- The class is designed to be used as a parameter object passed to list item deletion methods in the Office365 API client
- Inherits from ClientValue which provides serialization capabilities for REST API communication
- When bypass_shared_lock is None, the API will use its default behavior for handling shared locks
- This is a lightweight parameter object with no complex lifecycle - simply instantiate, use, and discard
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ListItemUpdateParameters 78.7% similar
-
class FolderDeleteParameters 78.1% similar
-
class GetListItemVersionsParameters 71.2% similar
-
class GetListsParameters 71.0% similar
-
class RenderListDataOverrideParameters 68.6% similar