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