🔍 Code Extractor

class GetListItemVersionsParameters

Maturity: 32

A parameter class for configuring list item version retrieval operations in SharePoint, allowing control over result limits and sort order.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/listitems/versions/get_parameters.py
Lines:
4 - 13
Complexity:
simple

Purpose

This class encapsulates parameters used when retrieving versions of SharePoint list items. It inherits from ClientValue, which is part of the Office365 REST API framework, and provides a structured way to specify how many versions to retrieve and whether they should be sorted in descending order. This class is typically used as a parameter object when calling SharePoint API methods that fetch list item version history.

Source Code

class GetListItemVersionsParameters(ClientValue):
    """"""

    def __init__(self, row_limit=None, sort_descending=None):
        """
        :param int row_limit:
        :param bool sort_descending:
        """
        self.RowLimit = row_limit
        self.SortDescending = sort_descending

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

row_limit: An integer specifying the maximum number of list item versions to retrieve. If None, no limit is applied and all versions may be returned. This helps control the size of the result set and manage performance when dealing with items that have many versions.

sort_descending: A boolean flag indicating whether versions should be sorted in descending order (True) or ascending order (False). When True, the most recent versions appear first. If None, the default sorting behavior of the API is used.

Return Value

Instantiation returns a GetListItemVersionsParameters object with RowLimit and SortDescending attributes set according to the provided parameters. This object is typically passed to SharePoint API methods that retrieve list item versions, where it is serialized as part of the API request.

Class Interface

Methods

__init__(self, row_limit=None, sort_descending=None)

Purpose: Initializes a new instance of GetListItemVersionsParameters with optional row limit and sort order configuration

Parameters:

  • row_limit: Optional integer specifying the maximum number of versions to retrieve
  • sort_descending: Optional boolean indicating whether to sort versions in descending order

Returns: None (constructor)

Attributes

Name Type Description Scope
RowLimit int or None The maximum number of list item versions to retrieve. None indicates no limit. instance
SortDescending bool or None Flag indicating whether versions should be sorted in descending order. None uses default API behavior. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue

Usage Example

from office365.runtime.client_value import ClientValue
from office365.sharepoint.listitems.versions.get_parameters import GetListItemVersionsParameters

# Create parameters to get the 10 most recent versions
params = GetListItemVersionsParameters(row_limit=10, sort_descending=True)

# Access the configured parameters
print(f"Row Limit: {params.RowLimit}")
print(f"Sort Descending: {params.SortDescending}")

# Typically used with SharePoint list item methods:
# list_item.versions.get_by_parameters(params)

Best Practices

  • Always specify row_limit when dealing with list items that may have many versions to avoid performance issues and large data transfers
  • Set sort_descending=True when you need the most recent versions first, which is the most common use case
  • This class is immutable after instantiation - create a new instance if you need different parameters
  • The class inherits from ClientValue, which means it will be automatically serialized when used in Office365 API calls
  • Both parameters are optional and can be None, allowing flexible configuration based on specific requirements

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class GetListsParameters 77.2% similar

    A parameter class for configuring SharePoint list retrieval operations, encapsulating position and row limit settings.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/lists/get_parameters.py
  • class ListItemUpdateParameters 76.1% similar

    A parameter class for updating SharePoint list items, inheriting from ClientValue to represent client-side values in Office 365 operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/listitems/update_parameters.py
  • class ListItemDeleteParameters 71.2% similar

    A parameter class that encapsulates configuration options for deleting list items in SharePoint/Office365, specifically controlling whether to bypass shared locks during deletion.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/listitems/delete_parameters.py
  • class ListItemVersionCollectionPosition 68.5% similar

    A class representing the position of a list item version within a collection in SharePoint/Office365, inheriting from ClientValue to provide client-side value representation.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/listitems/versions/collection_position.py
  • class ListItemVersionCollection 67.1% similar

    A collection class that manages and provides access to versions of a SharePoint list item, inheriting from EntityCollection with ListItemVersion as the entity type.

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