Skip to main content

WebhookPayload

Enum WebhookPayload 

Source
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.

JSON schema
{
 "description": "Every webhook event and the payload its deliveries carry.\n\nThe single declaration of the catalog: [`WebhookEventType`] is derived from\nit, so an event cannot exist without a payload and the two cannot drift.\n\nNever serialized: a delivery puts the bare payload under `payload` with the\ndiscriminant in the sibling `event` field. The serde tag exists so utoipa\nderives a `oneOf` with a `discriminator` whose `mapping` pairs every event\nwith its payload schema - that mapping is what the SDK generators read, and\nit comes from this declaration rather than being restated anywhere.",
 "oneOf": [
   {
     "description": "Emitted when a new non-OAuth connection is created",
     "allOf": [
       {
         "$ref": "#/components/schemas/ConnectionCreatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "connection.created"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when an OAuth connection is created",
     "allOf": [
       {
         "$ref": "#/components/schemas/ConnectionOAuthCreatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "connection.oauth.created"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a connection's own fields change",
     "allOf": [
       {
         "$ref": "#/components/schemas/ConnectionUpdatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "connection.updated"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a connection is deleted",
     "allOf": [
       {
         "$ref": "#/components/schemas/ConnectionDeletedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "connection.deleted"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when an API key is created",
     "allOf": [
       {
         "$ref": "#/components/schemas/ApiKeyCreatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "api_key.created"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when an API key is revoked",
     "allOf": [
       {
         "$ref": "#/components/schemas/ApiKeyRevokedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "api_key.revoked"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a project is created",
     "allOf": [
       {
         "$ref": "#/components/schemas/ProjectCreatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "project.created"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a project is updated",
     "allOf": [
       {
         "$ref": "#/components/schemas/ProjectUpdatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "project.updated"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a project is deleted",
     "allOf": [
       {
         "$ref": "#/components/schemas/ProjectDeletedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "project.deleted"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when an organization is created",
     "allOf": [
       {
         "$ref": "#/components/schemas/OrganizationCreatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "organization.created"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when an organization is updated",
     "allOf": [
       {
         "$ref": "#/components/schemas/OrganizationUpdatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "organization.updated"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when an organization is deleted",
     "allOf": [
       {
         "$ref": "#/components/schemas/OrganizationDeletedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "organization.deleted"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when OAuth token is refreshed",
     "allOf": [
       {
         "$ref": "#/components/schemas/OAuthRefreshedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "oauth.refreshed"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when OAuth authorization fails",
     "allOf": [
       {
         "$ref": "#/components/schemas/OAuthFailedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "oauth.failed"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a passthrough request is executed",
     "allOf": [
       {
         "$ref": "#/components/schemas/PassthroughExecutedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "passthrough.executed"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a member is added to an organization or project",
     "allOf": [
       {
         "$ref": "#/components/schemas/MemberAddedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "member.added"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a member is removed from an organization or project",
     "allOf": [
       {
         "$ref": "#/components/schemas/MemberRemovedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "member.removed"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a member's role is updated",
     "allOf": [
       {
         "$ref": "#/components/schemas/MemberRoleUpdatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "member.role_updated"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a consent creates a grant: a user's first for an\napplication, or any after they revoked it.\n\nCaptured when the consent commits, before the authorization flow\nvalidates the requested scope, so the reach it describes is written\nmoments later when the code is issued.",
     "allOf": [
       {
         "$ref": "#/components/schemas/GrantCreatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "grant.created"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a live grant's reach changes, by re-consent or by the user\nediting it",
     "allOf": [
       {
         "$ref": "#/components/schemas/GrantUpdatedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "grant.updated"
             ]
           }
         }
       }
     ]
   },
   {
     "description": "Emitted when a grant is revoked, by its user or by the application's\ndeveloper",
     "allOf": [
       {
         "$ref": "#/components/schemas/GrantRevokedPayload"
       },
       {
         "type": "object",
         "required": [
           "type"
         ],
         "properties": {
           "type": {
             "type": "string",
             "enum": [
               "grant.revoked"
             ]
           }
         }
       }
     ]
   }
 ]
}

Variants§

§

Variant0

Fields

§connection_id: Uuid
§connection_type: String
§created_at: DateTime<Utc>
§environment: String
§organization_id: Option<Uuid>
§platform: String
§project_id: Option<Uuid>
§state: String
§

Variant1

Fields

§authorized_at: DateTime<Utc>
§connection_id: Uuid
§platform: String
§user_id: Uuid
§

Variant2

Fields

§connection_id: Uuid
§organization_id: Option<Uuid>
§platform: String
§project_id: Option<Uuid>
§tags: Vec<String>
§updated_at: DateTime<Utc>
§

Variant3

Fields

§connection_id: Uuid
§deleted_at: DateTime<Utc>
§organization_id: Option<Uuid>
§platform: String
§project_id: Option<Uuid>
§

Variant4

Fields

§connection_type: String
§created_at: DateTime<Utc>
§environment: String
§event_access_id: String
§organization_id: Option<Uuid>
§project_id: Option<Uuid>
§

Variant5

Fields

§connection_type: String
§environment: String
§event_access_id: String
§organization_id: Option<Uuid>
§project_id: Option<Uuid>
§revoked_at: DateTime<Utc>
§

Variant6

Fields

§created_at: DateTime<Utc>
§id: Uuid
§name: String
§organization_id: Uuid
§

Variant7

Fields

§id: Uuid
§name: String
§organization_id: Uuid
§updated_at: DateTime<Utc>
§

Variant8

Fields

§deleted_at: DateTime<Utc>
§id: Uuid
§name: String
§organization_id: Uuid
§

Variant9

Fields

§created_at: DateTime<Utc>
§id: Uuid
§name: String
§

Variant10

§

Variant11

§

Variant12

Fields

§connection_id: Uuid
§platform: String
§refreshed_at: DateTime<Utc>
§

Variant13

Fields

§connection_id: Option<Uuid>
§error: String
§failed_at: DateTime<Utc>
§platform: String
§

Variant14

Fields

§connection_id: Uuid
§duration_ms: i64
§method: String
§path: String
§platform: String
§status_code: Option<i32>
§timestamp: DateTime<Utc>
§

Variant15

Fields

§added_at: DateTime<Utc>
§email: String
§organization_id: Option<Uuid>
§organization_name: Option<String>
§project_id: Option<Uuid>
§project_name: Option<String>
§user_id: Uuid
§

Variant16

Fields

§email: String
§organization_id: Option<Uuid>
§organization_name: Option<String>
§project_id: Option<Uuid>
§project_name: Option<String>
§removed_at: DateTime<Utc>
§user_id: Uuid
§

Variant17

Fields

§email: String
§new_role: String
§old_role: String
§organization_id: Option<Uuid>
§organization_name: Option<String>
§project_id: Option<Uuid>
§project_name: Option<String>
§updated_at: DateTime<Utc>
§user_id: Uuid
§

Variant18

Fields

§client_id: String

The public client_id the application knows itself by, not the integer key.

§connect_user_id: String
§consent_surface: WebhookPayloadVariant18ConsentSurface

Where the user answered: the page One renders, or the connect card framed inside the application’s own site.

§created_at: DateTime<Utc>
§grant_id: String
§version: i64

Which 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

§client_id: String

The public client_id the application knows itself by, not the integer key.

§connect_user_id: String
§grant_id: String
§source: WebhookPayloadVariant19Source

What 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.

§updated_at: DateTime<Utc>
§version: i64

Which 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

§client_id: String

The public client_id the application knows itself by, not the integer key.

§connect_user_id: String
§grant_id: String
§reason: Option<String>
§revoked_at: DateTime<Utc>
§revoked_by: WebhookPayloadVariant20RevokedBy

Who 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.

§version: i64

Which 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.

Trait Implementations§

Source§

impl Clone for WebhookPayload

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebhookPayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WebhookPayload

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for WebhookPayload

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more