🔍 Code Extractor

class RecycleBinItemCollection

Maturity: 32

Represents a collection of View resources.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/recyclebin/item_collection.py
Lines:
8 - 75
Complexity:
moderate

Purpose

Represents a collection of View resources.

Source Code

class RecycleBinItemCollection(EntityCollection[RecycleBinItem]):
    """Represents a collection of View resources."""

    def __init__(self, context, resource_path=None):
        super(RecycleBinItemCollection, self).__init__(
            context, RecycleBinItem, resource_path
        )

    def delete_all_second_stage_items(self):
        """Permanently deletes all Recycle Bin items in the second-stage Recycle Bin"""
        qry = ServiceOperationQuery(self, "DeleteAllSecondStageItems")
        self.context.add_query(qry)
        return self

    def delete_by_ids(self, ids):
        """
        Permanently deletes Recycle Bin items by their identifiers

        :param list[str] ids: Recycle Bin items identifiers
        """
        payload = {"ids": StringCollection(ids)}
        qry = ServiceOperationQuery(self, "DeleteByIds", None, payload)
        self.context.add_query(qry)
        return self

    def move_to_second_stage_by_ids(self, ids):
        """
        Moves all Recycle Bin items from the first-stage Recycle Bin to the second-stage Recycle Bin by their identifies

        :param list[str] ids: Recycle Bin items identifiers
        """
        payload = {"ids": StringCollection(ids)}
        qry = ServiceOperationQuery(self, "MoveToSecondStageByIds", None, payload)
        self.context.add_query(qry)
        return self

    def move_all_to_second_stage(self):
        """
        Moves all Recycle Bin items from the first-stage Recycle Bin to the second-stage Recycle Bin if the
        SecondStageRecycleBinQuota property of the current web application is not 0.
        Otherwise, permanently deletes all Recycle Bin items.
        """
        qry = ServiceOperationQuery(self, "MoveAllToSecondStage")
        self.context.add_query(qry)
        return self

    def get_by_id(self, recycle_bin_id):
        """
        Returns the recycle bin type with the given identifier from the collection.

        :param str recycle_bin_id: A hexadecimal value representing the identifier of a recycle bin.
        """
        return RecycleBinItem(
            self.context,
            ServiceOperationPath("GetById", [recycle_bin_id], self.resource_path),
        )

    def delete_all(self):
        """Permanently deletes all Recycle Bin items."""
        qry = ServiceOperationQuery(self, "DeleteAll")
        self.context.add_query(qry)
        return self

    def restore_all(self):
        """Restores all Recycle Bin items to their original locations."""
        qry = ServiceOperationQuery(self, "RestoreAll")
        self.context.add_query(qry)
        return self

Parameters

Name Type Default Kind
bases EntityCollection[RecycleBinItem] -

Parameter Details

bases: Parameter of type EntityCollection[RecycleBinItem]

Return Value

Returns unspecified type

Class Interface

Methods

__init__(self, context, resource_path)

Purpose: Internal method: init

Parameters:

  • context: Parameter
  • resource_path: Parameter

Returns: None

delete_all_second_stage_items(self)

Purpose: Permanently deletes all Recycle Bin items in the second-stage Recycle Bin

Returns: None

delete_by_ids(self, ids)

Purpose: Permanently deletes Recycle Bin items by their identifiers :param list[str] ids: Recycle Bin items identifiers

Parameters:

  • ids: Parameter

Returns: None

move_to_second_stage_by_ids(self, ids)

Purpose: Moves all Recycle Bin items from the first-stage Recycle Bin to the second-stage Recycle Bin by their identifies :param list[str] ids: Recycle Bin items identifiers

Parameters:

  • ids: Parameter

Returns: None

move_all_to_second_stage(self)

Purpose: Moves all Recycle Bin items from the first-stage Recycle Bin to the second-stage Recycle Bin if the SecondStageRecycleBinQuota property of the current web application is not 0. Otherwise, permanently deletes all Recycle Bin items.

Returns: None

get_by_id(self, recycle_bin_id)

Purpose: Returns the recycle bin type with the given identifier from the collection. :param str recycle_bin_id: A hexadecimal value representing the identifier of a recycle bin.

Parameters:

  • recycle_bin_id: Parameter

Returns: See docstring for return details

delete_all(self)

Purpose: Permanently deletes all Recycle Bin items.

Returns: None

restore_all(self)

Purpose: Restores all Recycle Bin items to their original locations.

Returns: None

Required Imports

from office365.runtime.paths.service_operation import ServiceOperationPath
from office365.runtime.queries.service_operation import ServiceOperationQuery
from office365.runtime.types.collections import StringCollection
from office365.sharepoint.entity_collection import EntityCollection
from office365.sharepoint.recyclebin.item import RecycleBinItem

Usage Example

# Example usage:
# result = RecycleBinItemCollection(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class RecycleBinItem 80.6% similar

    Represents a Recycle Bin item in the Recycle Bin of a site or a site collection.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/recyclebin/item.py
  • class RecycleBinQueryInformation 64.2% similar

    A data class that encapsulates query parameters for retrieving items from a SharePoint recycle bin, including filtering, sorting, and pagination options.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/recyclebin/query_information.py
  • class ViewFieldCollection 60.8% similar

    Represents a collection of Field resources.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/views/field_collection.py
  • class ViewCollection 59.3% similar

    A collection class that manages SharePoint View resources, providing methods to add, retrieve, and manage list views within a SharePoint list.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/views/collection.py
  • class FolderCollection 57.6% similar

    Represents a collection of Folder resources.

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