Interface Client
-
- All Known Implementing Classes:
DefaultClient,UserClient
public interface Client
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <TService> TServicecreate(java.lang.Class<TService> svcClass)default <TService> TServicecreate(java.lang.Class<TService> svcClass, java.lang.String userToken)@NotNull java.lang.StringgetApiKey()@NotNull java.lang.StringgetApiSecret()static ClientgetInstance()default @NotNull EventparseSns(@NotNull java.lang.String notificationBody)Parse an SNS-delivered webhook body (unwrap envelope when needed).default @NotNull EventparseSqs(@NotNull java.lang.String body)Parse an SQS-delivered webhook body (decode only).voidsetTimeout(@NotNull java.time.Duration timeoutDuration)default @NotNull EventverifyAndParseWebhook(@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 signedsignature- value of theX-Signatureheader- 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 messageBodystring- 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-extractedMessage- Returns:
- parsed
Event
-
getInstance
static Client getInstance()
-
-