exchangelib.services.send_item API documentation

# Module `exchangelib.services.send_item`

## Classes

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

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

          SERVICE_NAME = "SendItem"
          returns_elements = False

          def call(self, items, saved_item_folder):
              if saved_item_folder and not isinstance(saved_item_folder, (BaseFolder, FolderId)):
                  raise InvalidTypeError("saved_item_folder", saved_item_folder, (BaseFolder, FolderId))
              return self._chunked_get_elements(self.get_payload, items=items, saved_item_folder=saved_item_folder)

          def get_payload(self, items, saved_item_folder):
              payload = create_element(f"m:{self.SERVICE_NAME}", attrs=dict(SaveItemToFolder=bool(saved_item_folder)))
              payload.append(item_ids_element(items=items, version=self.account.version))
              if saved_item_folder:
                  payload.append(
                      folder_ids_element(folders=[saved_item_folder], version=self.account.version, tag="m:SavedItemFolderId")
                  )
              return payload

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

  ### Ancestors

  - EWSAccountService
  - EWSService
  - SupportedVersionClassMixIn

  ### Methods

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

        def call(self, items, saved_item_folder):
            if saved_item_folder and not isinstance(saved_item_folder, (BaseFolder, FolderId)):
                raise InvalidTypeError("saved_item_folder", saved_item_folder, (BaseFolder, FolderId))
            return self._chunked_get_elements(self.get_payload, items=items, saved_item_folder=saved_item_folder)

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

        def get_payload(self, items, saved_item_folder):
            payload = create_element(f"m:{self.SERVICE_NAME}", attrs=dict(SaveItemToFolder=bool(saved_item_folder)))
            payload.append(item_ids_element(items=items, version=self.account.version))
            if saved_item_folder:
                payload.append(
                    folder_ids_element(folders=[saved_item_folder], version=self.account.version, tag="m:SavedItemFolderId")
                )
            return payload

  ### Inherited members

  - `EWSAccountService`:
    - `CHUNK_SIZE`
    - `ERRORS_TO_CATCH_IN_RESPONSE`
    - `NO_VALID_SERVER_VERSIONS`
    - `NS_MAP`
    - `SERVICE_NAME`
    - `WARNINGS_TO_CATCH_IN_RESPONSE`
    - `WARNINGS_TO_IGNORE_IN_RESPONSE`
    - `deprecated_from`
    - `element_container_name`
    - `get`
    - `parse`
    - `prefer_affinity`
    - `returns_elements`
    - `supported_api_versions`
    - `supported_from`
    - `wrap`