exchangelib.services.empty_folder API documentation

# Module `exchangelib.services.empty_folder`

## Classes

`class EmptyFolder (*args, **kwargs)`
  Expand source code

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

          SERVICE_NAME = "EmptyFolder"
          returns_elements = False

          def call(self, folders, delete_type, delete_sub_folders):
              if delete_type not in DELETE_TYPE_CHOICES:
                  raise InvalidEnumValue("delete_type", delete_type, DELETE_TYPE_CHOICES)
              return self._chunked_get_elements(
                  self.get_payload, items=folders, delete_type=delete_type, delete_sub_folders=delete_sub_folders
              )

          def get_payload(self, folders, delete_type, delete_sub_folders):
              payload = create_element(
                  f"m:{self.SERVICE_NAME}", attrs=dict(DeleteType=delete_type, DeleteSubFolders=delete_sub_folders)
              )
              payload.append(folder_ids_element(folders=folders, version=self.account.version))
              return payload

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

  ### Ancestors

  - EWSAccountService
  - EWSService
  - SupportedVersionClassMixIn

  ### Class variables

  `var SERVICE_NAME`
  `var returns_elements`

  ### Methods

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

        def call(self, folders, delete_type, delete_sub_folders):
            if delete_type not in DELETE_TYPE_CHOICES:
                raise InvalidEnumValue("delete_type", delete_type, DELETE_TYPE_CHOICES)
            return self._chunked_get_elements(
                self.get_payload, items=folders, delete_type=delete_type, delete_sub_folders=delete_sub_folders
            )

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

        def get_payload(self, folders, delete_type, delete_sub_folders):
            payload = create_element(
                f"m:{self.SERVICE_NAME}", attrs=dict(DeleteType=delete_type, DeleteSubFolders=delete_sub_folders)
            )
            payload.append(folder_ids_element(folders=folders, version=self.account.version))
            return payload

  ### Inherited members

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