stripe_misc/webhook_endpoint/
requests.rs

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