exchangelib.services.delete_folder API documentation

# Module `exchangelib.services.delete_folder`

Expand source code

    from .common import EWSAccountService, create_folder_ids_element
    from ..util import create_element

    class DeleteFolder(EWSAccountService):
        """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/deletefolder-operation"""

        SERVICE_NAME = 'DeleteFolder'
        returns_elements = False

        def call(self, folders, delete_type):
            return self._chunked_get_elements(self.get_payload, items=folders, delete_type=delete_type)

        def get_payload(self, folders, delete_type):
            deletefolder = create_element('m:%s' % self.SERVICE_NAME, attrs=dict(DeleteType=delete_type))
            folder_ids = create_folder_ids_element(tag='m:FolderIds', folders=folders, version=self.account.version)
            deletefolder.append(folder_ids)
            return deletefolder

## Classes

`class DeleteFolder (*args, **kwargs)`

  MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/deletefolder-operation

  Expand source code

      class DeleteFolder(EWSAccountService):
          """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/deletefolder-operation"""

          SERVICE_NAME = 'DeleteFolder'
          returns_elements = False

          def call(self, folders, delete_type):
              return self._chunked_get_elements(self.get_payload, items=folders, delete_type=delete_type)

          def get_payload(self, folders, delete_type):
              deletefolder = create_element('m:%s' % self.SERVICE_NAME, attrs=dict(DeleteType=delete_type))
              folder_ids = create_folder_ids_element(tag='m:FolderIds', folders=folders, version=self.account.version)
              deletefolder.append(folder_ids)
              return deletefolder

  ### Ancestors

  - EWSAccountService
  - EWSService

  ### Class variables

  `var SERVICE_NAME`
  `var returns_elements`

  ### Methods

  `def call(self, folders, delete_type)`
    Expand source code

        def call(self, folders, delete_type):
            return self._chunked_get_elements(self.get_payload, items=folders, delete_type=delete_type)

  `def get_payload(self, folders, delete_type)`
    Expand source code

        def get_payload(self, folders, delete_type):
            deletefolder = create_element('m:%s' % self.SERVICE_NAME, attrs=dict(DeleteType=delete_type))
            folder_ids = create_folder_ids_element(tag='m:FolderIds', folders=folders, version=self.account.version)
            deletefolder.append(folder_ids)
            return deletefolder

  ### Inherited members

  - `EWSAccountService`:
    - `NO_VALID_SERVER_VERSIONS`
    - `WARNINGS_TO_CATCH_IN_RESPONSE`
    - `get`
    - `parse`