exchangelib.services.export_items API documentation

# Module `exchangelib.services.export_items`

Expand source code

    from ..errors import ResponseMessageError
    from ..util import MNS, create_element
    from .common import EWSAccountService, item_ids_element

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

        ERRORS_TO_CATCH_IN_RESPONSE = ResponseMessageError
        SERVICE_NAME = "ExportItems"
        element_container_name = f"{{{MNS}}}Data"

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

        def _elem_to_obj(self, elem):
            return elem.text  # All we want is the 64bit string in the 'Data' tag

        def get_payload(self, items):
            payload = create_element(f"m:{self.SERVICE_NAME}")
            payload.append(item_ids_element(items=items, version=self.account.version))
            return payload

        # We need to override this since ExportItemsResponseMessage is formatted a bit differently.
        @classmethod
        def _get_elements_in_container(cls, container):
            return [container]

## Classes

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

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

  Expand source code

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

          ERRORS_TO_CATCH_IN_RESPONSE = ResponseMessageError
          SERVICE_NAME = "ExportItems"
          element_container_name = f"{{{MNS}}}Data"

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

          def _elem_to_obj(self, elem):
              return elem.text  # All we want is the 64bit string in the 'Data' tag

          def get_payload(self, items):
              payload = create_element(f"m:{self.SERVICE_NAME}")
              payload.append(item_ids_element(items=items, version=self.account.version))
              return payload

          # We need to override this since ExportItemsResponseMessage is formatted a bit differently.
          @classmethod
          def _get_elements_in_container(cls, container):
              return [container]

  ### Ancestors

  - EWSAccountService
  - EWSService
  - SupportedVersionClassMixIn

  ### Class variables

  `var ERRORS_TO_CATCH_IN_RESPONSE`

    Global error type within this module.

  `var SERVICE_NAME`
  `var element_container_name`

  ### Methods

  `def call(self, items)`
    Expand source code

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

  `def get_payload(self, items)`
    Expand source code

        def get_payload(self, items):
            payload = create_element(f"m:{self.SERVICE_NAME}")
            payload.append(item_ids_element(items=items, version=self.account.version))
            return payload

  ### Inherited members

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