stripe_misc/webhook_endpoint/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5/// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
6#[derive(Clone, Debug, serde::Serialize)]
7pub struct DeleteWebhookEndpoint {
8    webhook_endpoint: stripe_misc::WebhookEndpointId,
9}
10impl DeleteWebhookEndpoint {
11    /// Construct a new `DeleteWebhookEndpoint`.
12    pub fn new(webhook_endpoint: impl Into<stripe_misc::WebhookEndpointId>) -> Self {
13        Self { webhook_endpoint: webhook_endpoint.into() }
14    }
15}
16impl DeleteWebhookEndpoint {
17    /// Send the request and return the deserialized response.
18    pub async fn send<C: StripeClient>(
19        &self,
20        client: &C,
21    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22        self.customize().send(client).await
23    }
24
25    /// Send the request and return the deserialized response, blocking until completion.
26    pub fn send_blocking<C: StripeBlockingClient>(
27        &self,
28        client: &C,
29    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
30        self.customize().send_blocking(client)
31    }
32}
33
34impl StripeRequest for DeleteWebhookEndpoint {
35    type Output = stripe_misc::DeletedWebhookEndpoint;
36
37    fn build(&self) -> RequestBuilder {
38        let webhook_endpoint = &self.webhook_endpoint;
39        RequestBuilder::new(StripeMethod::Delete, format!("/webhook_endpoints/{webhook_endpoint}"))
40    }
41}
42#[derive(Clone, Debug, serde::Serialize)]
43struct ListWebhookEndpointBuilder {
44    #[serde(skip_serializing_if = "Option::is_none")]
45    ending_before: Option<String>,
46    #[serde(skip_serializing_if = "Option::is_none")]
47    expand: Option<Vec<String>>,
48    #[serde(skip_serializing_if = "Option::is_none")]
49    limit: Option<i64>,
50    #[serde(skip_serializing_if = "Option::is_none")]
51    starting_after: Option<String>,
52}
53impl ListWebhookEndpointBuilder {
54    fn new() -> Self {
55        Self { ending_before: None, expand: None, limit: None, starting_after: None }
56    }
57}
58/// Returns a list of your webhook endpoints.
59#[derive(Clone, Debug, serde::Serialize)]
60pub struct ListWebhookEndpoint {
61    inner: ListWebhookEndpointBuilder,
62}
63impl ListWebhookEndpoint {
64    /// Construct a new `ListWebhookEndpoint`.
65    pub fn new() -> Self {
66        Self { inner: ListWebhookEndpointBuilder::new() }
67    }
68    /// A cursor for use in pagination.
69    /// `ending_before` is an object ID that defines your place in the list.
70    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
71    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
72        self.inner.ending_before = Some(ending_before.into());
73        self
74    }
75    /// Specifies which fields in the response should be expanded.
76    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
77        self.inner.expand = Some(expand.into());
78        self
79    }
80    /// A limit on the number of objects to be returned.
81    /// Limit can range between 1 and 100, and the default is 10.
82    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
83        self.inner.limit = Some(limit.into());
84        self
85    }
86    /// A cursor for use in pagination.
87    /// `starting_after` is an object ID that defines your place in the list.
88    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
89    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
90        self.inner.starting_after = Some(starting_after.into());
91        self
92    }
93}
94impl Default for ListWebhookEndpoint {
95    fn default() -> Self {
96        Self::new()
97    }
98}
99impl ListWebhookEndpoint {
100    /// Send the request and return the deserialized response.
101    pub async fn send<C: StripeClient>(
102        &self,
103        client: &C,
104    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
105        self.customize().send(client).await
106    }
107
108    /// Send the request and return the deserialized response, blocking until completion.
109    pub fn send_blocking<C: StripeBlockingClient>(
110        &self,
111        client: &C,
112    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
113        self.customize().send_blocking(client)
114    }
115
116    pub fn paginate(
117        &self,
118    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_misc::WebhookEndpoint>> {
119        stripe_client_core::ListPaginator::new_list("/webhook_endpoints", &self.inner)
120    }
121}
122
123impl StripeRequest for ListWebhookEndpoint {
124    type Output = stripe_types::List<stripe_misc::WebhookEndpoint>;
125
126    fn build(&self) -> RequestBuilder {
127        RequestBuilder::new(StripeMethod::Get, "/webhook_endpoints").query(&self.inner)
128    }
129}
130#[derive(Clone, Debug, serde::Serialize)]
131struct RetrieveWebhookEndpointBuilder {
132    #[serde(skip_serializing_if = "Option::is_none")]
133    expand: Option<Vec<String>>,
134}
135impl RetrieveWebhookEndpointBuilder {
136    fn new() -> Self {
137        Self { expand: None }
138    }
139}
140/// Retrieves the webhook endpoint with the given ID.
141#[derive(Clone, Debug, serde::Serialize)]
142pub struct RetrieveWebhookEndpoint {
143    inner: RetrieveWebhookEndpointBuilder,
144    webhook_endpoint: stripe_misc::WebhookEndpointId,
145}
146impl RetrieveWebhookEndpoint {
147    /// Construct a new `RetrieveWebhookEndpoint`.
148    pub fn new(webhook_endpoint: impl Into<stripe_misc::WebhookEndpointId>) -> Self {
149        Self {
150            webhook_endpoint: webhook_endpoint.into(),
151            inner: RetrieveWebhookEndpointBuilder::new(),
152        }
153    }
154    /// Specifies which fields in the response should be expanded.
155    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
156        self.inner.expand = Some(expand.into());
157        self
158    }
159}
160impl RetrieveWebhookEndpoint {
161    /// Send the request and return the deserialized response.
162    pub async fn send<C: StripeClient>(
163        &self,
164        client: &C,
165    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
166        self.customize().send(client).await
167    }
168
169    /// Send the request and return the deserialized response, blocking until completion.
170    pub fn send_blocking<C: StripeBlockingClient>(
171        &self,
172        client: &C,
173    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
174        self.customize().send_blocking(client)
175    }
176}
177
178impl StripeRequest for RetrieveWebhookEndpoint {
179    type Output = stripe_misc::WebhookEndpoint;
180
181    fn build(&self) -> RequestBuilder {
182        let webhook_endpoint = &self.webhook_endpoint;
183        RequestBuilder::new(StripeMethod::Get, format!("/webhook_endpoints/{webhook_endpoint}"))
184            .query(&self.inner)
185    }
186}
187#[derive(Clone, Debug, serde::Serialize)]
188struct CreateWebhookEndpointBuilder {
189    #[serde(skip_serializing_if = "Option::is_none")]
190    api_version: Option<stripe_shared::ApiVersion>,
191    #[serde(skip_serializing_if = "Option::is_none")]
192    connect: Option<bool>,
193    #[serde(skip_serializing_if = "Option::is_none")]
194    description: Option<String>,
195    enabled_events: Vec<CreateWebhookEndpointEnabledEvents>,
196    #[serde(skip_serializing_if = "Option::is_none")]
197    expand: Option<Vec<String>>,
198    #[serde(skip_serializing_if = "Option::is_none")]
199    metadata: Option<std::collections::HashMap<String, String>>,
200    url: String,
201}
202impl CreateWebhookEndpointBuilder {
203    fn new(
204        enabled_events: impl Into<Vec<CreateWebhookEndpointEnabledEvents>>,
205        url: impl Into<String>,
206    ) -> Self {
207        Self {
208            api_version: None,
209            connect: None,
210            description: None,
211            enabled_events: enabled_events.into(),
212            expand: None,
213            metadata: None,
214            url: url.into(),
215        }
216    }
217}
218/// The list of events to enable for this endpoint.
219/// You may specify `['*']` to enable all events, except those that require explicit selection.
220#[derive(Clone, Eq, PartialEq)]
221#[non_exhaustive]
222pub enum CreateWebhookEndpointEnabledEvents {
223    All,
224    AccountApplicationAuthorized,
225    AccountApplicationDeauthorized,
226    AccountExternalAccountCreated,
227    AccountExternalAccountDeleted,
228    AccountExternalAccountUpdated,
229    AccountUpdated,
230    ApplicationFeeCreated,
231    ApplicationFeeRefundUpdated,
232    ApplicationFeeRefunded,
233    BalanceAvailable,
234    BalanceSettingsUpdated,
235    BillingAlertTriggered,
236    BillingPortalConfigurationCreated,
237    BillingPortalConfigurationUpdated,
238    BillingPortalSessionCreated,
239    CapabilityUpdated,
240    CashBalanceFundsAvailable,
241    ChargeCaptured,
242    ChargeDisputeClosed,
243    ChargeDisputeCreated,
244    ChargeDisputeFundsReinstated,
245    ChargeDisputeFundsWithdrawn,
246    ChargeDisputeUpdated,
247    ChargeExpired,
248    ChargeFailed,
249    ChargePending,
250    ChargeRefundUpdated,
251    ChargeRefunded,
252    ChargeSucceeded,
253    ChargeUpdated,
254    CheckoutSessionAsyncPaymentFailed,
255    CheckoutSessionAsyncPaymentSucceeded,
256    CheckoutSessionCompleted,
257    CheckoutSessionExpired,
258    ClimateOrderCanceled,
259    ClimateOrderCreated,
260    ClimateOrderDelayed,
261    ClimateOrderDelivered,
262    ClimateOrderProductSubstituted,
263    ClimateProductCreated,
264    ClimateProductPricingUpdated,
265    CouponCreated,
266    CouponDeleted,
267    CouponUpdated,
268    CreditNoteCreated,
269    CreditNoteUpdated,
270    CreditNoteVoided,
271    CustomerCreated,
272    CustomerDeleted,
273    CustomerDiscountCreated,
274    CustomerDiscountDeleted,
275    CustomerDiscountUpdated,
276    CustomerSourceCreated,
277    CustomerSourceDeleted,
278    CustomerSourceExpiring,
279    CustomerSourceUpdated,
280    CustomerSubscriptionCreated,
281    CustomerSubscriptionDeleted,
282    CustomerSubscriptionPaused,
283    CustomerSubscriptionPendingUpdateApplied,
284    CustomerSubscriptionPendingUpdateExpired,
285    CustomerSubscriptionResumed,
286    CustomerSubscriptionTrialWillEnd,
287    CustomerSubscriptionUpdated,
288    CustomerTaxIdCreated,
289    CustomerTaxIdDeleted,
290    CustomerTaxIdUpdated,
291    CustomerUpdated,
292    CustomerCashBalanceTransactionCreated,
293    EntitlementsActiveEntitlementSummaryUpdated,
294    FileCreated,
295    FinancialConnectionsAccountAccountNumbersUpdated,
296    FinancialConnectionsAccountCreated,
297    FinancialConnectionsAccountDeactivated,
298    FinancialConnectionsAccountDisconnected,
299    FinancialConnectionsAccountReactivated,
300    FinancialConnectionsAccountRefreshedBalance,
301    FinancialConnectionsAccountRefreshedOwnership,
302    FinancialConnectionsAccountRefreshedTransactions,
303    FinancialConnectionsAccountUpcomingAccountNumberExpiry,
304    IdentityVerificationSessionCanceled,
305    IdentityVerificationSessionCreated,
306    IdentityVerificationSessionProcessing,
307    IdentityVerificationSessionRedacted,
308    IdentityVerificationSessionRequiresInput,
309    IdentityVerificationSessionVerified,
310    InvoiceCreated,
311    InvoiceDeleted,
312    InvoiceFinalizationFailed,
313    InvoiceFinalized,
314    InvoiceMarkedUncollectible,
315    InvoiceOverdue,
316    InvoiceOverpaid,
317    InvoicePaid,
318    InvoicePaymentActionRequired,
319    InvoicePaymentAttemptRequired,
320    InvoicePaymentFailed,
321    InvoicePaymentSucceeded,
322    InvoiceSent,
323    InvoiceUpcoming,
324    InvoiceUpdated,
325    InvoiceVoided,
326    InvoiceWillBeDue,
327    InvoicePaymentPaid,
328    InvoiceitemCreated,
329    InvoiceitemDeleted,
330    IssuingAuthorizationCreated,
331    IssuingAuthorizationRequest,
332    IssuingAuthorizationUpdated,
333    IssuingCardCreated,
334    IssuingCardUpdated,
335    IssuingCardholderCreated,
336    IssuingCardholderUpdated,
337    IssuingDisputeClosed,
338    IssuingDisputeCreated,
339    IssuingDisputeFundsReinstated,
340    IssuingDisputeFundsRescinded,
341    IssuingDisputeSubmitted,
342    IssuingDisputeUpdated,
343    IssuingPersonalizationDesignActivated,
344    IssuingPersonalizationDesignDeactivated,
345    IssuingPersonalizationDesignRejected,
346    IssuingPersonalizationDesignUpdated,
347    IssuingTokenCreated,
348    IssuingTokenUpdated,
349    IssuingTransactionCreated,
350    IssuingTransactionPurchaseDetailsReceiptUpdated,
351    IssuingTransactionUpdated,
352    MandateUpdated,
353    PaymentIntentAmountCapturableUpdated,
354    PaymentIntentCanceled,
355    PaymentIntentCreated,
356    PaymentIntentPartiallyFunded,
357    PaymentIntentPaymentFailed,
358    PaymentIntentProcessing,
359    PaymentIntentRequiresAction,
360    PaymentIntentSucceeded,
361    PaymentLinkCreated,
362    PaymentLinkUpdated,
363    PaymentMethodAttached,
364    PaymentMethodAutomaticallyUpdated,
365    PaymentMethodDetached,
366    PaymentMethodUpdated,
367    PayoutCanceled,
368    PayoutCreated,
369    PayoutFailed,
370    PayoutPaid,
371    PayoutReconciliationCompleted,
372    PayoutUpdated,
373    PersonCreated,
374    PersonDeleted,
375    PersonUpdated,
376    PlanCreated,
377    PlanDeleted,
378    PlanUpdated,
379    PriceCreated,
380    PriceDeleted,
381    PriceUpdated,
382    ProductCreated,
383    ProductDeleted,
384    ProductUpdated,
385    PromotionCodeCreated,
386    PromotionCodeUpdated,
387    QuoteAccepted,
388    QuoteCanceled,
389    QuoteCreated,
390    QuoteFinalized,
391    RadarEarlyFraudWarningCreated,
392    RadarEarlyFraudWarningUpdated,
393    RefundCreated,
394    RefundFailed,
395    RefundUpdated,
396    ReportingReportRunFailed,
397    ReportingReportRunSucceeded,
398    ReportingReportTypeUpdated,
399    ReviewClosed,
400    ReviewOpened,
401    SetupIntentCanceled,
402    SetupIntentCreated,
403    SetupIntentRequiresAction,
404    SetupIntentSetupFailed,
405    SetupIntentSucceeded,
406    SigmaScheduledQueryRunCreated,
407    SourceCanceled,
408    SourceChargeable,
409    SourceFailed,
410    SourceMandateNotification,
411    SourceRefundAttributesRequired,
412    SourceTransactionCreated,
413    SourceTransactionUpdated,
414    SubscriptionScheduleAborted,
415    SubscriptionScheduleCanceled,
416    SubscriptionScheduleCompleted,
417    SubscriptionScheduleCreated,
418    SubscriptionScheduleExpiring,
419    SubscriptionScheduleReleased,
420    SubscriptionScheduleUpdated,
421    TaxSettingsUpdated,
422    TaxRateCreated,
423    TaxRateUpdated,
424    TerminalReaderActionFailed,
425    TerminalReaderActionSucceeded,
426    TerminalReaderActionUpdated,
427    TestHelpersTestClockAdvancing,
428    TestHelpersTestClockCreated,
429    TestHelpersTestClockDeleted,
430    TestHelpersTestClockInternalFailure,
431    TestHelpersTestClockReady,
432    TopupCanceled,
433    TopupCreated,
434    TopupFailed,
435    TopupReversed,
436    TopupSucceeded,
437    TransferCreated,
438    TransferReversed,
439    TransferUpdated,
440    TreasuryCreditReversalCreated,
441    TreasuryCreditReversalPosted,
442    TreasuryDebitReversalCompleted,
443    TreasuryDebitReversalCreated,
444    TreasuryDebitReversalInitialCreditGranted,
445    TreasuryFinancialAccountClosed,
446    TreasuryFinancialAccountCreated,
447    TreasuryFinancialAccountFeaturesStatusUpdated,
448    TreasuryInboundTransferCanceled,
449    TreasuryInboundTransferCreated,
450    TreasuryInboundTransferFailed,
451    TreasuryInboundTransferSucceeded,
452    TreasuryOutboundPaymentCanceled,
453    TreasuryOutboundPaymentCreated,
454    TreasuryOutboundPaymentExpectedArrivalDateUpdated,
455    TreasuryOutboundPaymentFailed,
456    TreasuryOutboundPaymentPosted,
457    TreasuryOutboundPaymentReturned,
458    TreasuryOutboundPaymentTrackingDetailsUpdated,
459    TreasuryOutboundTransferCanceled,
460    TreasuryOutboundTransferCreated,
461    TreasuryOutboundTransferExpectedArrivalDateUpdated,
462    TreasuryOutboundTransferFailed,
463    TreasuryOutboundTransferPosted,
464    TreasuryOutboundTransferReturned,
465    TreasuryOutboundTransferTrackingDetailsUpdated,
466    TreasuryReceivedCreditCreated,
467    TreasuryReceivedCreditFailed,
468    TreasuryReceivedCreditSucceeded,
469    TreasuryReceivedDebitCreated,
470    /// An unrecognized value from Stripe. Should not be used as a request parameter.
471    Unknown(String),
472}
473impl CreateWebhookEndpointEnabledEvents {
474    pub fn as_str(&self) -> &str {
475        use CreateWebhookEndpointEnabledEvents::*;
476        match self {
477            All => "*",
478            AccountApplicationAuthorized => "account.application.authorized",
479            AccountApplicationDeauthorized => "account.application.deauthorized",
480            AccountExternalAccountCreated => "account.external_account.created",
481            AccountExternalAccountDeleted => "account.external_account.deleted",
482            AccountExternalAccountUpdated => "account.external_account.updated",
483            AccountUpdated => "account.updated",
484            ApplicationFeeCreated => "application_fee.created",
485            ApplicationFeeRefundUpdated => "application_fee.refund.updated",
486            ApplicationFeeRefunded => "application_fee.refunded",
487            BalanceAvailable => "balance.available",
488            BalanceSettingsUpdated => "balance_settings.updated",
489            BillingAlertTriggered => "billing.alert.triggered",
490            BillingPortalConfigurationCreated => "billing_portal.configuration.created",
491            BillingPortalConfigurationUpdated => "billing_portal.configuration.updated",
492            BillingPortalSessionCreated => "billing_portal.session.created",
493            CapabilityUpdated => "capability.updated",
494            CashBalanceFundsAvailable => "cash_balance.funds_available",
495            ChargeCaptured => "charge.captured",
496            ChargeDisputeClosed => "charge.dispute.closed",
497            ChargeDisputeCreated => "charge.dispute.created",
498            ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated",
499            ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn",
500            ChargeDisputeUpdated => "charge.dispute.updated",
501            ChargeExpired => "charge.expired",
502            ChargeFailed => "charge.failed",
503            ChargePending => "charge.pending",
504            ChargeRefundUpdated => "charge.refund.updated",
505            ChargeRefunded => "charge.refunded",
506            ChargeSucceeded => "charge.succeeded",
507            ChargeUpdated => "charge.updated",
508            CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed",
509            CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded",
510            CheckoutSessionCompleted => "checkout.session.completed",
511            CheckoutSessionExpired => "checkout.session.expired",
512            ClimateOrderCanceled => "climate.order.canceled",
513            ClimateOrderCreated => "climate.order.created",
514            ClimateOrderDelayed => "climate.order.delayed",
515            ClimateOrderDelivered => "climate.order.delivered",
516            ClimateOrderProductSubstituted => "climate.order.product_substituted",
517            ClimateProductCreated => "climate.product.created",
518            ClimateProductPricingUpdated => "climate.product.pricing_updated",
519            CouponCreated => "coupon.created",
520            CouponDeleted => "coupon.deleted",
521            CouponUpdated => "coupon.updated",
522            CreditNoteCreated => "credit_note.created",
523            CreditNoteUpdated => "credit_note.updated",
524            CreditNoteVoided => "credit_note.voided",
525            CustomerCreated => "customer.created",
526            CustomerDeleted => "customer.deleted",
527            CustomerDiscountCreated => "customer.discount.created",
528            CustomerDiscountDeleted => "customer.discount.deleted",
529            CustomerDiscountUpdated => "customer.discount.updated",
530            CustomerSourceCreated => "customer.source.created",
531            CustomerSourceDeleted => "customer.source.deleted",
532            CustomerSourceExpiring => "customer.source.expiring",
533            CustomerSourceUpdated => "customer.source.updated",
534            CustomerSubscriptionCreated => "customer.subscription.created",
535            CustomerSubscriptionDeleted => "customer.subscription.deleted",
536            CustomerSubscriptionPaused => "customer.subscription.paused",
537            CustomerSubscriptionPendingUpdateApplied => {
538                "customer.subscription.pending_update_applied"
539            }
540            CustomerSubscriptionPendingUpdateExpired => {
541                "customer.subscription.pending_update_expired"
542            }
543            CustomerSubscriptionResumed => "customer.subscription.resumed",
544            CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end",
545            CustomerSubscriptionUpdated => "customer.subscription.updated",
546            CustomerTaxIdCreated => "customer.tax_id.created",
547            CustomerTaxIdDeleted => "customer.tax_id.deleted",
548            CustomerTaxIdUpdated => "customer.tax_id.updated",
549            CustomerUpdated => "customer.updated",
550            CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created",
551            EntitlementsActiveEntitlementSummaryUpdated => {
552                "entitlements.active_entitlement_summary.updated"
553            }
554            FileCreated => "file.created",
555            FinancialConnectionsAccountAccountNumbersUpdated => {
556                "financial_connections.account.account_numbers_updated"
557            }
558            FinancialConnectionsAccountCreated => "financial_connections.account.created",
559            FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated",
560            FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected",
561            FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated",
562            FinancialConnectionsAccountRefreshedBalance => {
563                "financial_connections.account.refreshed_balance"
564            }
565            FinancialConnectionsAccountRefreshedOwnership => {
566                "financial_connections.account.refreshed_ownership"
567            }
568            FinancialConnectionsAccountRefreshedTransactions => {
569                "financial_connections.account.refreshed_transactions"
570            }
571            FinancialConnectionsAccountUpcomingAccountNumberExpiry => {
572                "financial_connections.account.upcoming_account_number_expiry"
573            }
574            IdentityVerificationSessionCanceled => "identity.verification_session.canceled",
575            IdentityVerificationSessionCreated => "identity.verification_session.created",
576            IdentityVerificationSessionProcessing => "identity.verification_session.processing",
577            IdentityVerificationSessionRedacted => "identity.verification_session.redacted",
578            IdentityVerificationSessionRequiresInput => {
579                "identity.verification_session.requires_input"
580            }
581            IdentityVerificationSessionVerified => "identity.verification_session.verified",
582            InvoiceCreated => "invoice.created",
583            InvoiceDeleted => "invoice.deleted",
584            InvoiceFinalizationFailed => "invoice.finalization_failed",
585            InvoiceFinalized => "invoice.finalized",
586            InvoiceMarkedUncollectible => "invoice.marked_uncollectible",
587            InvoiceOverdue => "invoice.overdue",
588            InvoiceOverpaid => "invoice.overpaid",
589            InvoicePaid => "invoice.paid",
590            InvoicePaymentActionRequired => "invoice.payment_action_required",
591            InvoicePaymentAttemptRequired => "invoice.payment_attempt_required",
592            InvoicePaymentFailed => "invoice.payment_failed",
593            InvoicePaymentSucceeded => "invoice.payment_succeeded",
594            InvoiceSent => "invoice.sent",
595            InvoiceUpcoming => "invoice.upcoming",
596            InvoiceUpdated => "invoice.updated",
597            InvoiceVoided => "invoice.voided",
598            InvoiceWillBeDue => "invoice.will_be_due",
599            InvoicePaymentPaid => "invoice_payment.paid",
600            InvoiceitemCreated => "invoiceitem.created",
601            InvoiceitemDeleted => "invoiceitem.deleted",
602            IssuingAuthorizationCreated => "issuing_authorization.created",
603            IssuingAuthorizationRequest => "issuing_authorization.request",
604            IssuingAuthorizationUpdated => "issuing_authorization.updated",
605            IssuingCardCreated => "issuing_card.created",
606            IssuingCardUpdated => "issuing_card.updated",
607            IssuingCardholderCreated => "issuing_cardholder.created",
608            IssuingCardholderUpdated => "issuing_cardholder.updated",
609            IssuingDisputeClosed => "issuing_dispute.closed",
610            IssuingDisputeCreated => "issuing_dispute.created",
611            IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated",
612            IssuingDisputeFundsRescinded => "issuing_dispute.funds_rescinded",
613            IssuingDisputeSubmitted => "issuing_dispute.submitted",
614            IssuingDisputeUpdated => "issuing_dispute.updated",
615            IssuingPersonalizationDesignActivated => "issuing_personalization_design.activated",
616            IssuingPersonalizationDesignDeactivated => "issuing_personalization_design.deactivated",
617            IssuingPersonalizationDesignRejected => "issuing_personalization_design.rejected",
618            IssuingPersonalizationDesignUpdated => "issuing_personalization_design.updated",
619            IssuingTokenCreated => "issuing_token.created",
620            IssuingTokenUpdated => "issuing_token.updated",
621            IssuingTransactionCreated => "issuing_transaction.created",
622            IssuingTransactionPurchaseDetailsReceiptUpdated => {
623                "issuing_transaction.purchase_details_receipt_updated"
624            }
625            IssuingTransactionUpdated => "issuing_transaction.updated",
626            MandateUpdated => "mandate.updated",
627            PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated",
628            PaymentIntentCanceled => "payment_intent.canceled",
629            PaymentIntentCreated => "payment_intent.created",
630            PaymentIntentPartiallyFunded => "payment_intent.partially_funded",
631            PaymentIntentPaymentFailed => "payment_intent.payment_failed",
632            PaymentIntentProcessing => "payment_intent.processing",
633            PaymentIntentRequiresAction => "payment_intent.requires_action",
634            PaymentIntentSucceeded => "payment_intent.succeeded",
635            PaymentLinkCreated => "payment_link.created",
636            PaymentLinkUpdated => "payment_link.updated",
637            PaymentMethodAttached => "payment_method.attached",
638            PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated",
639            PaymentMethodDetached => "payment_method.detached",
640            PaymentMethodUpdated => "payment_method.updated",
641            PayoutCanceled => "payout.canceled",
642            PayoutCreated => "payout.created",
643            PayoutFailed => "payout.failed",
644            PayoutPaid => "payout.paid",
645            PayoutReconciliationCompleted => "payout.reconciliation_completed",
646            PayoutUpdated => "payout.updated",
647            PersonCreated => "person.created",
648            PersonDeleted => "person.deleted",
649            PersonUpdated => "person.updated",
650            PlanCreated => "plan.created",
651            PlanDeleted => "plan.deleted",
652            PlanUpdated => "plan.updated",
653            PriceCreated => "price.created",
654            PriceDeleted => "price.deleted",
655            PriceUpdated => "price.updated",
656            ProductCreated => "product.created",
657            ProductDeleted => "product.deleted",
658            ProductUpdated => "product.updated",
659            PromotionCodeCreated => "promotion_code.created",
660            PromotionCodeUpdated => "promotion_code.updated",
661            QuoteAccepted => "quote.accepted",
662            QuoteCanceled => "quote.canceled",
663            QuoteCreated => "quote.created",
664            QuoteFinalized => "quote.finalized",
665            RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created",
666            RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated",
667            RefundCreated => "refund.created",
668            RefundFailed => "refund.failed",
669            RefundUpdated => "refund.updated",
670            ReportingReportRunFailed => "reporting.report_run.failed",
671            ReportingReportRunSucceeded => "reporting.report_run.succeeded",
672            ReportingReportTypeUpdated => "reporting.report_type.updated",
673            ReviewClosed => "review.closed",
674            ReviewOpened => "review.opened",
675            SetupIntentCanceled => "setup_intent.canceled",
676            SetupIntentCreated => "setup_intent.created",
677            SetupIntentRequiresAction => "setup_intent.requires_action",
678            SetupIntentSetupFailed => "setup_intent.setup_failed",
679            SetupIntentSucceeded => "setup_intent.succeeded",
680            SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created",
681            SourceCanceled => "source.canceled",
682            SourceChargeable => "source.chargeable",
683            SourceFailed => "source.failed",
684            SourceMandateNotification => "source.mandate_notification",
685            SourceRefundAttributesRequired => "source.refund_attributes_required",
686            SourceTransactionCreated => "source.transaction.created",
687            SourceTransactionUpdated => "source.transaction.updated",
688            SubscriptionScheduleAborted => "subscription_schedule.aborted",
689            SubscriptionScheduleCanceled => "subscription_schedule.canceled",
690            SubscriptionScheduleCompleted => "subscription_schedule.completed",
691            SubscriptionScheduleCreated => "subscription_schedule.created",
692            SubscriptionScheduleExpiring => "subscription_schedule.expiring",
693            SubscriptionScheduleReleased => "subscription_schedule.released",
694            SubscriptionScheduleUpdated => "subscription_schedule.updated",
695            TaxSettingsUpdated => "tax.settings.updated",
696            TaxRateCreated => "tax_rate.created",
697            TaxRateUpdated => "tax_rate.updated",
698            TerminalReaderActionFailed => "terminal.reader.action_failed",
699            TerminalReaderActionSucceeded => "terminal.reader.action_succeeded",
700            TerminalReaderActionUpdated => "terminal.reader.action_updated",
701            TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing",
702            TestHelpersTestClockCreated => "test_helpers.test_clock.created",
703            TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted",
704            TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure",
705            TestHelpersTestClockReady => "test_helpers.test_clock.ready",
706            TopupCanceled => "topup.canceled",
707            TopupCreated => "topup.created",
708            TopupFailed => "topup.failed",
709            TopupReversed => "topup.reversed",
710            TopupSucceeded => "topup.succeeded",
711            TransferCreated => "transfer.created",
712            TransferReversed => "transfer.reversed",
713            TransferUpdated => "transfer.updated",
714            TreasuryCreditReversalCreated => "treasury.credit_reversal.created",
715            TreasuryCreditReversalPosted => "treasury.credit_reversal.posted",
716            TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed",
717            TreasuryDebitReversalCreated => "treasury.debit_reversal.created",
718            TreasuryDebitReversalInitialCreditGranted => {
719                "treasury.debit_reversal.initial_credit_granted"
720            }
721            TreasuryFinancialAccountClosed => "treasury.financial_account.closed",
722            TreasuryFinancialAccountCreated => "treasury.financial_account.created",
723            TreasuryFinancialAccountFeaturesStatusUpdated => {
724                "treasury.financial_account.features_status_updated"
725            }
726            TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled",
727            TreasuryInboundTransferCreated => "treasury.inbound_transfer.created",
728            TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed",
729            TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded",
730            TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled",
731            TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created",
732            TreasuryOutboundPaymentExpectedArrivalDateUpdated => {
733                "treasury.outbound_payment.expected_arrival_date_updated"
734            }
735            TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed",
736            TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted",
737            TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned",
738            TreasuryOutboundPaymentTrackingDetailsUpdated => {
739                "treasury.outbound_payment.tracking_details_updated"
740            }
741            TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled",
742            TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created",
743            TreasuryOutboundTransferExpectedArrivalDateUpdated => {
744                "treasury.outbound_transfer.expected_arrival_date_updated"
745            }
746            TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed",
747            TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted",
748            TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned",
749            TreasuryOutboundTransferTrackingDetailsUpdated => {
750                "treasury.outbound_transfer.tracking_details_updated"
751            }
752            TreasuryReceivedCreditCreated => "treasury.received_credit.created",
753            TreasuryReceivedCreditFailed => "treasury.received_credit.failed",
754            TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded",
755            TreasuryReceivedDebitCreated => "treasury.received_debit.created",
756            Unknown(v) => v,
757        }
758    }
759}
760
761impl std::str::FromStr for CreateWebhookEndpointEnabledEvents {
762    type Err = std::convert::Infallible;
763    fn from_str(s: &str) -> Result<Self, Self::Err> {
764        use CreateWebhookEndpointEnabledEvents::*;
765        match s {
766            "*" => Ok(All),
767            "account.application.authorized" => Ok(AccountApplicationAuthorized),
768            "account.application.deauthorized" => Ok(AccountApplicationDeauthorized),
769            "account.external_account.created" => Ok(AccountExternalAccountCreated),
770            "account.external_account.deleted" => Ok(AccountExternalAccountDeleted),
771            "account.external_account.updated" => Ok(AccountExternalAccountUpdated),
772            "account.updated" => Ok(AccountUpdated),
773            "application_fee.created" => Ok(ApplicationFeeCreated),
774            "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated),
775            "application_fee.refunded" => Ok(ApplicationFeeRefunded),
776            "balance.available" => Ok(BalanceAvailable),
777            "balance_settings.updated" => Ok(BalanceSettingsUpdated),
778            "billing.alert.triggered" => Ok(BillingAlertTriggered),
779            "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated),
780            "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated),
781            "billing_portal.session.created" => Ok(BillingPortalSessionCreated),
782            "capability.updated" => Ok(CapabilityUpdated),
783            "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable),
784            "charge.captured" => Ok(ChargeCaptured),
785            "charge.dispute.closed" => Ok(ChargeDisputeClosed),
786            "charge.dispute.created" => Ok(ChargeDisputeCreated),
787            "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated),
788            "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn),
789            "charge.dispute.updated" => Ok(ChargeDisputeUpdated),
790            "charge.expired" => Ok(ChargeExpired),
791            "charge.failed" => Ok(ChargeFailed),
792            "charge.pending" => Ok(ChargePending),
793            "charge.refund.updated" => Ok(ChargeRefundUpdated),
794            "charge.refunded" => Ok(ChargeRefunded),
795            "charge.succeeded" => Ok(ChargeSucceeded),
796            "charge.updated" => Ok(ChargeUpdated),
797            "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed),
798            "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded),
799            "checkout.session.completed" => Ok(CheckoutSessionCompleted),
800            "checkout.session.expired" => Ok(CheckoutSessionExpired),
801            "climate.order.canceled" => Ok(ClimateOrderCanceled),
802            "climate.order.created" => Ok(ClimateOrderCreated),
803            "climate.order.delayed" => Ok(ClimateOrderDelayed),
804            "climate.order.delivered" => Ok(ClimateOrderDelivered),
805            "climate.order.product_substituted" => Ok(ClimateOrderProductSubstituted),
806            "climate.product.created" => Ok(ClimateProductCreated),
807            "climate.product.pricing_updated" => Ok(ClimateProductPricingUpdated),
808            "coupon.created" => Ok(CouponCreated),
809            "coupon.deleted" => Ok(CouponDeleted),
810            "coupon.updated" => Ok(CouponUpdated),
811            "credit_note.created" => Ok(CreditNoteCreated),
812            "credit_note.updated" => Ok(CreditNoteUpdated),
813            "credit_note.voided" => Ok(CreditNoteVoided),
814            "customer.created" => Ok(CustomerCreated),
815            "customer.deleted" => Ok(CustomerDeleted),
816            "customer.discount.created" => Ok(CustomerDiscountCreated),
817            "customer.discount.deleted" => Ok(CustomerDiscountDeleted),
818            "customer.discount.updated" => Ok(CustomerDiscountUpdated),
819            "customer.source.created" => Ok(CustomerSourceCreated),
820            "customer.source.deleted" => Ok(CustomerSourceDeleted),
821            "customer.source.expiring" => Ok(CustomerSourceExpiring),
822            "customer.source.updated" => Ok(CustomerSourceUpdated),
823            "customer.subscription.created" => Ok(CustomerSubscriptionCreated),
824            "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted),
825            "customer.subscription.paused" => Ok(CustomerSubscriptionPaused),
826            "customer.subscription.pending_update_applied" => {
827                Ok(CustomerSubscriptionPendingUpdateApplied)
828            }
829            "customer.subscription.pending_update_expired" => {
830                Ok(CustomerSubscriptionPendingUpdateExpired)
831            }
832            "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed),
833            "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd),
834            "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated),
835            "customer.tax_id.created" => Ok(CustomerTaxIdCreated),
836            "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted),
837            "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated),
838            "customer.updated" => Ok(CustomerUpdated),
839            "customer_cash_balance_transaction.created" => {
840                Ok(CustomerCashBalanceTransactionCreated)
841            }
842            "entitlements.active_entitlement_summary.updated" => {
843                Ok(EntitlementsActiveEntitlementSummaryUpdated)
844            }
845            "file.created" => Ok(FileCreated),
846            "financial_connections.account.account_numbers_updated" => {
847                Ok(FinancialConnectionsAccountAccountNumbersUpdated)
848            }
849            "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated),
850            "financial_connections.account.deactivated" => {
851                Ok(FinancialConnectionsAccountDeactivated)
852            }
853            "financial_connections.account.disconnected" => {
854                Ok(FinancialConnectionsAccountDisconnected)
855            }
856            "financial_connections.account.reactivated" => {
857                Ok(FinancialConnectionsAccountReactivated)
858            }
859            "financial_connections.account.refreshed_balance" => {
860                Ok(FinancialConnectionsAccountRefreshedBalance)
861            }
862            "financial_connections.account.refreshed_ownership" => {
863                Ok(FinancialConnectionsAccountRefreshedOwnership)
864            }
865            "financial_connections.account.refreshed_transactions" => {
866                Ok(FinancialConnectionsAccountRefreshedTransactions)
867            }
868            "financial_connections.account.upcoming_account_number_expiry" => {
869                Ok(FinancialConnectionsAccountUpcomingAccountNumberExpiry)
870            }
871            "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled),
872            "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated),
873            "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing),
874            "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted),
875            "identity.verification_session.requires_input" => {
876                Ok(IdentityVerificationSessionRequiresInput)
877            }
878            "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified),
879            "invoice.created" => Ok(InvoiceCreated),
880            "invoice.deleted" => Ok(InvoiceDeleted),
881            "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed),
882            "invoice.finalized" => Ok(InvoiceFinalized),
883            "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible),
884            "invoice.overdue" => Ok(InvoiceOverdue),
885            "invoice.overpaid" => Ok(InvoiceOverpaid),
886            "invoice.paid" => Ok(InvoicePaid),
887            "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired),
888            "invoice.payment_attempt_required" => Ok(InvoicePaymentAttemptRequired),
889            "invoice.payment_failed" => Ok(InvoicePaymentFailed),
890            "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded),
891            "invoice.sent" => Ok(InvoiceSent),
892            "invoice.upcoming" => Ok(InvoiceUpcoming),
893            "invoice.updated" => Ok(InvoiceUpdated),
894            "invoice.voided" => Ok(InvoiceVoided),
895            "invoice.will_be_due" => Ok(InvoiceWillBeDue),
896            "invoice_payment.paid" => Ok(InvoicePaymentPaid),
897            "invoiceitem.created" => Ok(InvoiceitemCreated),
898            "invoiceitem.deleted" => Ok(InvoiceitemDeleted),
899            "issuing_authorization.created" => Ok(IssuingAuthorizationCreated),
900            "issuing_authorization.request" => Ok(IssuingAuthorizationRequest),
901            "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated),
902            "issuing_card.created" => Ok(IssuingCardCreated),
903            "issuing_card.updated" => Ok(IssuingCardUpdated),
904            "issuing_cardholder.created" => Ok(IssuingCardholderCreated),
905            "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated),
906            "issuing_dispute.closed" => Ok(IssuingDisputeClosed),
907            "issuing_dispute.created" => Ok(IssuingDisputeCreated),
908            "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated),
909            "issuing_dispute.funds_rescinded" => Ok(IssuingDisputeFundsRescinded),
910            "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted),
911            "issuing_dispute.updated" => Ok(IssuingDisputeUpdated),
912            "issuing_personalization_design.activated" => Ok(IssuingPersonalizationDesignActivated),
913            "issuing_personalization_design.deactivated" => {
914                Ok(IssuingPersonalizationDesignDeactivated)
915            }
916            "issuing_personalization_design.rejected" => Ok(IssuingPersonalizationDesignRejected),
917            "issuing_personalization_design.updated" => Ok(IssuingPersonalizationDesignUpdated),
918            "issuing_token.created" => Ok(IssuingTokenCreated),
919            "issuing_token.updated" => Ok(IssuingTokenUpdated),
920            "issuing_transaction.created" => Ok(IssuingTransactionCreated),
921            "issuing_transaction.purchase_details_receipt_updated" => {
922                Ok(IssuingTransactionPurchaseDetailsReceiptUpdated)
923            }
924            "issuing_transaction.updated" => Ok(IssuingTransactionUpdated),
925            "mandate.updated" => Ok(MandateUpdated),
926            "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated),
927            "payment_intent.canceled" => Ok(PaymentIntentCanceled),
928            "payment_intent.created" => Ok(PaymentIntentCreated),
929            "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded),
930            "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed),
931            "payment_intent.processing" => Ok(PaymentIntentProcessing),
932            "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction),
933            "payment_intent.succeeded" => Ok(PaymentIntentSucceeded),
934            "payment_link.created" => Ok(PaymentLinkCreated),
935            "payment_link.updated" => Ok(PaymentLinkUpdated),
936            "payment_method.attached" => Ok(PaymentMethodAttached),
937            "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated),
938            "payment_method.detached" => Ok(PaymentMethodDetached),
939            "payment_method.updated" => Ok(PaymentMethodUpdated),
940            "payout.canceled" => Ok(PayoutCanceled),
941            "payout.created" => Ok(PayoutCreated),
942            "payout.failed" => Ok(PayoutFailed),
943            "payout.paid" => Ok(PayoutPaid),
944            "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted),
945            "payout.updated" => Ok(PayoutUpdated),
946            "person.created" => Ok(PersonCreated),
947            "person.deleted" => Ok(PersonDeleted),
948            "person.updated" => Ok(PersonUpdated),
949            "plan.created" => Ok(PlanCreated),
950            "plan.deleted" => Ok(PlanDeleted),
951            "plan.updated" => Ok(PlanUpdated),
952            "price.created" => Ok(PriceCreated),
953            "price.deleted" => Ok(PriceDeleted),
954            "price.updated" => Ok(PriceUpdated),
955            "product.created" => Ok(ProductCreated),
956            "product.deleted" => Ok(ProductDeleted),
957            "product.updated" => Ok(ProductUpdated),
958            "promotion_code.created" => Ok(PromotionCodeCreated),
959            "promotion_code.updated" => Ok(PromotionCodeUpdated),
960            "quote.accepted" => Ok(QuoteAccepted),
961            "quote.canceled" => Ok(QuoteCanceled),
962            "quote.created" => Ok(QuoteCreated),
963            "quote.finalized" => Ok(QuoteFinalized),
964            "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated),
965            "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated),
966            "refund.created" => Ok(RefundCreated),
967            "refund.failed" => Ok(RefundFailed),
968            "refund.updated" => Ok(RefundUpdated),
969            "reporting.report_run.failed" => Ok(ReportingReportRunFailed),
970            "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded),
971            "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated),
972            "review.closed" => Ok(ReviewClosed),
973            "review.opened" => Ok(ReviewOpened),
974            "setup_intent.canceled" => Ok(SetupIntentCanceled),
975            "setup_intent.created" => Ok(SetupIntentCreated),
976            "setup_intent.requires_action" => Ok(SetupIntentRequiresAction),
977            "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed),
978            "setup_intent.succeeded" => Ok(SetupIntentSucceeded),
979            "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated),
980            "source.canceled" => Ok(SourceCanceled),
981            "source.chargeable" => Ok(SourceChargeable),
982            "source.failed" => Ok(SourceFailed),
983            "source.mandate_notification" => Ok(SourceMandateNotification),
984            "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired),
985            "source.transaction.created" => Ok(SourceTransactionCreated),
986            "source.transaction.updated" => Ok(SourceTransactionUpdated),
987            "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted),
988            "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled),
989            "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted),
990            "subscription_schedule.created" => Ok(SubscriptionScheduleCreated),
991            "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring),
992            "subscription_schedule.released" => Ok(SubscriptionScheduleReleased),
993            "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated),
994            "tax.settings.updated" => Ok(TaxSettingsUpdated),
995            "tax_rate.created" => Ok(TaxRateCreated),
996            "tax_rate.updated" => Ok(TaxRateUpdated),
997            "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed),
998            "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded),
999            "terminal.reader.action_updated" => Ok(TerminalReaderActionUpdated),
1000            "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing),
1001            "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated),
1002            "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted),
1003            "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure),
1004            "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady),
1005            "topup.canceled" => Ok(TopupCanceled),
1006            "topup.created" => Ok(TopupCreated),
1007            "topup.failed" => Ok(TopupFailed),
1008            "topup.reversed" => Ok(TopupReversed),
1009            "topup.succeeded" => Ok(TopupSucceeded),
1010            "transfer.created" => Ok(TransferCreated),
1011            "transfer.reversed" => Ok(TransferReversed),
1012            "transfer.updated" => Ok(TransferUpdated),
1013            "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated),
1014            "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted),
1015            "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted),
1016            "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated),
1017            "treasury.debit_reversal.initial_credit_granted" => {
1018                Ok(TreasuryDebitReversalInitialCreditGranted)
1019            }
1020            "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed),
1021            "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated),
1022            "treasury.financial_account.features_status_updated" => {
1023                Ok(TreasuryFinancialAccountFeaturesStatusUpdated)
1024            }
1025            "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled),
1026            "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated),
1027            "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed),
1028            "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded),
1029            "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled),
1030            "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated),
1031            "treasury.outbound_payment.expected_arrival_date_updated" => {
1032                Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated)
1033            }
1034            "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed),
1035            "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted),
1036            "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned),
1037            "treasury.outbound_payment.tracking_details_updated" => {
1038                Ok(TreasuryOutboundPaymentTrackingDetailsUpdated)
1039            }
1040            "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled),
1041            "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated),
1042            "treasury.outbound_transfer.expected_arrival_date_updated" => {
1043                Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated)
1044            }
1045            "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed),
1046            "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted),
1047            "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned),
1048            "treasury.outbound_transfer.tracking_details_updated" => {
1049                Ok(TreasuryOutboundTransferTrackingDetailsUpdated)
1050            }
1051            "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated),
1052            "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed),
1053            "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded),
1054            "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated),
1055            v => {
1056                tracing::warn!(
1057                    "Unknown value '{}' for enum '{}'",
1058                    v,
1059                    "CreateWebhookEndpointEnabledEvents"
1060                );
1061                Ok(Unknown(v.to_owned()))
1062            }
1063        }
1064    }
1065}
1066impl std::fmt::Display for CreateWebhookEndpointEnabledEvents {
1067    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1068        f.write_str(self.as_str())
1069    }
1070}
1071
1072impl std::fmt::Debug for CreateWebhookEndpointEnabledEvents {
1073    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1074        f.write_str(self.as_str())
1075    }
1076}
1077impl serde::Serialize for CreateWebhookEndpointEnabledEvents {
1078    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1079    where
1080        S: serde::Serializer,
1081    {
1082        serializer.serialize_str(self.as_str())
1083    }
1084}
1085#[cfg(feature = "deserialize")]
1086impl<'de> serde::Deserialize<'de> for CreateWebhookEndpointEnabledEvents {
1087    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1088        use std::str::FromStr;
1089        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1090        Ok(Self::from_str(&s).expect("infallible"))
1091    }
1092}
1093/// A webhook endpoint must have a `url` and a list of `enabled_events`.
1094/// You may optionally specify the Boolean `connect` parameter.
1095/// 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.
1096/// You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard.
1097#[derive(Clone, Debug, serde::Serialize)]
1098pub struct CreateWebhookEndpoint {
1099    inner: CreateWebhookEndpointBuilder,
1100}
1101impl CreateWebhookEndpoint {
1102    /// Construct a new `CreateWebhookEndpoint`.
1103    pub fn new(
1104        enabled_events: impl Into<Vec<CreateWebhookEndpointEnabledEvents>>,
1105        url: impl Into<String>,
1106    ) -> Self {
1107        Self { inner: CreateWebhookEndpointBuilder::new(enabled_events.into(), url.into()) }
1108    }
1109    /// Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version.
1110    pub fn api_version(mut self, api_version: impl Into<stripe_shared::ApiVersion>) -> Self {
1111        self.inner.api_version = Some(api_version.into());
1112        self
1113    }
1114    /// Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`).
1115    /// Defaults to `false`.
1116    pub fn connect(mut self, connect: impl Into<bool>) -> Self {
1117        self.inner.connect = Some(connect.into());
1118        self
1119    }
1120    /// An optional description of what the webhook is used for.
1121    pub fn description(mut self, description: impl Into<String>) -> Self {
1122        self.inner.description = Some(description.into());
1123        self
1124    }
1125    /// Specifies which fields in the response should be expanded.
1126    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
1127        self.inner.expand = Some(expand.into());
1128        self
1129    }
1130    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1131    /// This can be useful for storing additional information about the object in a structured format.
1132    /// Individual keys can be unset by posting an empty value to them.
1133    /// All keys can be unset by posting an empty value to `metadata`.
1134    pub fn metadata(
1135        mut self,
1136        metadata: impl Into<std::collections::HashMap<String, String>>,
1137    ) -> Self {
1138        self.inner.metadata = Some(metadata.into());
1139        self
1140    }
1141}
1142impl CreateWebhookEndpoint {
1143    /// Send the request and return the deserialized response.
1144    pub async fn send<C: StripeClient>(
1145        &self,
1146        client: &C,
1147    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
1148        self.customize().send(client).await
1149    }
1150
1151    /// Send the request and return the deserialized response, blocking until completion.
1152    pub fn send_blocking<C: StripeBlockingClient>(
1153        &self,
1154        client: &C,
1155    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
1156        self.customize().send_blocking(client)
1157    }
1158}
1159
1160impl StripeRequest for CreateWebhookEndpoint {
1161    type Output = stripe_misc::WebhookEndpoint;
1162
1163    fn build(&self) -> RequestBuilder {
1164        RequestBuilder::new(StripeMethod::Post, "/webhook_endpoints").form(&self.inner)
1165    }
1166}
1167#[derive(Clone, Debug, serde::Serialize)]
1168struct UpdateWebhookEndpointBuilder {
1169    #[serde(skip_serializing_if = "Option::is_none")]
1170    description: Option<String>,
1171    #[serde(skip_serializing_if = "Option::is_none")]
1172    disabled: Option<bool>,
1173    #[serde(skip_serializing_if = "Option::is_none")]
1174    enabled_events: Option<Vec<UpdateWebhookEndpointEnabledEvents>>,
1175    #[serde(skip_serializing_if = "Option::is_none")]
1176    expand: Option<Vec<String>>,
1177    #[serde(skip_serializing_if = "Option::is_none")]
1178    metadata: Option<std::collections::HashMap<String, String>>,
1179    #[serde(skip_serializing_if = "Option::is_none")]
1180    url: Option<String>,
1181}
1182impl UpdateWebhookEndpointBuilder {
1183    fn new() -> Self {
1184        Self {
1185            description: None,
1186            disabled: None,
1187            enabled_events: None,
1188            expand: None,
1189            metadata: None,
1190            url: None,
1191        }
1192    }
1193}
1194/// The list of events to enable for this endpoint.
1195/// You may specify `['*']` to enable all events, except those that require explicit selection.
1196#[derive(Clone, Eq, PartialEq)]
1197#[non_exhaustive]
1198pub enum UpdateWebhookEndpointEnabledEvents {
1199    All,
1200    AccountApplicationAuthorized,
1201    AccountApplicationDeauthorized,
1202    AccountExternalAccountCreated,
1203    AccountExternalAccountDeleted,
1204    AccountExternalAccountUpdated,
1205    AccountUpdated,
1206    ApplicationFeeCreated,
1207    ApplicationFeeRefundUpdated,
1208    ApplicationFeeRefunded,
1209    BalanceAvailable,
1210    BalanceSettingsUpdated,
1211    BillingAlertTriggered,
1212    BillingPortalConfigurationCreated,
1213    BillingPortalConfigurationUpdated,
1214    BillingPortalSessionCreated,
1215    CapabilityUpdated,
1216    CashBalanceFundsAvailable,
1217    ChargeCaptured,
1218    ChargeDisputeClosed,
1219    ChargeDisputeCreated,
1220    ChargeDisputeFundsReinstated,
1221    ChargeDisputeFundsWithdrawn,
1222    ChargeDisputeUpdated,
1223    ChargeExpired,
1224    ChargeFailed,
1225    ChargePending,
1226    ChargeRefundUpdated,
1227    ChargeRefunded,
1228    ChargeSucceeded,
1229    ChargeUpdated,
1230    CheckoutSessionAsyncPaymentFailed,
1231    CheckoutSessionAsyncPaymentSucceeded,
1232    CheckoutSessionCompleted,
1233    CheckoutSessionExpired,
1234    ClimateOrderCanceled,
1235    ClimateOrderCreated,
1236    ClimateOrderDelayed,
1237    ClimateOrderDelivered,
1238    ClimateOrderProductSubstituted,
1239    ClimateProductCreated,
1240    ClimateProductPricingUpdated,
1241    CouponCreated,
1242    CouponDeleted,
1243    CouponUpdated,
1244    CreditNoteCreated,
1245    CreditNoteUpdated,
1246    CreditNoteVoided,
1247    CustomerCreated,
1248    CustomerDeleted,
1249    CustomerDiscountCreated,
1250    CustomerDiscountDeleted,
1251    CustomerDiscountUpdated,
1252    CustomerSourceCreated,
1253    CustomerSourceDeleted,
1254    CustomerSourceExpiring,
1255    CustomerSourceUpdated,
1256    CustomerSubscriptionCreated,
1257    CustomerSubscriptionDeleted,
1258    CustomerSubscriptionPaused,
1259    CustomerSubscriptionPendingUpdateApplied,
1260    CustomerSubscriptionPendingUpdateExpired,
1261    CustomerSubscriptionResumed,
1262    CustomerSubscriptionTrialWillEnd,
1263    CustomerSubscriptionUpdated,
1264    CustomerTaxIdCreated,
1265    CustomerTaxIdDeleted,
1266    CustomerTaxIdUpdated,
1267    CustomerUpdated,
1268    CustomerCashBalanceTransactionCreated,
1269    EntitlementsActiveEntitlementSummaryUpdated,
1270    FileCreated,
1271    FinancialConnectionsAccountAccountNumbersUpdated,
1272    FinancialConnectionsAccountCreated,
1273    FinancialConnectionsAccountDeactivated,
1274    FinancialConnectionsAccountDisconnected,
1275    FinancialConnectionsAccountReactivated,
1276    FinancialConnectionsAccountRefreshedBalance,
1277    FinancialConnectionsAccountRefreshedOwnership,
1278    FinancialConnectionsAccountRefreshedTransactions,
1279    FinancialConnectionsAccountUpcomingAccountNumberExpiry,
1280    IdentityVerificationSessionCanceled,
1281    IdentityVerificationSessionCreated,
1282    IdentityVerificationSessionProcessing,
1283    IdentityVerificationSessionRedacted,
1284    IdentityVerificationSessionRequiresInput,
1285    IdentityVerificationSessionVerified,
1286    InvoiceCreated,
1287    InvoiceDeleted,
1288    InvoiceFinalizationFailed,
1289    InvoiceFinalized,
1290    InvoiceMarkedUncollectible,
1291    InvoiceOverdue,
1292    InvoiceOverpaid,
1293    InvoicePaid,
1294    InvoicePaymentActionRequired,
1295    InvoicePaymentAttemptRequired,
1296    InvoicePaymentFailed,
1297    InvoicePaymentSucceeded,
1298    InvoiceSent,
1299    InvoiceUpcoming,
1300    InvoiceUpdated,
1301    InvoiceVoided,
1302    InvoiceWillBeDue,
1303    InvoicePaymentPaid,
1304    InvoiceitemCreated,
1305    InvoiceitemDeleted,
1306    IssuingAuthorizationCreated,
1307    IssuingAuthorizationRequest,
1308    IssuingAuthorizationUpdated,
1309    IssuingCardCreated,
1310    IssuingCardUpdated,
1311    IssuingCardholderCreated,
1312    IssuingCardholderUpdated,
1313    IssuingDisputeClosed,
1314    IssuingDisputeCreated,
1315    IssuingDisputeFundsReinstated,
1316    IssuingDisputeFundsRescinded,
1317    IssuingDisputeSubmitted,
1318    IssuingDisputeUpdated,
1319    IssuingPersonalizationDesignActivated,
1320    IssuingPersonalizationDesignDeactivated,
1321    IssuingPersonalizationDesignRejected,
1322    IssuingPersonalizationDesignUpdated,
1323    IssuingTokenCreated,
1324    IssuingTokenUpdated,
1325    IssuingTransactionCreated,
1326    IssuingTransactionPurchaseDetailsReceiptUpdated,
1327    IssuingTransactionUpdated,
1328    MandateUpdated,
1329    PaymentIntentAmountCapturableUpdated,
1330    PaymentIntentCanceled,
1331    PaymentIntentCreated,
1332    PaymentIntentPartiallyFunded,
1333    PaymentIntentPaymentFailed,
1334    PaymentIntentProcessing,
1335    PaymentIntentRequiresAction,
1336    PaymentIntentSucceeded,
1337    PaymentLinkCreated,
1338    PaymentLinkUpdated,
1339    PaymentMethodAttached,
1340    PaymentMethodAutomaticallyUpdated,
1341    PaymentMethodDetached,
1342    PaymentMethodUpdated,
1343    PayoutCanceled,
1344    PayoutCreated,
1345    PayoutFailed,
1346    PayoutPaid,
1347    PayoutReconciliationCompleted,
1348    PayoutUpdated,
1349    PersonCreated,
1350    PersonDeleted,
1351    PersonUpdated,
1352    PlanCreated,
1353    PlanDeleted,
1354    PlanUpdated,
1355    PriceCreated,
1356    PriceDeleted,
1357    PriceUpdated,
1358    ProductCreated,
1359    ProductDeleted,
1360    ProductUpdated,
1361    PromotionCodeCreated,
1362    PromotionCodeUpdated,
1363    QuoteAccepted,
1364    QuoteCanceled,
1365    QuoteCreated,
1366    QuoteFinalized,
1367    RadarEarlyFraudWarningCreated,
1368    RadarEarlyFraudWarningUpdated,
1369    RefundCreated,
1370    RefundFailed,
1371    RefundUpdated,
1372    ReportingReportRunFailed,
1373    ReportingReportRunSucceeded,
1374    ReportingReportTypeUpdated,
1375    ReviewClosed,
1376    ReviewOpened,
1377    SetupIntentCanceled,
1378    SetupIntentCreated,
1379    SetupIntentRequiresAction,
1380    SetupIntentSetupFailed,
1381    SetupIntentSucceeded,
1382    SigmaScheduledQueryRunCreated,
1383    SourceCanceled,
1384    SourceChargeable,
1385    SourceFailed,
1386    SourceMandateNotification,
1387    SourceRefundAttributesRequired,
1388    SourceTransactionCreated,
1389    SourceTransactionUpdated,
1390    SubscriptionScheduleAborted,
1391    SubscriptionScheduleCanceled,
1392    SubscriptionScheduleCompleted,
1393    SubscriptionScheduleCreated,
1394    SubscriptionScheduleExpiring,
1395    SubscriptionScheduleReleased,
1396    SubscriptionScheduleUpdated,
1397    TaxSettingsUpdated,
1398    TaxRateCreated,
1399    TaxRateUpdated,
1400    TerminalReaderActionFailed,
1401    TerminalReaderActionSucceeded,
1402    TerminalReaderActionUpdated,
1403    TestHelpersTestClockAdvancing,
1404    TestHelpersTestClockCreated,
1405    TestHelpersTestClockDeleted,
1406    TestHelpersTestClockInternalFailure,
1407    TestHelpersTestClockReady,
1408    TopupCanceled,
1409    TopupCreated,
1410    TopupFailed,
1411    TopupReversed,
1412    TopupSucceeded,
1413    TransferCreated,
1414    TransferReversed,
1415    TransferUpdated,
1416    TreasuryCreditReversalCreated,
1417    TreasuryCreditReversalPosted,
1418    TreasuryDebitReversalCompleted,
1419    TreasuryDebitReversalCreated,
1420    TreasuryDebitReversalInitialCreditGranted,
1421    TreasuryFinancialAccountClosed,
1422    TreasuryFinancialAccountCreated,
1423    TreasuryFinancialAccountFeaturesStatusUpdated,
1424    TreasuryInboundTransferCanceled,
1425    TreasuryInboundTransferCreated,
1426    TreasuryInboundTransferFailed,
1427    TreasuryInboundTransferSucceeded,
1428    TreasuryOutboundPaymentCanceled,
1429    TreasuryOutboundPaymentCreated,
1430    TreasuryOutboundPaymentExpectedArrivalDateUpdated,
1431    TreasuryOutboundPaymentFailed,
1432    TreasuryOutboundPaymentPosted,
1433    TreasuryOutboundPaymentReturned,
1434    TreasuryOutboundPaymentTrackingDetailsUpdated,
1435    TreasuryOutboundTransferCanceled,
1436    TreasuryOutboundTransferCreated,
1437    TreasuryOutboundTransferExpectedArrivalDateUpdated,
1438    TreasuryOutboundTransferFailed,
1439    TreasuryOutboundTransferPosted,
1440    TreasuryOutboundTransferReturned,
1441    TreasuryOutboundTransferTrackingDetailsUpdated,
1442    TreasuryReceivedCreditCreated,
1443    TreasuryReceivedCreditFailed,
1444    TreasuryReceivedCreditSucceeded,
1445    TreasuryReceivedDebitCreated,
1446    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1447    Unknown(String),
1448}
1449impl UpdateWebhookEndpointEnabledEvents {
1450    pub fn as_str(&self) -> &str {
1451        use UpdateWebhookEndpointEnabledEvents::*;
1452        match self {
1453            All => "*",
1454            AccountApplicationAuthorized => "account.application.authorized",
1455            AccountApplicationDeauthorized => "account.application.deauthorized",
1456            AccountExternalAccountCreated => "account.external_account.created",
1457            AccountExternalAccountDeleted => "account.external_account.deleted",
1458            AccountExternalAccountUpdated => "account.external_account.updated",
1459            AccountUpdated => "account.updated",
1460            ApplicationFeeCreated => "application_fee.created",
1461            ApplicationFeeRefundUpdated => "application_fee.refund.updated",
1462            ApplicationFeeRefunded => "application_fee.refunded",
1463            BalanceAvailable => "balance.available",
1464            BalanceSettingsUpdated => "balance_settings.updated",
1465            BillingAlertTriggered => "billing.alert.triggered",
1466            BillingPortalConfigurationCreated => "billing_portal.configuration.created",
1467            BillingPortalConfigurationUpdated => "billing_portal.configuration.updated",
1468            BillingPortalSessionCreated => "billing_portal.session.created",
1469            CapabilityUpdated => "capability.updated",
1470            CashBalanceFundsAvailable => "cash_balance.funds_available",
1471            ChargeCaptured => "charge.captured",
1472            ChargeDisputeClosed => "charge.dispute.closed",
1473            ChargeDisputeCreated => "charge.dispute.created",
1474            ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated",
1475            ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn",
1476            ChargeDisputeUpdated => "charge.dispute.updated",
1477            ChargeExpired => "charge.expired",
1478            ChargeFailed => "charge.failed",
1479            ChargePending => "charge.pending",
1480            ChargeRefundUpdated => "charge.refund.updated",
1481            ChargeRefunded => "charge.refunded",
1482            ChargeSucceeded => "charge.succeeded",
1483            ChargeUpdated => "charge.updated",
1484            CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed",
1485            CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded",
1486            CheckoutSessionCompleted => "checkout.session.completed",
1487            CheckoutSessionExpired => "checkout.session.expired",
1488            ClimateOrderCanceled => "climate.order.canceled",
1489            ClimateOrderCreated => "climate.order.created",
1490            ClimateOrderDelayed => "climate.order.delayed",
1491            ClimateOrderDelivered => "climate.order.delivered",
1492            ClimateOrderProductSubstituted => "climate.order.product_substituted",
1493            ClimateProductCreated => "climate.product.created",
1494            ClimateProductPricingUpdated => "climate.product.pricing_updated",
1495            CouponCreated => "coupon.created",
1496            CouponDeleted => "coupon.deleted",
1497            CouponUpdated => "coupon.updated",
1498            CreditNoteCreated => "credit_note.created",
1499            CreditNoteUpdated => "credit_note.updated",
1500            CreditNoteVoided => "credit_note.voided",
1501            CustomerCreated => "customer.created",
1502            CustomerDeleted => "customer.deleted",
1503            CustomerDiscountCreated => "customer.discount.created",
1504            CustomerDiscountDeleted => "customer.discount.deleted",
1505            CustomerDiscountUpdated => "customer.discount.updated",
1506            CustomerSourceCreated => "customer.source.created",
1507            CustomerSourceDeleted => "customer.source.deleted",
1508            CustomerSourceExpiring => "customer.source.expiring",
1509            CustomerSourceUpdated => "customer.source.updated",
1510            CustomerSubscriptionCreated => "customer.subscription.created",
1511            CustomerSubscriptionDeleted => "customer.subscription.deleted",
1512            CustomerSubscriptionPaused => "customer.subscription.paused",
1513            CustomerSubscriptionPendingUpdateApplied => {
1514                "customer.subscription.pending_update_applied"
1515            }
1516            CustomerSubscriptionPendingUpdateExpired => {
1517                "customer.subscription.pending_update_expired"
1518            }
1519            CustomerSubscriptionResumed => "customer.subscription.resumed",
1520            CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end",
1521            CustomerSubscriptionUpdated => "customer.subscription.updated",
1522            CustomerTaxIdCreated => "customer.tax_id.created",
1523            CustomerTaxIdDeleted => "customer.tax_id.deleted",
1524            CustomerTaxIdUpdated => "customer.tax_id.updated",
1525            CustomerUpdated => "customer.updated",
1526            CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created",
1527            EntitlementsActiveEntitlementSummaryUpdated => {
1528                "entitlements.active_entitlement_summary.updated"
1529            }
1530            FileCreated => "file.created",
1531            FinancialConnectionsAccountAccountNumbersUpdated => {
1532                "financial_connections.account.account_numbers_updated"
1533            }
1534            FinancialConnectionsAccountCreated => "financial_connections.account.created",
1535            FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated",
1536            FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected",
1537            FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated",
1538            FinancialConnectionsAccountRefreshedBalance => {
1539                "financial_connections.account.refreshed_balance"
1540            }
1541            FinancialConnectionsAccountRefreshedOwnership => {
1542                "financial_connections.account.refreshed_ownership"
1543            }
1544            FinancialConnectionsAccountRefreshedTransactions => {
1545                "financial_connections.account.refreshed_transactions"
1546            }
1547            FinancialConnectionsAccountUpcomingAccountNumberExpiry => {
1548                "financial_connections.account.upcoming_account_number_expiry"
1549            }
1550            IdentityVerificationSessionCanceled => "identity.verification_session.canceled",
1551            IdentityVerificationSessionCreated => "identity.verification_session.created",
1552            IdentityVerificationSessionProcessing => "identity.verification_session.processing",
1553            IdentityVerificationSessionRedacted => "identity.verification_session.redacted",
1554            IdentityVerificationSessionRequiresInput => {
1555                "identity.verification_session.requires_input"
1556            }
1557            IdentityVerificationSessionVerified => "identity.verification_session.verified",
1558            InvoiceCreated => "invoice.created",
1559            InvoiceDeleted => "invoice.deleted",
1560            InvoiceFinalizationFailed => "invoice.finalization_failed",
1561            InvoiceFinalized => "invoice.finalized",
1562            InvoiceMarkedUncollectible => "invoice.marked_uncollectible",
1563            InvoiceOverdue => "invoice.overdue",
1564            InvoiceOverpaid => "invoice.overpaid",
1565            InvoicePaid => "invoice.paid",
1566            InvoicePaymentActionRequired => "invoice.payment_action_required",
1567            InvoicePaymentAttemptRequired => "invoice.payment_attempt_required",
1568            InvoicePaymentFailed => "invoice.payment_failed",
1569            InvoicePaymentSucceeded => "invoice.payment_succeeded",
1570            InvoiceSent => "invoice.sent",
1571            InvoiceUpcoming => "invoice.upcoming",
1572            InvoiceUpdated => "invoice.updated",
1573            InvoiceVoided => "invoice.voided",
1574            InvoiceWillBeDue => "invoice.will_be_due",
1575            InvoicePaymentPaid => "invoice_payment.paid",
1576            InvoiceitemCreated => "invoiceitem.created",
1577            InvoiceitemDeleted => "invoiceitem.deleted",
1578            IssuingAuthorizationCreated => "issuing_authorization.created",
1579            IssuingAuthorizationRequest => "issuing_authorization.request",
1580            IssuingAuthorizationUpdated => "issuing_authorization.updated",
1581            IssuingCardCreated => "issuing_card.created",
1582            IssuingCardUpdated => "issuing_card.updated",
1583            IssuingCardholderCreated => "issuing_cardholder.created",
1584            IssuingCardholderUpdated => "issuing_cardholder.updated",
1585            IssuingDisputeClosed => "issuing_dispute.closed",
1586            IssuingDisputeCreated => "issuing_dispute.created",
1587            IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated",
1588            IssuingDisputeFundsRescinded => "issuing_dispute.funds_rescinded",
1589            IssuingDisputeSubmitted => "issuing_dispute.submitted",
1590            IssuingDisputeUpdated => "issuing_dispute.updated",
1591            IssuingPersonalizationDesignActivated => "issuing_personalization_design.activated",
1592            IssuingPersonalizationDesignDeactivated => "issuing_personalization_design.deactivated",
1593            IssuingPersonalizationDesignRejected => "issuing_personalization_design.rejected",
1594            IssuingPersonalizationDesignUpdated => "issuing_personalization_design.updated",
1595            IssuingTokenCreated => "issuing_token.created",
1596            IssuingTokenUpdated => "issuing_token.updated",
1597            IssuingTransactionCreated => "issuing_transaction.created",
1598            IssuingTransactionPurchaseDetailsReceiptUpdated => {
1599                "issuing_transaction.purchase_details_receipt_updated"
1600            }
1601            IssuingTransactionUpdated => "issuing_transaction.updated",
1602            MandateUpdated => "mandate.updated",
1603            PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated",
1604            PaymentIntentCanceled => "payment_intent.canceled",
1605            PaymentIntentCreated => "payment_intent.created",
1606            PaymentIntentPartiallyFunded => "payment_intent.partially_funded",
1607            PaymentIntentPaymentFailed => "payment_intent.payment_failed",
1608            PaymentIntentProcessing => "payment_intent.processing",
1609            PaymentIntentRequiresAction => "payment_intent.requires_action",
1610            PaymentIntentSucceeded => "payment_intent.succeeded",
1611            PaymentLinkCreated => "payment_link.created",
1612            PaymentLinkUpdated => "payment_link.updated",
1613            PaymentMethodAttached => "payment_method.attached",
1614            PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated",
1615            PaymentMethodDetached => "payment_method.detached",
1616            PaymentMethodUpdated => "payment_method.updated",
1617            PayoutCanceled => "payout.canceled",
1618            PayoutCreated => "payout.created",
1619            PayoutFailed => "payout.failed",
1620            PayoutPaid => "payout.paid",
1621            PayoutReconciliationCompleted => "payout.reconciliation_completed",
1622            PayoutUpdated => "payout.updated",
1623            PersonCreated => "person.created",
1624            PersonDeleted => "person.deleted",
1625            PersonUpdated => "person.updated",
1626            PlanCreated => "plan.created",
1627            PlanDeleted => "plan.deleted",
1628            PlanUpdated => "plan.updated",
1629            PriceCreated => "price.created",
1630            PriceDeleted => "price.deleted",
1631            PriceUpdated => "price.updated",
1632            ProductCreated => "product.created",
1633            ProductDeleted => "product.deleted",
1634            ProductUpdated => "product.updated",
1635            PromotionCodeCreated => "promotion_code.created",
1636            PromotionCodeUpdated => "promotion_code.updated",
1637            QuoteAccepted => "quote.accepted",
1638            QuoteCanceled => "quote.canceled",
1639            QuoteCreated => "quote.created",
1640            QuoteFinalized => "quote.finalized",
1641            RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created",
1642            RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated",
1643            RefundCreated => "refund.created",
1644            RefundFailed => "refund.failed",
1645            RefundUpdated => "refund.updated",
1646            ReportingReportRunFailed => "reporting.report_run.failed",
1647            ReportingReportRunSucceeded => "reporting.report_run.succeeded",
1648            ReportingReportTypeUpdated => "reporting.report_type.updated",
1649            ReviewClosed => "review.closed",
1650            ReviewOpened => "review.opened",
1651            SetupIntentCanceled => "setup_intent.canceled",
1652            SetupIntentCreated => "setup_intent.created",
1653            SetupIntentRequiresAction => "setup_intent.requires_action",
1654            SetupIntentSetupFailed => "setup_intent.setup_failed",
1655            SetupIntentSucceeded => "setup_intent.succeeded",
1656            SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created",
1657            SourceCanceled => "source.canceled",
1658            SourceChargeable => "source.chargeable",
1659            SourceFailed => "source.failed",
1660            SourceMandateNotification => "source.mandate_notification",
1661            SourceRefundAttributesRequired => "source.refund_attributes_required",
1662            SourceTransactionCreated => "source.transaction.created",
1663            SourceTransactionUpdated => "source.transaction.updated",
1664            SubscriptionScheduleAborted => "subscription_schedule.aborted",
1665            SubscriptionScheduleCanceled => "subscription_schedule.canceled",
1666            SubscriptionScheduleCompleted => "subscription_schedule.completed",
1667            SubscriptionScheduleCreated => "subscription_schedule.created",
1668            SubscriptionScheduleExpiring => "subscription_schedule.expiring",
1669            SubscriptionScheduleReleased => "subscription_schedule.released",
1670            SubscriptionScheduleUpdated => "subscription_schedule.updated",
1671            TaxSettingsUpdated => "tax.settings.updated",
1672            TaxRateCreated => "tax_rate.created",
1673            TaxRateUpdated => "tax_rate.updated",
1674            TerminalReaderActionFailed => "terminal.reader.action_failed",
1675            TerminalReaderActionSucceeded => "terminal.reader.action_succeeded",
1676            TerminalReaderActionUpdated => "terminal.reader.action_updated",
1677            TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing",
1678            TestHelpersTestClockCreated => "test_helpers.test_clock.created",
1679            TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted",
1680            TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure",
1681            TestHelpersTestClockReady => "test_helpers.test_clock.ready",
1682            TopupCanceled => "topup.canceled",
1683            TopupCreated => "topup.created",
1684            TopupFailed => "topup.failed",
1685            TopupReversed => "topup.reversed",
1686            TopupSucceeded => "topup.succeeded",
1687            TransferCreated => "transfer.created",
1688            TransferReversed => "transfer.reversed",
1689            TransferUpdated => "transfer.updated",
1690            TreasuryCreditReversalCreated => "treasury.credit_reversal.created",
1691            TreasuryCreditReversalPosted => "treasury.credit_reversal.posted",
1692            TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed",
1693            TreasuryDebitReversalCreated => "treasury.debit_reversal.created",
1694            TreasuryDebitReversalInitialCreditGranted => {
1695                "treasury.debit_reversal.initial_credit_granted"
1696            }
1697            TreasuryFinancialAccountClosed => "treasury.financial_account.closed",
1698            TreasuryFinancialAccountCreated => "treasury.financial_account.created",
1699            TreasuryFinancialAccountFeaturesStatusUpdated => {
1700                "treasury.financial_account.features_status_updated"
1701            }
1702            TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled",
1703            TreasuryInboundTransferCreated => "treasury.inbound_transfer.created",
1704            TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed",
1705            TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded",
1706            TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled",
1707            TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created",
1708            TreasuryOutboundPaymentExpectedArrivalDateUpdated => {
1709                "treasury.outbound_payment.expected_arrival_date_updated"
1710            }
1711            TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed",
1712            TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted",
1713            TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned",
1714            TreasuryOutboundPaymentTrackingDetailsUpdated => {
1715                "treasury.outbound_payment.tracking_details_updated"
1716            }
1717            TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled",
1718            TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created",
1719            TreasuryOutboundTransferExpectedArrivalDateUpdated => {
1720                "treasury.outbound_transfer.expected_arrival_date_updated"
1721            }
1722            TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed",
1723            TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted",
1724            TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned",
1725            TreasuryOutboundTransferTrackingDetailsUpdated => {
1726                "treasury.outbound_transfer.tracking_details_updated"
1727            }
1728            TreasuryReceivedCreditCreated => "treasury.received_credit.created",
1729            TreasuryReceivedCreditFailed => "treasury.received_credit.failed",
1730            TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded",
1731            TreasuryReceivedDebitCreated => "treasury.received_debit.created",
1732            Unknown(v) => v,
1733        }
1734    }
1735}
1736
1737impl std::str::FromStr for UpdateWebhookEndpointEnabledEvents {
1738    type Err = std::convert::Infallible;
1739    fn from_str(s: &str) -> Result<Self, Self::Err> {
1740        use UpdateWebhookEndpointEnabledEvents::*;
1741        match s {
1742            "*" => Ok(All),
1743            "account.application.authorized" => Ok(AccountApplicationAuthorized),
1744            "account.application.deauthorized" => Ok(AccountApplicationDeauthorized),
1745            "account.external_account.created" => Ok(AccountExternalAccountCreated),
1746            "account.external_account.deleted" => Ok(AccountExternalAccountDeleted),
1747            "account.external_account.updated" => Ok(AccountExternalAccountUpdated),
1748            "account.updated" => Ok(AccountUpdated),
1749            "application_fee.created" => Ok(ApplicationFeeCreated),
1750            "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated),
1751            "application_fee.refunded" => Ok(ApplicationFeeRefunded),
1752            "balance.available" => Ok(BalanceAvailable),
1753            "balance_settings.updated" => Ok(BalanceSettingsUpdated),
1754            "billing.alert.triggered" => Ok(BillingAlertTriggered),
1755            "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated),
1756            "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated),
1757            "billing_portal.session.created" => Ok(BillingPortalSessionCreated),
1758            "capability.updated" => Ok(CapabilityUpdated),
1759            "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable),
1760            "charge.captured" => Ok(ChargeCaptured),
1761            "charge.dispute.closed" => Ok(ChargeDisputeClosed),
1762            "charge.dispute.created" => Ok(ChargeDisputeCreated),
1763            "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated),
1764            "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn),
1765            "charge.dispute.updated" => Ok(ChargeDisputeUpdated),
1766            "charge.expired" => Ok(ChargeExpired),
1767            "charge.failed" => Ok(ChargeFailed),
1768            "charge.pending" => Ok(ChargePending),
1769            "charge.refund.updated" => Ok(ChargeRefundUpdated),
1770            "charge.refunded" => Ok(ChargeRefunded),
1771            "charge.succeeded" => Ok(ChargeSucceeded),
1772            "charge.updated" => Ok(ChargeUpdated),
1773            "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed),
1774            "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded),
1775            "checkout.session.completed" => Ok(CheckoutSessionCompleted),
1776            "checkout.session.expired" => Ok(CheckoutSessionExpired),
1777            "climate.order.canceled" => Ok(ClimateOrderCanceled),
1778            "climate.order.created" => Ok(ClimateOrderCreated),
1779            "climate.order.delayed" => Ok(ClimateOrderDelayed),
1780            "climate.order.delivered" => Ok(ClimateOrderDelivered),
1781            "climate.order.product_substituted" => Ok(ClimateOrderProductSubstituted),
1782            "climate.product.created" => Ok(ClimateProductCreated),
1783            "climate.product.pricing_updated" => Ok(ClimateProductPricingUpdated),
1784            "coupon.created" => Ok(CouponCreated),
1785            "coupon.deleted" => Ok(CouponDeleted),
1786            "coupon.updated" => Ok(CouponUpdated),
1787            "credit_note.created" => Ok(CreditNoteCreated),
1788            "credit_note.updated" => Ok(CreditNoteUpdated),
1789            "credit_note.voided" => Ok(CreditNoteVoided),
1790            "customer.created" => Ok(CustomerCreated),
1791            "customer.deleted" => Ok(CustomerDeleted),
1792            "customer.discount.created" => Ok(CustomerDiscountCreated),
1793            "customer.discount.deleted" => Ok(CustomerDiscountDeleted),
1794            "customer.discount.updated" => Ok(CustomerDiscountUpdated),
1795            "customer.source.created" => Ok(CustomerSourceCreated),
1796            "customer.source.deleted" => Ok(CustomerSourceDeleted),
1797            "customer.source.expiring" => Ok(CustomerSourceExpiring),
1798            "customer.source.updated" => Ok(CustomerSourceUpdated),
1799            "customer.subscription.created" => Ok(CustomerSubscriptionCreated),
1800            "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted),
1801            "customer.subscription.paused" => Ok(CustomerSubscriptionPaused),
1802            "customer.subscription.pending_update_applied" => {
1803                Ok(CustomerSubscriptionPendingUpdateApplied)
1804            }
1805            "customer.subscription.pending_update_expired" => {
1806                Ok(CustomerSubscriptionPendingUpdateExpired)
1807            }
1808            "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed),
1809            "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd),
1810            "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated),
1811            "customer.tax_id.created" => Ok(CustomerTaxIdCreated),
1812            "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted),
1813            "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated),
1814            "customer.updated" => Ok(CustomerUpdated),
1815            "customer_cash_balance_transaction.created" => {
1816                Ok(CustomerCashBalanceTransactionCreated)
1817            }
1818            "entitlements.active_entitlement_summary.updated" => {
1819                Ok(EntitlementsActiveEntitlementSummaryUpdated)
1820            }
1821            "file.created" => Ok(FileCreated),
1822            "financial_connections.account.account_numbers_updated" => {
1823                Ok(FinancialConnectionsAccountAccountNumbersUpdated)
1824            }
1825            "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated),
1826            "financial_connections.account.deactivated" => {
1827                Ok(FinancialConnectionsAccountDeactivated)
1828            }
1829            "financial_connections.account.disconnected" => {
1830                Ok(FinancialConnectionsAccountDisconnected)
1831            }
1832            "financial_connections.account.reactivated" => {
1833                Ok(FinancialConnectionsAccountReactivated)
1834            }
1835            "financial_connections.account.refreshed_balance" => {
1836                Ok(FinancialConnectionsAccountRefreshedBalance)
1837            }
1838            "financial_connections.account.refreshed_ownership" => {
1839                Ok(FinancialConnectionsAccountRefreshedOwnership)
1840            }
1841            "financial_connections.account.refreshed_transactions" => {
1842                Ok(FinancialConnectionsAccountRefreshedTransactions)
1843            }
1844            "financial_connections.account.upcoming_account_number_expiry" => {
1845                Ok(FinancialConnectionsAccountUpcomingAccountNumberExpiry)
1846            }
1847            "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled),
1848            "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated),
1849            "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing),
1850            "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted),
1851            "identity.verification_session.requires_input" => {
1852                Ok(IdentityVerificationSessionRequiresInput)
1853            }
1854            "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified),
1855            "invoice.created" => Ok(InvoiceCreated),
1856            "invoice.deleted" => Ok(InvoiceDeleted),
1857            "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed),
1858            "invoice.finalized" => Ok(InvoiceFinalized),
1859            "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible),
1860            "invoice.overdue" => Ok(InvoiceOverdue),
1861            "invoice.overpaid" => Ok(InvoiceOverpaid),
1862            "invoice.paid" => Ok(InvoicePaid),
1863            "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired),
1864            "invoice.payment_attempt_required" => Ok(InvoicePaymentAttemptRequired),
1865            "invoice.payment_failed" => Ok(InvoicePaymentFailed),
1866            "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded),
1867            "invoice.sent" => Ok(InvoiceSent),
1868            "invoice.upcoming" => Ok(InvoiceUpcoming),
1869            "invoice.updated" => Ok(InvoiceUpdated),
1870            "invoice.voided" => Ok(InvoiceVoided),
1871            "invoice.will_be_due" => Ok(InvoiceWillBeDue),
1872            "invoice_payment.paid" => Ok(InvoicePaymentPaid),
1873            "invoiceitem.created" => Ok(InvoiceitemCreated),
1874            "invoiceitem.deleted" => Ok(InvoiceitemDeleted),
1875            "issuing_authorization.created" => Ok(IssuingAuthorizationCreated),
1876            "issuing_authorization.request" => Ok(IssuingAuthorizationRequest),
1877            "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated),
1878            "issuing_card.created" => Ok(IssuingCardCreated),
1879            "issuing_card.updated" => Ok(IssuingCardUpdated),
1880            "issuing_cardholder.created" => Ok(IssuingCardholderCreated),
1881            "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated),
1882            "issuing_dispute.closed" => Ok(IssuingDisputeClosed),
1883            "issuing_dispute.created" => Ok(IssuingDisputeCreated),
1884            "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated),
1885            "issuing_dispute.funds_rescinded" => Ok(IssuingDisputeFundsRescinded),
1886            "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted),
1887            "issuing_dispute.updated" => Ok(IssuingDisputeUpdated),
1888            "issuing_personalization_design.activated" => Ok(IssuingPersonalizationDesignActivated),
1889            "issuing_personalization_design.deactivated" => {
1890                Ok(IssuingPersonalizationDesignDeactivated)
1891            }
1892            "issuing_personalization_design.rejected" => Ok(IssuingPersonalizationDesignRejected),
1893            "issuing_personalization_design.updated" => Ok(IssuingPersonalizationDesignUpdated),
1894            "issuing_token.created" => Ok(IssuingTokenCreated),
1895            "issuing_token.updated" => Ok(IssuingTokenUpdated),
1896            "issuing_transaction.created" => Ok(IssuingTransactionCreated),
1897            "issuing_transaction.purchase_details_receipt_updated" => {
1898                Ok(IssuingTransactionPurchaseDetailsReceiptUpdated)
1899            }
1900            "issuing_transaction.updated" => Ok(IssuingTransactionUpdated),
1901            "mandate.updated" => Ok(MandateUpdated),
1902            "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated),
1903            "payment_intent.canceled" => Ok(PaymentIntentCanceled),
1904            "payment_intent.created" => Ok(PaymentIntentCreated),
1905            "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded),
1906            "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed),
1907            "payment_intent.processing" => Ok(PaymentIntentProcessing),
1908            "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction),
1909            "payment_intent.succeeded" => Ok(PaymentIntentSucceeded),
1910            "payment_link.created" => Ok(PaymentLinkCreated),
1911            "payment_link.updated" => Ok(PaymentLinkUpdated),
1912            "payment_method.attached" => Ok(PaymentMethodAttached),
1913            "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated),
1914            "payment_method.detached" => Ok(PaymentMethodDetached),
1915            "payment_method.updated" => Ok(PaymentMethodUpdated),
1916            "payout.canceled" => Ok(PayoutCanceled),
1917            "payout.created" => Ok(PayoutCreated),
1918            "payout.failed" => Ok(PayoutFailed),
1919            "payout.paid" => Ok(PayoutPaid),
1920            "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted),
1921            "payout.updated" => Ok(PayoutUpdated),
1922            "person.created" => Ok(PersonCreated),
1923            "person.deleted" => Ok(PersonDeleted),
1924            "person.updated" => Ok(PersonUpdated),
1925            "plan.created" => Ok(PlanCreated),
1926            "plan.deleted" => Ok(PlanDeleted),
1927            "plan.updated" => Ok(PlanUpdated),
1928            "price.created" => Ok(PriceCreated),
1929            "price.deleted" => Ok(PriceDeleted),
1930            "price.updated" => Ok(PriceUpdated),
1931            "product.created" => Ok(ProductCreated),
1932            "product.deleted" => Ok(ProductDeleted),
1933            "product.updated" => Ok(ProductUpdated),
1934            "promotion_code.created" => Ok(PromotionCodeCreated),
1935            "promotion_code.updated" => Ok(PromotionCodeUpdated),
1936            "quote.accepted" => Ok(QuoteAccepted),
1937            "quote.canceled" => Ok(QuoteCanceled),
1938            "quote.created" => Ok(QuoteCreated),
1939            "quote.finalized" => Ok(QuoteFinalized),
1940            "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated),
1941            "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated),
1942            "refund.created" => Ok(RefundCreated),
1943            "refund.failed" => Ok(RefundFailed),
1944            "refund.updated" => Ok(RefundUpdated),
1945            "reporting.report_run.failed" => Ok(ReportingReportRunFailed),
1946            "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded),
1947            "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated),
1948            "review.closed" => Ok(ReviewClosed),
1949            "review.opened" => Ok(ReviewOpened),
1950            "setup_intent.canceled" => Ok(SetupIntentCanceled),
1951            "setup_intent.created" => Ok(SetupIntentCreated),
1952            "setup_intent.requires_action" => Ok(SetupIntentRequiresAction),
1953            "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed),
1954            "setup_intent.succeeded" => Ok(SetupIntentSucceeded),
1955            "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated),
1956            "source.canceled" => Ok(SourceCanceled),
1957            "source.chargeable" => Ok(SourceChargeable),
1958            "source.failed" => Ok(SourceFailed),
1959            "source.mandate_notification" => Ok(SourceMandateNotification),
1960            "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired),
1961            "source.transaction.created" => Ok(SourceTransactionCreated),
1962            "source.transaction.updated" => Ok(SourceTransactionUpdated),
1963            "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted),
1964            "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled),
1965            "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted),
1966            "subscription_schedule.created" => Ok(SubscriptionScheduleCreated),
1967            "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring),
1968            "subscription_schedule.released" => Ok(SubscriptionScheduleReleased),
1969            "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated),
1970            "tax.settings.updated" => Ok(TaxSettingsUpdated),
1971            "tax_rate.created" => Ok(TaxRateCreated),
1972            "tax_rate.updated" => Ok(TaxRateUpdated),
1973            "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed),
1974            "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded),
1975            "terminal.reader.action_updated" => Ok(TerminalReaderActionUpdated),
1976            "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing),
1977            "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated),
1978            "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted),
1979            "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure),
1980            "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady),
1981            "topup.canceled" => Ok(TopupCanceled),
1982            "topup.created" => Ok(TopupCreated),
1983            "topup.failed" => Ok(TopupFailed),
1984            "topup.reversed" => Ok(TopupReversed),
1985            "topup.succeeded" => Ok(TopupSucceeded),
1986            "transfer.created" => Ok(TransferCreated),
1987            "transfer.reversed" => Ok(TransferReversed),
1988            "transfer.updated" => Ok(TransferUpdated),
1989            "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated),
1990            "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted),
1991            "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted),
1992            "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated),
1993            "treasury.debit_reversal.initial_credit_granted" => {
1994                Ok(TreasuryDebitReversalInitialCreditGranted)
1995            }
1996            "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed),
1997            "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated),
1998            "treasury.financial_account.features_status_updated" => {
1999                Ok(TreasuryFinancialAccountFeaturesStatusUpdated)
2000            }
2001            "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled),
2002            "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated),
2003            "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed),
2004            "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded),
2005            "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled),
2006            "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated),
2007            "treasury.outbound_payment.expected_arrival_date_updated" => {
2008                Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated)
2009            }
2010            "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed),
2011            "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted),
2012            "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned),
2013            "treasury.outbound_payment.tracking_details_updated" => {
2014                Ok(TreasuryOutboundPaymentTrackingDetailsUpdated)
2015            }
2016            "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled),
2017            "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated),
2018            "treasury.outbound_transfer.expected_arrival_date_updated" => {
2019                Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated)
2020            }
2021            "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed),
2022            "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted),
2023            "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned),
2024            "treasury.outbound_transfer.tracking_details_updated" => {
2025                Ok(TreasuryOutboundTransferTrackingDetailsUpdated)
2026            }
2027            "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated),
2028            "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed),
2029            "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded),
2030            "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated),
2031            v => {
2032                tracing::warn!(
2033                    "Unknown value '{}' for enum '{}'",
2034                    v,
2035                    "UpdateWebhookEndpointEnabledEvents"
2036                );
2037                Ok(Unknown(v.to_owned()))
2038            }
2039        }
2040    }
2041}
2042impl std::fmt::Display for UpdateWebhookEndpointEnabledEvents {
2043    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2044        f.write_str(self.as_str())
2045    }
2046}
2047
2048impl std::fmt::Debug for UpdateWebhookEndpointEnabledEvents {
2049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2050        f.write_str(self.as_str())
2051    }
2052}
2053impl serde::Serialize for UpdateWebhookEndpointEnabledEvents {
2054    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2055    where
2056        S: serde::Serializer,
2057    {
2058        serializer.serialize_str(self.as_str())
2059    }
2060}
2061#[cfg(feature = "deserialize")]
2062impl<'de> serde::Deserialize<'de> for UpdateWebhookEndpointEnabledEvents {
2063    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2064        use std::str::FromStr;
2065        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2066        Ok(Self::from_str(&s).expect("infallible"))
2067    }
2068}
2069/// Updates the webhook endpoint.
2070/// You may edit the `url`, the list of `enabled_events`, and the status of your endpoint.
2071#[derive(Clone, Debug, serde::Serialize)]
2072pub struct UpdateWebhookEndpoint {
2073    inner: UpdateWebhookEndpointBuilder,
2074    webhook_endpoint: stripe_misc::WebhookEndpointId,
2075}
2076impl UpdateWebhookEndpoint {
2077    /// Construct a new `UpdateWebhookEndpoint`.
2078    pub fn new(webhook_endpoint: impl Into<stripe_misc::WebhookEndpointId>) -> Self {
2079        Self {
2080            webhook_endpoint: webhook_endpoint.into(),
2081            inner: UpdateWebhookEndpointBuilder::new(),
2082        }
2083    }
2084    /// An optional description of what the webhook is used for.
2085    pub fn description(mut self, description: impl Into<String>) -> Self {
2086        self.inner.description = Some(description.into());
2087        self
2088    }
2089    /// Disable the webhook endpoint if set to true.
2090    pub fn disabled(mut self, disabled: impl Into<bool>) -> Self {
2091        self.inner.disabled = Some(disabled.into());
2092        self
2093    }
2094    /// The list of events to enable for this endpoint.
2095    /// You may specify `['*']` to enable all events, except those that require explicit selection.
2096    pub fn enabled_events(
2097        mut self,
2098        enabled_events: impl Into<Vec<UpdateWebhookEndpointEnabledEvents>>,
2099    ) -> Self {
2100        self.inner.enabled_events = Some(enabled_events.into());
2101        self
2102    }
2103    /// Specifies which fields in the response should be expanded.
2104    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
2105        self.inner.expand = Some(expand.into());
2106        self
2107    }
2108    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
2109    /// This can be useful for storing additional information about the object in a structured format.
2110    /// Individual keys can be unset by posting an empty value to them.
2111    /// All keys can be unset by posting an empty value to `metadata`.
2112    pub fn metadata(
2113        mut self,
2114        metadata: impl Into<std::collections::HashMap<String, String>>,
2115    ) -> Self {
2116        self.inner.metadata = Some(metadata.into());
2117        self
2118    }
2119    /// The URL of the webhook endpoint.
2120    pub fn url(mut self, url: impl Into<String>) -> Self {
2121        self.inner.url = Some(url.into());
2122        self
2123    }
2124}
2125impl UpdateWebhookEndpoint {
2126    /// Send the request and return the deserialized response.
2127    pub async fn send<C: StripeClient>(
2128        &self,
2129        client: &C,
2130    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
2131        self.customize().send(client).await
2132    }
2133
2134    /// Send the request and return the deserialized response, blocking until completion.
2135    pub fn send_blocking<C: StripeBlockingClient>(
2136        &self,
2137        client: &C,
2138    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
2139        self.customize().send_blocking(client)
2140    }
2141}
2142
2143impl StripeRequest for UpdateWebhookEndpoint {
2144    type Output = stripe_misc::WebhookEndpoint;
2145
2146    fn build(&self) -> RequestBuilder {
2147        let webhook_endpoint = &self.webhook_endpoint;
2148        RequestBuilder::new(StripeMethod::Post, format!("/webhook_endpoints/{webhook_endpoint}"))
2149            .form(&self.inner)
2150    }
2151}