Package ai.extend.wrapper.webhooks
Interface RawWebhookEvent
-
- All Known Implementing Classes:
VerifyAndParseResult
public interface RawWebhookEventUnion type representing either a normal typed webhook event or one with a signed URL payload.This is the Java equivalent of TypeScript's
RawWebhookEventand Python'sRawWebhookEvent. UseisSignedUrlEvent()to narrow the type, then callgetEvent()orgetSignedUrlEvent()as appropriate.Usage
RawWebhookEvent raw = webhooks.verifyAndParseWithOptions(body, headers, secret, VerifyAndParseOptions.builder().allowSignedUrl(true).build()); if (raw.isSignedUrlEvent()) { WebhookEventWithSignedUrl signedEvent = raw.getSignedUrlEvent(); WebhookEvent full = webhooks.fetchSignedPayload(signedEvent); } else { WebhookEvent event = raw.getEvent(); event.visit(...); }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebhookEventgetEvent()Returns the typed webhook event when this is a normal (inline) event.java.lang.StringgetEventId()Returns the event ID (works for both normal and signed URL events).java.lang.StringgetEventType()Returns the event type string (e.g.WebhookEventWithSignedUrlgetSignedUrlEvent()Returns the signed URL event when the payload was delivered via URL.booleanisSignedUrlEvent()Returns true if this is a signed URL event (payload delivered via URL).
-
-
-
Method Detail
-
isSignedUrlEvent
boolean isSignedUrlEvent()
Returns true if this is a signed URL event (payload delivered via URL).
-
getEvent
WebhookEvent getEvent()
Returns the typed webhook event when this is a normal (inline) event.- Throws:
java.lang.IllegalStateException- if this is a signed URL event
-
getSignedUrlEvent
WebhookEventWithSignedUrl getSignedUrlEvent()
Returns the signed URL event when the payload was delivered via URL.- Throws:
java.lang.IllegalStateException- if this is not a signed URL event
-
getEventId
java.lang.String getEventId()
Returns the event ID (works for both normal and signed URL events).
-
getEventType
java.lang.String getEventType()
Returns the event type string (e.g. "workflow_run.completed").
-
-