exchangelib.services.get_user_oof_settings API documentation

# Module `exchangelib.services.get_user_oof_settings`

## Classes

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

      class GetUserOofSettings(EWSAccountService):
          """Get automatic reply settings for the specified mailbox.
          MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/getuseroofsettings-operation
          """

          SERVICE_NAME = "GetUserOofSettings"
          element_container_name = f"{{{TNS}}}OofSettings"

          def call(self, mailbox):
              return self._elems_to_objs(self._get_elements(payload=self.get_payload(mailbox=mailbox)))

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

          def get_payload(self, mailbox):
              return set_xml_value(
                  create_element(f"m:{self.SERVICE_NAME}Request"),
                  AvailabilityMailbox.from_mailbox(mailbox),
                  version=self.account.version,
              )

          @classmethod
          def _get_elements_in_container(cls, container):
              # This service only returns one result, directly in 'container'
              return [container]

          def _get_element_container(self, message, name=None):
              # This service returns the result container outside the response message
              super()._get_element_container(message=message.find(self._response_message_tag()), name=None)
              return message.find(name)

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

  Get automatic reply settings for the specified mailbox. MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/getuseroofsettings-operation

  ### Ancestors

  - EWSAccountService
  - EWSService
  - SupportedVersionClassMixIn

  ### Methods

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

        def call(self, mailbox):
            return self._elems_to_objs(self._get_elements(payload=self.get_payload(mailbox=mailbox)))

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

        def get_payload(self, mailbox):
            return set_xml_value(
                create_element(f"m:{self.SERVICE_NAME}Request"),
                AvailabilityMailbox.from_mailbox(mailbox),
                version=self.account.version,
            )

  ### 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`