pub struct CreateWebhookEndpoint { /* private fields */ }
Expand description
A webhook endpoint must have a url
and a list of enabled_events
.
You may optionally specify the Boolean connect
parameter.
If set to true, then a Connect webhook endpoint that notifies the specified url
about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url
only about events from your account is created.
You can also create webhook endpoints in the webhooks settings section of the Dashboard.
Implementations§
Source§impl CreateWebhookEndpoint
impl CreateWebhookEndpoint
Sourcepub fn new(
enabled_events: impl Into<Vec<CreateWebhookEndpointEnabledEvents>>,
url: impl Into<String>,
) -> Self
pub fn new( enabled_events: impl Into<Vec<CreateWebhookEndpointEnabledEvents>>, url: impl Into<String>, ) -> Self
Construct a new CreateWebhookEndpoint
.
Sourcepub fn api_version(self, api_version: impl Into<ApiVersion>) -> Self
pub fn api_version(self, api_version: impl Into<ApiVersion>) -> Self
Events sent to this endpoint will be generated with this Stripe Version instead of your account’s default Stripe Version.
Sourcepub fn connect(self, connect: impl Into<bool>) -> Self
pub fn connect(self, connect: impl Into<bool>) -> Self
Whether this endpoint should receive events from connected accounts (true
), or from your account (false
).
Defaults to false
.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
An optional description of what the webhook is used for.
Sourcepub fn expand(self, expand: impl Into<Vec<String>>) -> Self
pub fn expand(self, expand: impl Into<Vec<String>>) -> Self
Specifies which fields in the response should be expanded.
Sourcepub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
Individual keys can be unset by posting an empty value to them.
All keys can be unset by posting an empty value to metadata
.
Source§impl CreateWebhookEndpoint
impl CreateWebhookEndpoint
Sourcepub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response.
Sourcepub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub fn send_blocking<C: StripeBlockingClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response, blocking until completion.
Trait Implementations§
Source§impl Clone for CreateWebhookEndpoint
impl Clone for CreateWebhookEndpoint
Source§fn clone(&self) -> CreateWebhookEndpoint
fn clone(&self) -> CreateWebhookEndpoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more