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