Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured Webhook Events #2

Draft
wants to merge 2 commits into
base: fb/webhook-events
Choose a base branch
from

Conversation

ChezCrawford
Copy link
Owner

@ChezCrawford ChezCrawford commented Mar 17, 2022

Layers on support for structured events as well.

@ChezCrawford ChezCrawford changed the base branch from master to fb/webhook-events March 18, 2022 00:38
@ChezCrawford ChezCrawford changed the title Fb/structured webhook events Structured Webhook Events Mar 18, 2022
@@ -13,6 +13,7 @@ type OutboundEventData struct {
Object map[string]interface{}
// The raw json data for use in structured unmarshalling.
RawData json.RawMessage
Type string
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not currently making this of type EventDataType as that would break support unstructured event handling.

IncidentNote EventDataType = "incident_note"
)

type IncidentEvent struct {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Come back and complete this if we actually agree on this approach.

@@ -0,0 +1,58 @@
package webhookv3
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The structured events are in a separate file so that it is easier to review simple PRs that add new event types and/or fields without changing any cross-cutting functionality or behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants