pub enum WebhookPayload {
Show 21 variants
Variant0 {
connection_id: Uuid,
connection_type: String,
created_at: DateTime<Utc>,
environment: String,
key: String,
name: Option<String>,
organization_id: Option<Uuid>,
platform: String,
project_id: Option<Uuid>,
state: String,
type_: WebhookPayloadVariant0Type,
},
Variant1 {
authorized_at: DateTime<Utc>,
connection_id: Uuid,
key: String,
platform: String,
type_: WebhookPayloadVariant1Type,
user_id: Uuid,
},
Variant2 {
connection_id: Uuid,
key: String,
name: Option<String>,
organization_id: Option<Uuid>,
platform: String,
project_id: Option<Uuid>,
tags: Vec<String>,
type_: WebhookPayloadVariant2Type,
updated_at: DateTime<Utc>,
},
Variant3 {
connection_id: Uuid,
deleted_at: DateTime<Utc>,
key: Option<String>,
name: Option<String>,
organization_id: Option<Uuid>,
platform: String,
project_id: Option<Uuid>,
type_: WebhookPayloadVariant3Type,
},
Variant4 {
connection_type: String,
created_at: DateTime<Utc>,
environment: String,
event_access_id: String,
name: Option<String>,
organization_id: Option<Uuid>,
project_id: Option<Uuid>,
type_: WebhookPayloadVariant4Type,
},
Variant5 {
connection_type: String,
environment: String,
event_access_id: String,
name: Option<String>,
organization_id: Option<Uuid>,
project_id: Option<Uuid>,
revoked_at: DateTime<Utc>,
type_: WebhookPayloadVariant5Type,
},
Variant6 {
created_at: DateTime<Utc>,
id: Uuid,
name: String,
organization_id: Uuid,
type_: WebhookPayloadVariant6Type,
},
Variant7 {
id: Uuid,
name: String,
organization_id: Uuid,
type_: WebhookPayloadVariant7Type,
updated_at: DateTime<Utc>,
},
Variant8 {
deleted_at: DateTime<Utc>,
id: Uuid,
name: String,
organization_id: Uuid,
type_: WebhookPayloadVariant8Type,
},
Variant9 {
created_at: DateTime<Utc>,
id: Uuid,
name: String,
type_: WebhookPayloadVariant9Type,
},
Variant10 {
id: Uuid,
name: String,
type_: WebhookPayloadVariant10Type,
updated_at: DateTime<Utc>,
},
Variant11 {
deleted_at: DateTime<Utc>,
id: Uuid,
name: String,
type_: WebhookPayloadVariant11Type,
},
Variant12 {
connection_id: Uuid,
key: Option<String>,
platform: String,
refreshed_at: DateTime<Utc>,
type_: WebhookPayloadVariant12Type,
},
Variant13 {
connection_id: Option<Uuid>,
error: String,
failed_at: DateTime<Utc>,
key: Option<String>,
platform: String,
type_: WebhookPayloadVariant13Type,
},
Variant14 {
connection_id: Uuid,
duration_ms: i64,
error: Option<String>,
key: Option<String>,
method: String,
path: String,
platform: String,
status_code: Option<i32>,
timestamp: DateTime<Utc>,
type_: WebhookPayloadVariant14Type,
},
Variant15 {
added_at: DateTime<Utc>,
email: String,
organization_id: Option<Uuid>,
organization_name: Option<String>,
project_id: Option<Uuid>,
project_name: Option<String>,
type_: WebhookPayloadVariant15Type,
user_id: Uuid,
},
Variant16 {
email: String,
organization_id: Option<Uuid>,
organization_name: Option<String>,
project_id: Option<Uuid>,
project_name: Option<String>,
removed_at: DateTime<Utc>,
type_: WebhookPayloadVariant16Type,
user_id: Uuid,
},
Variant17 {
email: String,
new_role: String,
old_role: String,
organization_id: Option<Uuid>,
organization_name: Option<String>,
project_id: Option<Uuid>,
project_name: Option<String>,
type_: WebhookPayloadVariant17Type,
updated_at: DateTime<Utc>,
user_id: Uuid,
},
Variant18 {
client_id: String,
connect_user_id: String,
consent_surface: WebhookPayloadVariant18ConsentSurface,
created_at: DateTime<Utc>,
environment: WebhookPayloadVariant18Environment,
grant_id: String,
type_: WebhookPayloadVariant18Type,
version: i64,
},
Variant19 {
client_id: String,
connect_user_id: String,
environment: WebhookPayloadVariant19Environment,
grant_id: String,
source: WebhookPayloadVariant19Source,
type_: WebhookPayloadVariant19Type,
updated_at: DateTime<Utc>,
version: i64,
},
Variant20 {
client_id: String,
connect_user_id: String,
environment: WebhookPayloadVariant20Environment,
grant_id: String,
reason: Option<String>,
revoked_at: DateTime<Utc>,
revoked_by: WebhookPayloadVariant20RevokedBy,
type_: WebhookPayloadVariant20Type,
version: i64,
},
}Expand description
Every webhook event and the payload its deliveries carry.
The single declaration of the catalog: WebhookEventType is derived from
it, so an event cannot exist without a payload and the two cannot drift.
Never serialized: a delivery puts the bare payload under payload with the
discriminant in the sibling event field. The serde tag exists so utoipa
derives a oneOf with a discriminator whose mapping pairs every event
with its payload schema - that mapping is what the SDK generators read, and
it comes from this declaration rather than being restated anywhere.
Variants§
Variant0
Fields
type_: WebhookPayloadVariant0TypeVariant1
Variant2
Variant3
Fields
type_: WebhookPayloadVariant3TypeVariant4
Fields
type_: WebhookPayloadVariant4TypeVariant5
Fields
type_: WebhookPayloadVariant5TypeVariant6
Fields
type_: WebhookPayloadVariant6TypeVariant7
Fields
type_: WebhookPayloadVariant7TypeVariant8
Fields
type_: WebhookPayloadVariant8TypeVariant9
Variant10
Variant11
Variant12
Fields
type_: WebhookPayloadVariant12TypeVariant13
Fields
type_: WebhookPayloadVariant13TypeVariant14
Fields
type_: WebhookPayloadVariant14TypeVariant15
Fields
type_: WebhookPayloadVariant15TypeVariant16
Fields
type_: WebhookPayloadVariant16TypeVariant17
Fields
type_: WebhookPayloadVariant17TypeVariant18
Fields
consent_surface: WebhookPayloadVariant18ConsentSurfaceWhere the user answered: the page One renders, or the connect card framed inside the application’s own site.
environment: WebhookPayloadVariant18Environmenttype_: WebhookPayloadVariant18Typeversion: i64Which revision of this grant’s reach the delivery describes. Bumped by every consent and every edit, so an application can tell a change it has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by grant_id. And grant.revoked repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on X-Webhook-Event-Id, never on this.
Variant19
Fields
environment: WebhookPayloadVariant19Environmentsource: WebhookPayloadVariant19SourceWhat moved a live grant.
One field on grant.updated rather than two events: an application can
prompt the user to re-consent and cannot prompt them to un-edit, so it
branches on this, but it is one occurrence either way.
type_: WebhookPayloadVariant19Typeversion: i64Which revision of this grant’s reach the delivery describes. Bumped by every consent and every edit, so an application can tell a change it has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by grant_id. And grant.revoked repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on X-Webhook-Event-Id, never on this.
Variant20
Fields
environment: WebhookPayloadVariant20Environmentrevoked_by: WebhookPayloadVariant20RevokedByWho ended a grant, which decides how the application answers: after the user or a departure it may prompt the user to reconnect, and after the application’s owner or a tenant admin ended it deliberately it does not. One field rather than one event per actor.
type_: WebhookPayloadVariant20Typeversion: i64Which revision of this grant’s reach the delivery describes. Bumped by every consent and every edit, so an application can tell a change it has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by grant_id. And grant.revoked repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on X-Webhook-Event-Id, never on this.