Skip to main content

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