Interface Client

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <TService> TService create​(java.lang.Class<TService> svcClass)  
      default <TService> TService create​(java.lang.Class<TService> svcClass, java.lang.String userToken)  
      @NotNull java.lang.String getApiKey()  
      @NotNull java.lang.String getApiSecret()  
      static Client getInstance()  
      default @NotNull Event parseSns​(@NotNull java.lang.String notificationBody)
      Parse an SNS-delivered webhook body (unwrap envelope when needed).
      default @NotNull Event parseSqs​(@NotNull java.lang.String body)
      Parse an SQS-delivered webhook body (decode only).
      void setTimeout​(@NotNull java.time.Duration timeoutDuration)  
      default @NotNull Event verifyAndParseWebhook​(@org.jetbrains.annotations.NotNull byte[] body, @NotNull java.lang.String signature)
      Verify and parse an HTTP webhook event using this client's API secret.
    • Method Detail

      • create

        @NotNull
        <TService> TService create​(java.lang.Class<TService> svcClass)
      • create

        @NotNull
        default <TService> TService create​(java.lang.Class<TService> svcClass,
                                           java.lang.String userToken)
      • getApiKey

        @NotNull
        @NotNull java.lang.String getApiKey()
      • getApiSecret

        @NotNull
        @NotNull java.lang.String getApiSecret()
      • setTimeout

        void setTimeout​(@NotNull
                        @NotNull java.time.Duration timeoutDuration)
      • verifyAndParseWebhook

        @NotNull
        default @NotNull Event verifyAndParseWebhook​(@NotNull
                                                     @org.jetbrains.annotations.NotNull byte[] body,
                                                     @NotNull
                                                     @NotNull java.lang.String signature)
        Verify and parse an HTTP webhook event using this client's API secret.

        Instance-method counterpart to App.verifyAndParseWebhook(byte[], String, String); the call site stays a two-argument one-liner because the secret comes from the client.

        Parameters:
        body - raw HTTP request body bytes Stream signed
        signature - value of the X-Signature header
        Returns:
        parsed Event
      • parseSqs

        @NotNull
        default @NotNull Event parseSqs​(@NotNull
                                        @NotNull java.lang.String body)
        Parse an SQS-delivered webhook body (decode only).

        Instance-method counterpart to App.parseSqs(String).

        Parameters:
        body - SQS message Body string
        Returns:
        parsed Event
      • parseSns

        @NotNull
        default @NotNull Event parseSns​(@NotNull
                                        @NotNull java.lang.String notificationBody)
        Parse an SNS-delivered webhook body (unwrap envelope when needed).

        Instance-method counterpart to App.parseSns(String).

        Parameters:
        notificationBody - raw SNS POST body or pre-extracted Message
        Returns:
        parsed Event
      • getInstance

        static Client getInstance()