exchangelib.services.unsubscribe API documentation

# Module `exchangelib.services.unsubscribe`

## Classes

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

      class Unsubscribe(EWSAccountService):
          """Unsubscribing is only valid for pull and streaming notifications.

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

          SERVICE_NAME = "Unsubscribe"
          returns_elements = False
          prefer_affinity = True

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

          def get_payload(self, subscription_id):
              payload = create_element(f"m:{self.SERVICE_NAME}")
              add_xml_child(payload, "m:SubscriptionId", subscription_id)
              return payload

  Unsubscribing is only valid for pull and streaming notifications.

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

  ### Ancestors

  - EWSAccountService
  - EWSService
  - SupportedVersionClassMixIn

  ### Class variables

  `var SERVICE_NAME`
  `var prefer_affinity`
  `var returns_elements`

  ### Methods

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

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

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

        def get_payload(self, subscription_id):
            payload = create_element(f"m:{self.SERVICE_NAME}")
            add_xml_child(payload, "m:SubscriptionId", subscription_id)
            return payload

  ### Inherited members

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