pub struct Message<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Message<'a>
impl<'a> Message<'a>
Sourcepub async fn list(
&self,
app_id: String,
options: Option<MessageListOptions>,
) -> Result<ListResponseMessageOut>
pub async fn list( &self, app_id: String, options: Option<MessageListOptions>, ) -> Result<ListResponseMessageOut>
List all of the application’s messages.
The before
and after
parameters let you filter all items created
before or after a certain date. These can be used alongside an iterator
to paginate over results within a certain window.
Note that by default this endpoint is limited to retrieving 90 days’
worth of data relative to now or, if an iterator is provided, 90
days before/after the time indicated by the iterator ID. If you
require data beyond those time ranges, you will need to explicitly
set the before
or after
parameter as appropriate.
Sourcepub async fn create(
&self,
app_id: String,
message_in: MessageIn,
options: Option<PostOptions>,
) -> Result<MessageOut>
pub async fn create( &self, app_id: String, message_in: MessageIn, options: Option<PostOptions>, ) -> Result<MessageOut>
Creates a new message and dispatches it to all of the application’s endpoints.
The eventId
is an optional custom unique ID. It’s verified to be
unique only up to a day, after that no verification will be made. If
a message with the same eventId
already exists for the application, a
409 conflict error will be returned.
The eventType
indicates the type and schema of the event. All messages
of a certain eventType
are expected to have the same schema. Endpoints
can choose to only listen to specific event types. Messages can also
have channels
, which similar to event types let endpoints filter by
them. Unlike event types, messages can have multiple channels, and
channels don’t imply a specific message content or schema.
The payload
property is the webhook’s body (the actual webhook
message). Svix supports payload sizes of up to ~350kb, though it’s
generally a good idea to keep webhook payloads small, probably no larger
than 40kb.