exchangelib.services.get_mail_tips API documentation

# Module `exchangelib.services.get_mail_tips`

## Classes

`class GetMailTips (protocol, chunk_size=None, timeout=None)`
  Expand source code

      class GetMailTips(EWSService):
          """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/getmailtips-operation"""

          SERVICE_NAME = "GetMailTips"

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

          def _elem_to_obj(self, elem):
              return MailTips.from_xml(elem=elem, account=None)

          def get_payload(self, recipients, sending_as, mail_tips_requested):
              payload = create_element(f"m:{self.SERVICE_NAME}")
              set_xml_value(payload, sending_as, version=self.protocol.version)

              recipients_elem = create_element("m:Recipients")
              for recipient in recipients:
                  set_xml_value(recipients_elem, recipient, version=self.protocol.version)
              payload.append(recipients_elem)

              if mail_tips_requested:
                  set_xml_value(payload, mail_tips_requested, version=self.protocol.version)
              return payload

          def _get_elements_in_response(self, response):
              for msg in response:
                  yield self._get_element_container(message=msg, name=MailTips.response_tag())

          @classmethod
          def _response_message_tag(cls):
              return f"{{{MNS}}}MailTipsResponseMessageType"

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

  ### Ancestors

  - EWSService
  - SupportedVersionClassMixIn

  ### Methods

  `def call(self, sending_as, recipients, mail_tips_requested)`
    Expand source code

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

  `def get_payload(self, recipients, sending_as, mail_tips_requested)`
    Expand source code

        def get_payload(self, recipients, sending_as, mail_tips_requested):
            payload = create_element(f"m:{self.SERVICE_NAME}")
            set_xml_value(payload, sending_as, version=self.protocol.version)

            recipients_elem = create_element("m:Recipients")
            for recipient in recipients:
                set_xml_value(recipients_elem, recipient, version=self.protocol.version)
            payload.append(recipients_elem)

            if mail_tips_requested:
                set_xml_value(payload, mail_tips_requested, version=self.protocol.version)
            return payload

  ### Inherited members

  - `EWSService`:
    - `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`
    - `returns_elements`
    - `supported_api_versions`
    - `supported_from`
    - `wrap`