1use stripe_client_core::{
2 RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Eq, PartialEq)]
6#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7#[derive(serde::Serialize)]
8struct ListSetupIntentBuilder {
9 #[serde(skip_serializing_if = "Option::is_none")]
10 attach_to_self: Option<bool>,
11 #[serde(skip_serializing_if = "Option::is_none")]
12 created: Option<stripe_types::RangeQueryTs>,
13 #[serde(skip_serializing_if = "Option::is_none")]
14 customer: Option<String>,
15 #[serde(skip_serializing_if = "Option::is_none")]
16 customer_account: Option<String>,
17 #[serde(skip_serializing_if = "Option::is_none")]
18 ending_before: Option<String>,
19 #[serde(skip_serializing_if = "Option::is_none")]
20 expand: Option<Vec<String>>,
21 #[serde(skip_serializing_if = "Option::is_none")]
22 limit: Option<i64>,
23 #[serde(skip_serializing_if = "Option::is_none")]
24 payment_method: Option<String>,
25 #[serde(skip_serializing_if = "Option::is_none")]
26 starting_after: Option<String>,
27}
28#[cfg(feature = "redact-generated-debug")]
29impl std::fmt::Debug for ListSetupIntentBuilder {
30 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31 f.debug_struct("ListSetupIntentBuilder").finish_non_exhaustive()
32 }
33}
34impl ListSetupIntentBuilder {
35 fn new() -> Self {
36 Self {
37 attach_to_self: None,
38 created: None,
39 customer: None,
40 customer_account: None,
41 ending_before: None,
42 expand: None,
43 limit: None,
44 payment_method: None,
45 starting_after: None,
46 }
47 }
48}
49#[derive(Clone)]
51#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
52#[derive(serde::Serialize)]
53pub struct ListSetupIntent {
54 inner: ListSetupIntentBuilder,
55}
56#[cfg(feature = "redact-generated-debug")]
57impl std::fmt::Debug for ListSetupIntent {
58 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
59 f.debug_struct("ListSetupIntent").finish_non_exhaustive()
60 }
61}
62impl ListSetupIntent {
63 pub fn new() -> Self {
65 Self { inner: ListSetupIntentBuilder::new() }
66 }
67 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
72 self.inner.attach_to_self = Some(attach_to_self.into());
73 self
74 }
75 pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
78 self.inner.created = Some(created.into());
79 self
80 }
81 pub fn customer(mut self, customer: impl Into<String>) -> Self {
83 self.inner.customer = Some(customer.into());
84 self
85 }
86 pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
88 self.inner.customer_account = Some(customer_account.into());
89 self
90 }
91 pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
95 self.inner.ending_before = Some(ending_before.into());
96 self
97 }
98 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
100 self.inner.expand = Some(expand.into());
101 self
102 }
103 pub fn limit(mut self, limit: impl Into<i64>) -> Self {
106 self.inner.limit = Some(limit.into());
107 self
108 }
109 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
111 self.inner.payment_method = Some(payment_method.into());
112 self
113 }
114 pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
118 self.inner.starting_after = Some(starting_after.into());
119 self
120 }
121}
122impl Default for ListSetupIntent {
123 fn default() -> Self {
124 Self::new()
125 }
126}
127impl ListSetupIntent {
128 pub async fn send<C: StripeClient>(
130 &self,
131 client: &C,
132 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
133 self.customize().send(client).await
134 }
135
136 pub fn send_blocking<C: StripeBlockingClient>(
138 &self,
139 client: &C,
140 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
141 self.customize().send_blocking(client)
142 }
143
144 pub fn paginate(
145 &self,
146 ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::SetupIntent>> {
147 stripe_client_core::ListPaginator::new_list("/setup_intents", &self.inner)
148 }
149}
150
151impl StripeRequest for ListSetupIntent {
152 type Output = stripe_types::List<stripe_shared::SetupIntent>;
153
154 fn build(&self) -> RequestBuilder {
155 RequestBuilder::new(StripeMethod::Get, "/setup_intents").query(&self.inner)
156 }
157}
158#[derive(Clone, Eq, PartialEq)]
159#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
160#[derive(serde::Serialize)]
161struct RetrieveSetupIntentBuilder {
162 #[serde(skip_serializing_if = "Option::is_none")]
163 client_secret: Option<String>,
164 #[serde(skip_serializing_if = "Option::is_none")]
165 expand: Option<Vec<String>>,
166}
167#[cfg(feature = "redact-generated-debug")]
168impl std::fmt::Debug for RetrieveSetupIntentBuilder {
169 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
170 f.debug_struct("RetrieveSetupIntentBuilder").finish_non_exhaustive()
171 }
172}
173impl RetrieveSetupIntentBuilder {
174 fn new() -> Self {
175 Self { client_secret: None, expand: None }
176 }
177}
178#[derive(Clone)]
186#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
187#[derive(serde::Serialize)]
188pub struct RetrieveSetupIntent {
189 inner: RetrieveSetupIntentBuilder,
190 intent: stripe_shared::SetupIntentId,
191}
192#[cfg(feature = "redact-generated-debug")]
193impl std::fmt::Debug for RetrieveSetupIntent {
194 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
195 f.debug_struct("RetrieveSetupIntent").finish_non_exhaustive()
196 }
197}
198impl RetrieveSetupIntent {
199 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
201 Self { intent: intent.into(), inner: RetrieveSetupIntentBuilder::new() }
202 }
203 pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
206 self.inner.client_secret = Some(client_secret.into());
207 self
208 }
209 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
211 self.inner.expand = Some(expand.into());
212 self
213 }
214}
215impl RetrieveSetupIntent {
216 pub async fn send<C: StripeClient>(
218 &self,
219 client: &C,
220 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
221 self.customize().send(client).await
222 }
223
224 pub fn send_blocking<C: StripeBlockingClient>(
226 &self,
227 client: &C,
228 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
229 self.customize().send_blocking(client)
230 }
231}
232
233impl StripeRequest for RetrieveSetupIntent {
234 type Output = stripe_shared::SetupIntent;
235
236 fn build(&self) -> RequestBuilder {
237 let intent = &self.intent;
238 RequestBuilder::new(StripeMethod::Get, format!("/setup_intents/{intent}"))
239 .query(&self.inner)
240 }
241}
242#[derive(Clone)]
243#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
244#[derive(serde::Serialize)]
245struct CreateSetupIntentBuilder {
246 #[serde(skip_serializing_if = "Option::is_none")]
247 attach_to_self: Option<bool>,
248 #[serde(skip_serializing_if = "Option::is_none")]
249 automatic_payment_methods: Option<CreateSetupIntentAutomaticPaymentMethods>,
250 #[serde(skip_serializing_if = "Option::is_none")]
251 confirm: Option<bool>,
252 #[serde(skip_serializing_if = "Option::is_none")]
253 confirmation_token: Option<String>,
254 #[serde(skip_serializing_if = "Option::is_none")]
255 customer: Option<String>,
256 #[serde(skip_serializing_if = "Option::is_none")]
257 customer_account: Option<String>,
258 #[serde(skip_serializing_if = "Option::is_none")]
259 description: Option<String>,
260 #[serde(skip_serializing_if = "Option::is_none")]
261 excluded_payment_method_types:
262 Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
263 #[serde(skip_serializing_if = "Option::is_none")]
264 expand: Option<Vec<String>>,
265 #[serde(skip_serializing_if = "Option::is_none")]
266 flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
267 #[serde(skip_serializing_if = "Option::is_none")]
268 mandate_data: Option<CreateSetupIntentMandateData>,
269 #[serde(skip_serializing_if = "Option::is_none")]
270 metadata: Option<std::collections::HashMap<String, String>>,
271 #[serde(skip_serializing_if = "Option::is_none")]
272 on_behalf_of: Option<String>,
273 #[serde(skip_serializing_if = "Option::is_none")]
274 payment_method: Option<String>,
275 #[serde(skip_serializing_if = "Option::is_none")]
276 payment_method_configuration: Option<String>,
277 #[serde(skip_serializing_if = "Option::is_none")]
278 payment_method_data: Option<CreateSetupIntentPaymentMethodData>,
279 #[serde(skip_serializing_if = "Option::is_none")]
280 payment_method_options: Option<CreateSetupIntentPaymentMethodOptions>,
281 #[serde(skip_serializing_if = "Option::is_none")]
282 payment_method_types: Option<Vec<String>>,
283 #[serde(skip_serializing_if = "Option::is_none")]
284 return_url: Option<String>,
285 #[serde(skip_serializing_if = "Option::is_none")]
286 single_use: Option<CreateSetupIntentSingleUse>,
287 #[serde(skip_serializing_if = "Option::is_none")]
288 usage: Option<CreateSetupIntentUsage>,
289 #[serde(skip_serializing_if = "Option::is_none")]
290 use_stripe_sdk: Option<bool>,
291}
292#[cfg(feature = "redact-generated-debug")]
293impl std::fmt::Debug for CreateSetupIntentBuilder {
294 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
295 f.debug_struct("CreateSetupIntentBuilder").finish_non_exhaustive()
296 }
297}
298impl CreateSetupIntentBuilder {
299 fn new() -> Self {
300 Self {
301 attach_to_self: None,
302 automatic_payment_methods: None,
303 confirm: None,
304 confirmation_token: None,
305 customer: None,
306 customer_account: None,
307 description: None,
308 excluded_payment_method_types: None,
309 expand: None,
310 flow_directions: None,
311 mandate_data: None,
312 metadata: None,
313 on_behalf_of: None,
314 payment_method: None,
315 payment_method_configuration: None,
316 payment_method_data: None,
317 payment_method_options: None,
318 payment_method_types: None,
319 return_url: None,
320 single_use: None,
321 usage: None,
322 use_stripe_sdk: None,
323 }
324 }
325}
326#[derive(Clone, Eq, PartialEq)]
328#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
329#[derive(serde::Serialize)]
330pub struct CreateSetupIntentAutomaticPaymentMethods {
331 #[serde(skip_serializing_if = "Option::is_none")]
336 pub allow_redirects: Option<CreateSetupIntentAutomaticPaymentMethodsAllowRedirects>,
337 pub enabled: bool,
339}
340#[cfg(feature = "redact-generated-debug")]
341impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethods {
342 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
343 f.debug_struct("CreateSetupIntentAutomaticPaymentMethods").finish_non_exhaustive()
344 }
345}
346impl CreateSetupIntentAutomaticPaymentMethods {
347 pub fn new(enabled: impl Into<bool>) -> Self {
348 Self { allow_redirects: None, enabled: enabled.into() }
349 }
350}
351#[derive(Clone, Eq, PartialEq)]
356#[non_exhaustive]
357pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
358 Always,
359 Never,
360 Unknown(String),
362}
363impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
364 pub fn as_str(&self) -> &str {
365 use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
366 match self {
367 Always => "always",
368 Never => "never",
369 Unknown(v) => v,
370 }
371 }
372}
373
374impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
375 type Err = std::convert::Infallible;
376 fn from_str(s: &str) -> Result<Self, Self::Err> {
377 use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
378 match s {
379 "always" => Ok(Always),
380 "never" => Ok(Never),
381 v => {
382 tracing::warn!(
383 "Unknown value '{}' for enum '{}'",
384 v,
385 "CreateSetupIntentAutomaticPaymentMethodsAllowRedirects"
386 );
387 Ok(Unknown(v.to_owned()))
388 }
389 }
390 }
391}
392impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
393 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
394 f.write_str(self.as_str())
395 }
396}
397
398#[cfg(not(feature = "redact-generated-debug"))]
399impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
400 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
401 f.write_str(self.as_str())
402 }
403}
404#[cfg(feature = "redact-generated-debug")]
405impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
406 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
407 f.debug_struct(stringify!(CreateSetupIntentAutomaticPaymentMethodsAllowRedirects))
408 .finish_non_exhaustive()
409 }
410}
411impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
412 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
413 where
414 S: serde::Serializer,
415 {
416 serializer.serialize_str(self.as_str())
417 }
418}
419#[cfg(feature = "deserialize")]
420impl<'de> serde::Deserialize<'de> for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
421 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
422 use std::str::FromStr;
423 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
424 Ok(Self::from_str(&s).expect("infallible"))
425 }
426}
427#[derive(Clone)]
430#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
431#[derive(serde::Serialize)]
432pub struct CreateSetupIntentMandateData {
433 pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance,
435}
436#[cfg(feature = "redact-generated-debug")]
437impl std::fmt::Debug for CreateSetupIntentMandateData {
438 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
439 f.debug_struct("CreateSetupIntentMandateData").finish_non_exhaustive()
440 }
441}
442impl CreateSetupIntentMandateData {
443 pub fn new(
444 customer_acceptance: impl Into<CreateSetupIntentMandateDataCustomerAcceptance>,
445 ) -> Self {
446 Self { customer_acceptance: customer_acceptance.into() }
447 }
448}
449#[derive(Clone)]
451#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
452#[derive(serde::Serialize)]
453pub struct CreateSetupIntentMandateDataCustomerAcceptance {
454 #[serde(skip_serializing_if = "Option::is_none")]
456 pub accepted_at: Option<stripe_types::Timestamp>,
457 #[serde(skip_serializing_if = "Option::is_none")]
459 #[serde(with = "stripe_types::with_serde_json_opt")]
460 pub offline: Option<miniserde::json::Value>,
461 #[serde(skip_serializing_if = "Option::is_none")]
463 pub online: Option<OnlineParam>,
464 #[serde(rename = "type")]
467 pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType,
468}
469#[cfg(feature = "redact-generated-debug")]
470impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptance {
471 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
472 f.debug_struct("CreateSetupIntentMandateDataCustomerAcceptance").finish_non_exhaustive()
473 }
474}
475impl CreateSetupIntentMandateDataCustomerAcceptance {
476 pub fn new(type_: impl Into<CreateSetupIntentMandateDataCustomerAcceptanceType>) -> Self {
477 Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
478 }
479}
480#[derive(Clone, Eq, PartialEq)]
483#[non_exhaustive]
484pub enum CreateSetupIntentMandateDataCustomerAcceptanceType {
485 Offline,
486 Online,
487 Unknown(String),
489}
490impl CreateSetupIntentMandateDataCustomerAcceptanceType {
491 pub fn as_str(&self) -> &str {
492 use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
493 match self {
494 Offline => "offline",
495 Online => "online",
496 Unknown(v) => v,
497 }
498 }
499}
500
501impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType {
502 type Err = std::convert::Infallible;
503 fn from_str(s: &str) -> Result<Self, Self::Err> {
504 use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
505 match s {
506 "offline" => Ok(Offline),
507 "online" => Ok(Online),
508 v => {
509 tracing::warn!(
510 "Unknown value '{}' for enum '{}'",
511 v,
512 "CreateSetupIntentMandateDataCustomerAcceptanceType"
513 );
514 Ok(Unknown(v.to_owned()))
515 }
516 }
517 }
518}
519impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType {
520 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
521 f.write_str(self.as_str())
522 }
523}
524
525#[cfg(not(feature = "redact-generated-debug"))]
526impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
527 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
528 f.write_str(self.as_str())
529 }
530}
531#[cfg(feature = "redact-generated-debug")]
532impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
533 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
534 f.debug_struct(stringify!(CreateSetupIntentMandateDataCustomerAcceptanceType))
535 .finish_non_exhaustive()
536 }
537}
538impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType {
539 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
540 where
541 S: serde::Serializer,
542 {
543 serializer.serialize_str(self.as_str())
544 }
545}
546#[cfg(feature = "deserialize")]
547impl<'de> serde::Deserialize<'de> for CreateSetupIntentMandateDataCustomerAcceptanceType {
548 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
549 use std::str::FromStr;
550 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
551 Ok(Self::from_str(&s).expect("infallible"))
552 }
553}
554#[derive(Clone)]
557#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
558#[derive(serde::Serialize)]
559pub struct CreateSetupIntentPaymentMethodData {
560 #[serde(skip_serializing_if = "Option::is_none")]
562 pub acss_debit: Option<PaymentMethodParam>,
563 #[serde(skip_serializing_if = "Option::is_none")]
565 #[serde(with = "stripe_types::with_serde_json_opt")]
566 pub affirm: Option<miniserde::json::Value>,
567 #[serde(skip_serializing_if = "Option::is_none")]
569 #[serde(with = "stripe_types::with_serde_json_opt")]
570 pub afterpay_clearpay: Option<miniserde::json::Value>,
571 #[serde(skip_serializing_if = "Option::is_none")]
573 #[serde(with = "stripe_types::with_serde_json_opt")]
574 pub alipay: Option<miniserde::json::Value>,
575 #[serde(skip_serializing_if = "Option::is_none")]
579 pub allow_redisplay: Option<CreateSetupIntentPaymentMethodDataAllowRedisplay>,
580 #[serde(skip_serializing_if = "Option::is_none")]
582 #[serde(with = "stripe_types::with_serde_json_opt")]
583 pub alma: Option<miniserde::json::Value>,
584 #[serde(skip_serializing_if = "Option::is_none")]
586 #[serde(with = "stripe_types::with_serde_json_opt")]
587 pub amazon_pay: Option<miniserde::json::Value>,
588 #[serde(skip_serializing_if = "Option::is_none")]
590 pub au_becs_debit: Option<CreateSetupIntentPaymentMethodDataAuBecsDebit>,
591 #[serde(skip_serializing_if = "Option::is_none")]
593 pub bacs_debit: Option<CreateSetupIntentPaymentMethodDataBacsDebit>,
594 #[serde(skip_serializing_if = "Option::is_none")]
596 #[serde(with = "stripe_types::with_serde_json_opt")]
597 pub bancontact: Option<miniserde::json::Value>,
598 #[serde(skip_serializing_if = "Option::is_none")]
600 #[serde(with = "stripe_types::with_serde_json_opt")]
601 pub billie: Option<miniserde::json::Value>,
602 #[serde(skip_serializing_if = "Option::is_none")]
604 pub billing_details: Option<BillingDetailsInnerParams>,
605 #[serde(skip_serializing_if = "Option::is_none")]
607 #[serde(with = "stripe_types::with_serde_json_opt")]
608 pub blik: Option<miniserde::json::Value>,
609 #[serde(skip_serializing_if = "Option::is_none")]
611 pub boleto: Option<CreateSetupIntentPaymentMethodDataBoleto>,
612 #[serde(skip_serializing_if = "Option::is_none")]
614 #[serde(with = "stripe_types::with_serde_json_opt")]
615 pub cashapp: Option<miniserde::json::Value>,
616 #[serde(skip_serializing_if = "Option::is_none")]
618 #[serde(with = "stripe_types::with_serde_json_opt")]
619 pub crypto: Option<miniserde::json::Value>,
620 #[serde(skip_serializing_if = "Option::is_none")]
622 #[serde(with = "stripe_types::with_serde_json_opt")]
623 pub customer_balance: Option<miniserde::json::Value>,
624 #[serde(skip_serializing_if = "Option::is_none")]
626 pub eps: Option<CreateSetupIntentPaymentMethodDataEps>,
627 #[serde(skip_serializing_if = "Option::is_none")]
629 pub fpx: Option<CreateSetupIntentPaymentMethodDataFpx>,
630 #[serde(skip_serializing_if = "Option::is_none")]
632 #[serde(with = "stripe_types::with_serde_json_opt")]
633 pub giropay: Option<miniserde::json::Value>,
634 #[serde(skip_serializing_if = "Option::is_none")]
636 #[serde(with = "stripe_types::with_serde_json_opt")]
637 pub grabpay: Option<miniserde::json::Value>,
638 #[serde(skip_serializing_if = "Option::is_none")]
640 pub ideal: Option<CreateSetupIntentPaymentMethodDataIdeal>,
641 #[serde(skip_serializing_if = "Option::is_none")]
643 #[serde(with = "stripe_types::with_serde_json_opt")]
644 pub interac_present: Option<miniserde::json::Value>,
645 #[serde(skip_serializing_if = "Option::is_none")]
647 #[serde(with = "stripe_types::with_serde_json_opt")]
648 pub kakao_pay: Option<miniserde::json::Value>,
649 #[serde(skip_serializing_if = "Option::is_none")]
651 pub klarna: Option<CreateSetupIntentPaymentMethodDataKlarna>,
652 #[serde(skip_serializing_if = "Option::is_none")]
654 #[serde(with = "stripe_types::with_serde_json_opt")]
655 pub konbini: Option<miniserde::json::Value>,
656 #[serde(skip_serializing_if = "Option::is_none")]
658 #[serde(with = "stripe_types::with_serde_json_opt")]
659 pub kr_card: Option<miniserde::json::Value>,
660 #[serde(skip_serializing_if = "Option::is_none")]
662 #[serde(with = "stripe_types::with_serde_json_opt")]
663 pub link: Option<miniserde::json::Value>,
664 #[serde(skip_serializing_if = "Option::is_none")]
666 #[serde(with = "stripe_types::with_serde_json_opt")]
667 pub mb_way: Option<miniserde::json::Value>,
668 #[serde(skip_serializing_if = "Option::is_none")]
673 pub metadata: Option<std::collections::HashMap<String, String>>,
674 #[serde(skip_serializing_if = "Option::is_none")]
676 #[serde(with = "stripe_types::with_serde_json_opt")]
677 pub mobilepay: Option<miniserde::json::Value>,
678 #[serde(skip_serializing_if = "Option::is_none")]
680 #[serde(with = "stripe_types::with_serde_json_opt")]
681 pub multibanco: Option<miniserde::json::Value>,
682 #[serde(skip_serializing_if = "Option::is_none")]
684 pub naver_pay: Option<CreateSetupIntentPaymentMethodDataNaverPay>,
685 #[serde(skip_serializing_if = "Option::is_none")]
687 pub nz_bank_account: Option<CreateSetupIntentPaymentMethodDataNzBankAccount>,
688 #[serde(skip_serializing_if = "Option::is_none")]
690 #[serde(with = "stripe_types::with_serde_json_opt")]
691 pub oxxo: Option<miniserde::json::Value>,
692 #[serde(skip_serializing_if = "Option::is_none")]
694 pub p24: Option<CreateSetupIntentPaymentMethodDataP24>,
695 #[serde(skip_serializing_if = "Option::is_none")]
697 #[serde(with = "stripe_types::with_serde_json_opt")]
698 pub pay_by_bank: Option<miniserde::json::Value>,
699 #[serde(skip_serializing_if = "Option::is_none")]
701 #[serde(with = "stripe_types::with_serde_json_opt")]
702 pub payco: Option<miniserde::json::Value>,
703 #[serde(skip_serializing_if = "Option::is_none")]
705 #[serde(with = "stripe_types::with_serde_json_opt")]
706 pub paynow: Option<miniserde::json::Value>,
707 #[serde(skip_serializing_if = "Option::is_none")]
709 #[serde(with = "stripe_types::with_serde_json_opt")]
710 pub paypal: Option<miniserde::json::Value>,
711 #[serde(skip_serializing_if = "Option::is_none")]
713 pub payto: Option<CreateSetupIntentPaymentMethodDataPayto>,
714 #[serde(skip_serializing_if = "Option::is_none")]
716 #[serde(with = "stripe_types::with_serde_json_opt")]
717 pub pix: Option<miniserde::json::Value>,
718 #[serde(skip_serializing_if = "Option::is_none")]
720 #[serde(with = "stripe_types::with_serde_json_opt")]
721 pub promptpay: Option<miniserde::json::Value>,
722 #[serde(skip_serializing_if = "Option::is_none")]
725 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
726 #[serde(skip_serializing_if = "Option::is_none")]
728 #[serde(with = "stripe_types::with_serde_json_opt")]
729 pub revolut_pay: Option<miniserde::json::Value>,
730 #[serde(skip_serializing_if = "Option::is_none")]
732 #[serde(with = "stripe_types::with_serde_json_opt")]
733 pub samsung_pay: Option<miniserde::json::Value>,
734 #[serde(skip_serializing_if = "Option::is_none")]
736 #[serde(with = "stripe_types::with_serde_json_opt")]
737 pub satispay: Option<miniserde::json::Value>,
738 #[serde(skip_serializing_if = "Option::is_none")]
740 pub sepa_debit: Option<CreateSetupIntentPaymentMethodDataSepaDebit>,
741 #[serde(skip_serializing_if = "Option::is_none")]
743 pub sofort: Option<CreateSetupIntentPaymentMethodDataSofort>,
744 #[serde(skip_serializing_if = "Option::is_none")]
746 #[serde(with = "stripe_types::with_serde_json_opt")]
747 pub sunbit: Option<miniserde::json::Value>,
748 #[serde(skip_serializing_if = "Option::is_none")]
750 #[serde(with = "stripe_types::with_serde_json_opt")]
751 pub swish: Option<miniserde::json::Value>,
752 #[serde(skip_serializing_if = "Option::is_none")]
754 #[serde(with = "stripe_types::with_serde_json_opt")]
755 pub twint: Option<miniserde::json::Value>,
756 #[serde(rename = "type")]
760 pub type_: CreateSetupIntentPaymentMethodDataType,
761 #[serde(skip_serializing_if = "Option::is_none")]
763 pub upi: Option<CreateSetupIntentPaymentMethodDataUpi>,
764 #[serde(skip_serializing_if = "Option::is_none")]
766 pub us_bank_account: Option<CreateSetupIntentPaymentMethodDataUsBankAccount>,
767 #[serde(skip_serializing_if = "Option::is_none")]
769 #[serde(with = "stripe_types::with_serde_json_opt")]
770 pub wechat_pay: Option<miniserde::json::Value>,
771 #[serde(skip_serializing_if = "Option::is_none")]
773 #[serde(with = "stripe_types::with_serde_json_opt")]
774 pub zip: Option<miniserde::json::Value>,
775}
776#[cfg(feature = "redact-generated-debug")]
777impl std::fmt::Debug for CreateSetupIntentPaymentMethodData {
778 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
779 f.debug_struct("CreateSetupIntentPaymentMethodData").finish_non_exhaustive()
780 }
781}
782impl CreateSetupIntentPaymentMethodData {
783 pub fn new(type_: impl Into<CreateSetupIntentPaymentMethodDataType>) -> Self {
784 Self {
785 acss_debit: None,
786 affirm: None,
787 afterpay_clearpay: None,
788 alipay: None,
789 allow_redisplay: None,
790 alma: None,
791 amazon_pay: None,
792 au_becs_debit: None,
793 bacs_debit: None,
794 bancontact: None,
795 billie: None,
796 billing_details: None,
797 blik: None,
798 boleto: None,
799 cashapp: None,
800 crypto: None,
801 customer_balance: None,
802 eps: None,
803 fpx: None,
804 giropay: None,
805 grabpay: None,
806 ideal: None,
807 interac_present: None,
808 kakao_pay: None,
809 klarna: None,
810 konbini: None,
811 kr_card: None,
812 link: None,
813 mb_way: None,
814 metadata: None,
815 mobilepay: None,
816 multibanco: None,
817 naver_pay: None,
818 nz_bank_account: None,
819 oxxo: None,
820 p24: None,
821 pay_by_bank: None,
822 payco: None,
823 paynow: None,
824 paypal: None,
825 payto: None,
826 pix: None,
827 promptpay: None,
828 radar_options: None,
829 revolut_pay: None,
830 samsung_pay: None,
831 satispay: None,
832 sepa_debit: None,
833 sofort: None,
834 sunbit: None,
835 swish: None,
836 twint: None,
837 type_: type_.into(),
838 upi: None,
839 us_bank_account: None,
840 wechat_pay: None,
841 zip: None,
842 }
843 }
844}
845#[derive(Clone, Eq, PartialEq)]
849#[non_exhaustive]
850pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay {
851 Always,
852 Limited,
853 Unspecified,
854 Unknown(String),
856}
857impl CreateSetupIntentPaymentMethodDataAllowRedisplay {
858 pub fn as_str(&self) -> &str {
859 use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
860 match self {
861 Always => "always",
862 Limited => "limited",
863 Unspecified => "unspecified",
864 Unknown(v) => v,
865 }
866 }
867}
868
869impl std::str::FromStr for CreateSetupIntentPaymentMethodDataAllowRedisplay {
870 type Err = std::convert::Infallible;
871 fn from_str(s: &str) -> Result<Self, Self::Err> {
872 use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
873 match s {
874 "always" => Ok(Always),
875 "limited" => Ok(Limited),
876 "unspecified" => Ok(Unspecified),
877 v => {
878 tracing::warn!(
879 "Unknown value '{}' for enum '{}'",
880 v,
881 "CreateSetupIntentPaymentMethodDataAllowRedisplay"
882 );
883 Ok(Unknown(v.to_owned()))
884 }
885 }
886 }
887}
888impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay {
889 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
890 f.write_str(self.as_str())
891 }
892}
893
894#[cfg(not(feature = "redact-generated-debug"))]
895impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
896 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
897 f.write_str(self.as_str())
898 }
899}
900#[cfg(feature = "redact-generated-debug")]
901impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
902 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
903 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataAllowRedisplay))
904 .finish_non_exhaustive()
905 }
906}
907impl serde::Serialize for CreateSetupIntentPaymentMethodDataAllowRedisplay {
908 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
909 where
910 S: serde::Serializer,
911 {
912 serializer.serialize_str(self.as_str())
913 }
914}
915#[cfg(feature = "deserialize")]
916impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataAllowRedisplay {
917 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
918 use std::str::FromStr;
919 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
920 Ok(Self::from_str(&s).expect("infallible"))
921 }
922}
923#[derive(Clone, Eq, PartialEq)]
925#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
926#[derive(serde::Serialize)]
927pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit {
928 pub account_number: String,
930 pub bsb_number: String,
932}
933#[cfg(feature = "redact-generated-debug")]
934impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAuBecsDebit {
935 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
936 f.debug_struct("CreateSetupIntentPaymentMethodDataAuBecsDebit").finish_non_exhaustive()
937 }
938}
939impl CreateSetupIntentPaymentMethodDataAuBecsDebit {
940 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
941 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
942 }
943}
944#[derive(Clone, Eq, PartialEq)]
946#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
947#[derive(serde::Serialize)]
948pub struct CreateSetupIntentPaymentMethodDataBacsDebit {
949 #[serde(skip_serializing_if = "Option::is_none")]
951 pub account_number: Option<String>,
952 #[serde(skip_serializing_if = "Option::is_none")]
954 pub sort_code: Option<String>,
955}
956#[cfg(feature = "redact-generated-debug")]
957impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataBacsDebit {
958 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
959 f.debug_struct("CreateSetupIntentPaymentMethodDataBacsDebit").finish_non_exhaustive()
960 }
961}
962impl CreateSetupIntentPaymentMethodDataBacsDebit {
963 pub fn new() -> Self {
964 Self { account_number: None, sort_code: None }
965 }
966}
967impl Default for CreateSetupIntentPaymentMethodDataBacsDebit {
968 fn default() -> Self {
969 Self::new()
970 }
971}
972#[derive(Clone, Eq, PartialEq)]
974#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
975#[derive(serde::Serialize)]
976pub struct CreateSetupIntentPaymentMethodDataBoleto {
977 pub tax_id: String,
979}
980#[cfg(feature = "redact-generated-debug")]
981impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataBoleto {
982 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
983 f.debug_struct("CreateSetupIntentPaymentMethodDataBoleto").finish_non_exhaustive()
984 }
985}
986impl CreateSetupIntentPaymentMethodDataBoleto {
987 pub fn new(tax_id: impl Into<String>) -> Self {
988 Self { tax_id: tax_id.into() }
989 }
990}
991#[derive(Clone, Eq, PartialEq)]
993#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
994#[derive(serde::Serialize)]
995pub struct CreateSetupIntentPaymentMethodDataEps {
996 #[serde(skip_serializing_if = "Option::is_none")]
998 pub bank: Option<CreateSetupIntentPaymentMethodDataEpsBank>,
999}
1000#[cfg(feature = "redact-generated-debug")]
1001impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEps {
1002 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1003 f.debug_struct("CreateSetupIntentPaymentMethodDataEps").finish_non_exhaustive()
1004 }
1005}
1006impl CreateSetupIntentPaymentMethodDataEps {
1007 pub fn new() -> Self {
1008 Self { bank: None }
1009 }
1010}
1011impl Default for CreateSetupIntentPaymentMethodDataEps {
1012 fn default() -> Self {
1013 Self::new()
1014 }
1015}
1016#[derive(Clone, Eq, PartialEq)]
1018#[non_exhaustive]
1019pub enum CreateSetupIntentPaymentMethodDataEpsBank {
1020 ArzteUndApothekerBank,
1021 AustrianAnadiBankAg,
1022 BankAustria,
1023 BankhausCarlSpangler,
1024 BankhausSchelhammerUndSchatteraAg,
1025 BawagPskAg,
1026 BksBankAg,
1027 BrullKallmusBankAg,
1028 BtvVierLanderBank,
1029 CapitalBankGraweGruppeAg,
1030 DeutscheBankAg,
1031 Dolomitenbank,
1032 EasybankAg,
1033 ErsteBankUndSparkassen,
1034 HypoAlpeadriabankInternationalAg,
1035 HypoBankBurgenlandAktiengesellschaft,
1036 HypoNoeLbFurNiederosterreichUWien,
1037 HypoOberosterreichSalzburgSteiermark,
1038 HypoTirolBankAg,
1039 HypoVorarlbergBankAg,
1040 MarchfelderBank,
1041 OberbankAg,
1042 RaiffeisenBankengruppeOsterreich,
1043 SchoellerbankAg,
1044 SpardaBankWien,
1045 VolksbankGruppe,
1046 VolkskreditbankAg,
1047 VrBankBraunau,
1048 Unknown(String),
1050}
1051impl CreateSetupIntentPaymentMethodDataEpsBank {
1052 pub fn as_str(&self) -> &str {
1053 use CreateSetupIntentPaymentMethodDataEpsBank::*;
1054 match self {
1055 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1056 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1057 BankAustria => "bank_austria",
1058 BankhausCarlSpangler => "bankhaus_carl_spangler",
1059 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
1060 BawagPskAg => "bawag_psk_ag",
1061 BksBankAg => "bks_bank_ag",
1062 BrullKallmusBankAg => "brull_kallmus_bank_ag",
1063 BtvVierLanderBank => "btv_vier_lander_bank",
1064 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1065 DeutscheBankAg => "deutsche_bank_ag",
1066 Dolomitenbank => "dolomitenbank",
1067 EasybankAg => "easybank_ag",
1068 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1069 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
1070 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
1071 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
1072 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
1073 HypoTirolBankAg => "hypo_tirol_bank_ag",
1074 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1075 MarchfelderBank => "marchfelder_bank",
1076 OberbankAg => "oberbank_ag",
1077 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
1078 SchoellerbankAg => "schoellerbank_ag",
1079 SpardaBankWien => "sparda_bank_wien",
1080 VolksbankGruppe => "volksbank_gruppe",
1081 VolkskreditbankAg => "volkskreditbank_ag",
1082 VrBankBraunau => "vr_bank_braunau",
1083 Unknown(v) => v,
1084 }
1085 }
1086}
1087
1088impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank {
1089 type Err = std::convert::Infallible;
1090 fn from_str(s: &str) -> Result<Self, Self::Err> {
1091 use CreateSetupIntentPaymentMethodDataEpsBank::*;
1092 match s {
1093 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
1094 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
1095 "bank_austria" => Ok(BankAustria),
1096 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
1097 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
1098 "bawag_psk_ag" => Ok(BawagPskAg),
1099 "bks_bank_ag" => Ok(BksBankAg),
1100 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
1101 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
1102 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
1103 "deutsche_bank_ag" => Ok(DeutscheBankAg),
1104 "dolomitenbank" => Ok(Dolomitenbank),
1105 "easybank_ag" => Ok(EasybankAg),
1106 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
1107 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
1108 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
1109 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
1110 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
1111 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
1112 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
1113 "marchfelder_bank" => Ok(MarchfelderBank),
1114 "oberbank_ag" => Ok(OberbankAg),
1115 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
1116 "schoellerbank_ag" => Ok(SchoellerbankAg),
1117 "sparda_bank_wien" => Ok(SpardaBankWien),
1118 "volksbank_gruppe" => Ok(VolksbankGruppe),
1119 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
1120 "vr_bank_braunau" => Ok(VrBankBraunau),
1121 v => {
1122 tracing::warn!(
1123 "Unknown value '{}' for enum '{}'",
1124 v,
1125 "CreateSetupIntentPaymentMethodDataEpsBank"
1126 );
1127 Ok(Unknown(v.to_owned()))
1128 }
1129 }
1130 }
1131}
1132impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank {
1133 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1134 f.write_str(self.as_str())
1135 }
1136}
1137
1138#[cfg(not(feature = "redact-generated-debug"))]
1139impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
1140 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1141 f.write_str(self.as_str())
1142 }
1143}
1144#[cfg(feature = "redact-generated-debug")]
1145impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
1146 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1147 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataEpsBank))
1148 .finish_non_exhaustive()
1149 }
1150}
1151impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank {
1152 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1153 where
1154 S: serde::Serializer,
1155 {
1156 serializer.serialize_str(self.as_str())
1157 }
1158}
1159#[cfg(feature = "deserialize")]
1160impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataEpsBank {
1161 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1162 use std::str::FromStr;
1163 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1164 Ok(Self::from_str(&s).expect("infallible"))
1165 }
1166}
1167#[derive(Clone, Eq, PartialEq)]
1169#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1170#[derive(serde::Serialize)]
1171pub struct CreateSetupIntentPaymentMethodDataFpx {
1172 #[serde(skip_serializing_if = "Option::is_none")]
1174 pub account_holder_type: Option<CreateSetupIntentPaymentMethodDataFpxAccountHolderType>,
1175 pub bank: CreateSetupIntentPaymentMethodDataFpxBank,
1177}
1178#[cfg(feature = "redact-generated-debug")]
1179impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpx {
1180 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1181 f.debug_struct("CreateSetupIntentPaymentMethodDataFpx").finish_non_exhaustive()
1182 }
1183}
1184impl CreateSetupIntentPaymentMethodDataFpx {
1185 pub fn new(bank: impl Into<CreateSetupIntentPaymentMethodDataFpxBank>) -> Self {
1186 Self { account_holder_type: None, bank: bank.into() }
1187 }
1188}
1189#[derive(Clone, Eq, PartialEq)]
1191#[non_exhaustive]
1192pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1193 Company,
1194 Individual,
1195 Unknown(String),
1197}
1198impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1199 pub fn as_str(&self) -> &str {
1200 use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1201 match self {
1202 Company => "company",
1203 Individual => "individual",
1204 Unknown(v) => v,
1205 }
1206 }
1207}
1208
1209impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1210 type Err = std::convert::Infallible;
1211 fn from_str(s: &str) -> Result<Self, Self::Err> {
1212 use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1213 match s {
1214 "company" => Ok(Company),
1215 "individual" => Ok(Individual),
1216 v => {
1217 tracing::warn!(
1218 "Unknown value '{}' for enum '{}'",
1219 v,
1220 "CreateSetupIntentPaymentMethodDataFpxAccountHolderType"
1221 );
1222 Ok(Unknown(v.to_owned()))
1223 }
1224 }
1225 }
1226}
1227impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1228 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1229 f.write_str(self.as_str())
1230 }
1231}
1232
1233#[cfg(not(feature = "redact-generated-debug"))]
1234impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1235 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1236 f.write_str(self.as_str())
1237 }
1238}
1239#[cfg(feature = "redact-generated-debug")]
1240impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1241 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1242 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataFpxAccountHolderType))
1243 .finish_non_exhaustive()
1244 }
1245}
1246impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1247 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1248 where
1249 S: serde::Serializer,
1250 {
1251 serializer.serialize_str(self.as_str())
1252 }
1253}
1254#[cfg(feature = "deserialize")]
1255impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1256 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1257 use std::str::FromStr;
1258 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1259 Ok(Self::from_str(&s).expect("infallible"))
1260 }
1261}
1262#[derive(Clone, Eq, PartialEq)]
1264#[non_exhaustive]
1265pub enum CreateSetupIntentPaymentMethodDataFpxBank {
1266 AffinBank,
1267 Agrobank,
1268 AllianceBank,
1269 Ambank,
1270 BankIslam,
1271 BankMuamalat,
1272 BankOfChina,
1273 BankRakyat,
1274 Bsn,
1275 Cimb,
1276 DeutscheBank,
1277 HongLeongBank,
1278 Hsbc,
1279 Kfh,
1280 Maybank2e,
1281 Maybank2u,
1282 Ocbc,
1283 PbEnterprise,
1284 PublicBank,
1285 Rhb,
1286 StandardChartered,
1287 Uob,
1288 Unknown(String),
1290}
1291impl CreateSetupIntentPaymentMethodDataFpxBank {
1292 pub fn as_str(&self) -> &str {
1293 use CreateSetupIntentPaymentMethodDataFpxBank::*;
1294 match self {
1295 AffinBank => "affin_bank",
1296 Agrobank => "agrobank",
1297 AllianceBank => "alliance_bank",
1298 Ambank => "ambank",
1299 BankIslam => "bank_islam",
1300 BankMuamalat => "bank_muamalat",
1301 BankOfChina => "bank_of_china",
1302 BankRakyat => "bank_rakyat",
1303 Bsn => "bsn",
1304 Cimb => "cimb",
1305 DeutscheBank => "deutsche_bank",
1306 HongLeongBank => "hong_leong_bank",
1307 Hsbc => "hsbc",
1308 Kfh => "kfh",
1309 Maybank2e => "maybank2e",
1310 Maybank2u => "maybank2u",
1311 Ocbc => "ocbc",
1312 PbEnterprise => "pb_enterprise",
1313 PublicBank => "public_bank",
1314 Rhb => "rhb",
1315 StandardChartered => "standard_chartered",
1316 Uob => "uob",
1317 Unknown(v) => v,
1318 }
1319 }
1320}
1321
1322impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank {
1323 type Err = std::convert::Infallible;
1324 fn from_str(s: &str) -> Result<Self, Self::Err> {
1325 use CreateSetupIntentPaymentMethodDataFpxBank::*;
1326 match s {
1327 "affin_bank" => Ok(AffinBank),
1328 "agrobank" => Ok(Agrobank),
1329 "alliance_bank" => Ok(AllianceBank),
1330 "ambank" => Ok(Ambank),
1331 "bank_islam" => Ok(BankIslam),
1332 "bank_muamalat" => Ok(BankMuamalat),
1333 "bank_of_china" => Ok(BankOfChina),
1334 "bank_rakyat" => Ok(BankRakyat),
1335 "bsn" => Ok(Bsn),
1336 "cimb" => Ok(Cimb),
1337 "deutsche_bank" => Ok(DeutscheBank),
1338 "hong_leong_bank" => Ok(HongLeongBank),
1339 "hsbc" => Ok(Hsbc),
1340 "kfh" => Ok(Kfh),
1341 "maybank2e" => Ok(Maybank2e),
1342 "maybank2u" => Ok(Maybank2u),
1343 "ocbc" => Ok(Ocbc),
1344 "pb_enterprise" => Ok(PbEnterprise),
1345 "public_bank" => Ok(PublicBank),
1346 "rhb" => Ok(Rhb),
1347 "standard_chartered" => Ok(StandardChartered),
1348 "uob" => Ok(Uob),
1349 v => {
1350 tracing::warn!(
1351 "Unknown value '{}' for enum '{}'",
1352 v,
1353 "CreateSetupIntentPaymentMethodDataFpxBank"
1354 );
1355 Ok(Unknown(v.to_owned()))
1356 }
1357 }
1358 }
1359}
1360impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank {
1361 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1362 f.write_str(self.as_str())
1363 }
1364}
1365
1366#[cfg(not(feature = "redact-generated-debug"))]
1367impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
1368 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1369 f.write_str(self.as_str())
1370 }
1371}
1372#[cfg(feature = "redact-generated-debug")]
1373impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
1374 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1375 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataFpxBank))
1376 .finish_non_exhaustive()
1377 }
1378}
1379impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank {
1380 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1381 where
1382 S: serde::Serializer,
1383 {
1384 serializer.serialize_str(self.as_str())
1385 }
1386}
1387#[cfg(feature = "deserialize")]
1388impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxBank {
1389 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1390 use std::str::FromStr;
1391 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1392 Ok(Self::from_str(&s).expect("infallible"))
1393 }
1394}
1395#[derive(Clone, Eq, PartialEq)]
1397#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1398#[derive(serde::Serialize)]
1399pub struct CreateSetupIntentPaymentMethodDataIdeal {
1400 #[serde(skip_serializing_if = "Option::is_none")]
1404 pub bank: Option<CreateSetupIntentPaymentMethodDataIdealBank>,
1405}
1406#[cfg(feature = "redact-generated-debug")]
1407impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdeal {
1408 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1409 f.debug_struct("CreateSetupIntentPaymentMethodDataIdeal").finish_non_exhaustive()
1410 }
1411}
1412impl CreateSetupIntentPaymentMethodDataIdeal {
1413 pub fn new() -> Self {
1414 Self { bank: None }
1415 }
1416}
1417impl Default for CreateSetupIntentPaymentMethodDataIdeal {
1418 fn default() -> Self {
1419 Self::new()
1420 }
1421}
1422#[derive(Clone, Eq, PartialEq)]
1426#[non_exhaustive]
1427pub enum CreateSetupIntentPaymentMethodDataIdealBank {
1428 AbnAmro,
1429 Adyen,
1430 AsnBank,
1431 Bunq,
1432 Buut,
1433 Finom,
1434 Handelsbanken,
1435 Ing,
1436 Knab,
1437 Mollie,
1438 Moneyou,
1439 N26,
1440 Nn,
1441 Rabobank,
1442 Regiobank,
1443 Revolut,
1444 SnsBank,
1445 TriodosBank,
1446 VanLanschot,
1447 Yoursafe,
1448 Unknown(String),
1450}
1451impl CreateSetupIntentPaymentMethodDataIdealBank {
1452 pub fn as_str(&self) -> &str {
1453 use CreateSetupIntentPaymentMethodDataIdealBank::*;
1454 match self {
1455 AbnAmro => "abn_amro",
1456 Adyen => "adyen",
1457 AsnBank => "asn_bank",
1458 Bunq => "bunq",
1459 Buut => "buut",
1460 Finom => "finom",
1461 Handelsbanken => "handelsbanken",
1462 Ing => "ing",
1463 Knab => "knab",
1464 Mollie => "mollie",
1465 Moneyou => "moneyou",
1466 N26 => "n26",
1467 Nn => "nn",
1468 Rabobank => "rabobank",
1469 Regiobank => "regiobank",
1470 Revolut => "revolut",
1471 SnsBank => "sns_bank",
1472 TriodosBank => "triodos_bank",
1473 VanLanschot => "van_lanschot",
1474 Yoursafe => "yoursafe",
1475 Unknown(v) => v,
1476 }
1477 }
1478}
1479
1480impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
1481 type Err = std::convert::Infallible;
1482 fn from_str(s: &str) -> Result<Self, Self::Err> {
1483 use CreateSetupIntentPaymentMethodDataIdealBank::*;
1484 match s {
1485 "abn_amro" => Ok(AbnAmro),
1486 "adyen" => Ok(Adyen),
1487 "asn_bank" => Ok(AsnBank),
1488 "bunq" => Ok(Bunq),
1489 "buut" => Ok(Buut),
1490 "finom" => Ok(Finom),
1491 "handelsbanken" => Ok(Handelsbanken),
1492 "ing" => Ok(Ing),
1493 "knab" => Ok(Knab),
1494 "mollie" => Ok(Mollie),
1495 "moneyou" => Ok(Moneyou),
1496 "n26" => Ok(N26),
1497 "nn" => Ok(Nn),
1498 "rabobank" => Ok(Rabobank),
1499 "regiobank" => Ok(Regiobank),
1500 "revolut" => Ok(Revolut),
1501 "sns_bank" => Ok(SnsBank),
1502 "triodos_bank" => Ok(TriodosBank),
1503 "van_lanschot" => Ok(VanLanschot),
1504 "yoursafe" => Ok(Yoursafe),
1505 v => {
1506 tracing::warn!(
1507 "Unknown value '{}' for enum '{}'",
1508 v,
1509 "CreateSetupIntentPaymentMethodDataIdealBank"
1510 );
1511 Ok(Unknown(v.to_owned()))
1512 }
1513 }
1514 }
1515}
1516impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
1517 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1518 f.write_str(self.as_str())
1519 }
1520}
1521
1522#[cfg(not(feature = "redact-generated-debug"))]
1523impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1524 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1525 f.write_str(self.as_str())
1526 }
1527}
1528#[cfg(feature = "redact-generated-debug")]
1529impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1530 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1531 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataIdealBank))
1532 .finish_non_exhaustive()
1533 }
1534}
1535impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
1536 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1537 where
1538 S: serde::Serializer,
1539 {
1540 serializer.serialize_str(self.as_str())
1541 }
1542}
1543#[cfg(feature = "deserialize")]
1544impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
1545 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1546 use std::str::FromStr;
1547 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1548 Ok(Self::from_str(&s).expect("infallible"))
1549 }
1550}
1551#[derive(Copy, Clone, Eq, PartialEq)]
1553#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1554#[derive(serde::Serialize)]
1555pub struct CreateSetupIntentPaymentMethodDataKlarna {
1556 #[serde(skip_serializing_if = "Option::is_none")]
1558 pub dob: Option<DateOfBirth>,
1559}
1560#[cfg(feature = "redact-generated-debug")]
1561impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataKlarna {
1562 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1563 f.debug_struct("CreateSetupIntentPaymentMethodDataKlarna").finish_non_exhaustive()
1564 }
1565}
1566impl CreateSetupIntentPaymentMethodDataKlarna {
1567 pub fn new() -> Self {
1568 Self { dob: None }
1569 }
1570}
1571impl Default for CreateSetupIntentPaymentMethodDataKlarna {
1572 fn default() -> Self {
1573 Self::new()
1574 }
1575}
1576#[derive(Clone, Eq, PartialEq)]
1578#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1579#[derive(serde::Serialize)]
1580pub struct CreateSetupIntentPaymentMethodDataNaverPay {
1581 #[serde(skip_serializing_if = "Option::is_none")]
1584 pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
1585}
1586#[cfg(feature = "redact-generated-debug")]
1587impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPay {
1588 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1589 f.debug_struct("CreateSetupIntentPaymentMethodDataNaverPay").finish_non_exhaustive()
1590 }
1591}
1592impl CreateSetupIntentPaymentMethodDataNaverPay {
1593 pub fn new() -> Self {
1594 Self { funding: None }
1595 }
1596}
1597impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
1598 fn default() -> Self {
1599 Self::new()
1600 }
1601}
1602#[derive(Clone, Eq, PartialEq)]
1605#[non_exhaustive]
1606pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
1607 Card,
1608 Points,
1609 Unknown(String),
1611}
1612impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
1613 pub fn as_str(&self) -> &str {
1614 use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1615 match self {
1616 Card => "card",
1617 Points => "points",
1618 Unknown(v) => v,
1619 }
1620 }
1621}
1622
1623impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1624 type Err = std::convert::Infallible;
1625 fn from_str(s: &str) -> Result<Self, Self::Err> {
1626 use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1627 match s {
1628 "card" => Ok(Card),
1629 "points" => Ok(Points),
1630 v => {
1631 tracing::warn!(
1632 "Unknown value '{}' for enum '{}'",
1633 v,
1634 "CreateSetupIntentPaymentMethodDataNaverPayFunding"
1635 );
1636 Ok(Unknown(v.to_owned()))
1637 }
1638 }
1639 }
1640}
1641impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1642 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1643 f.write_str(self.as_str())
1644 }
1645}
1646
1647#[cfg(not(feature = "redact-generated-debug"))]
1648impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1649 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1650 f.write_str(self.as_str())
1651 }
1652}
1653#[cfg(feature = "redact-generated-debug")]
1654impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1655 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1656 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataNaverPayFunding))
1657 .finish_non_exhaustive()
1658 }
1659}
1660impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1661 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1662 where
1663 S: serde::Serializer,
1664 {
1665 serializer.serialize_str(self.as_str())
1666 }
1667}
1668#[cfg(feature = "deserialize")]
1669impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1670 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1671 use std::str::FromStr;
1672 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1673 Ok(Self::from_str(&s).expect("infallible"))
1674 }
1675}
1676#[derive(Clone, Eq, PartialEq)]
1678#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1679#[derive(serde::Serialize)]
1680pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
1681 #[serde(skip_serializing_if = "Option::is_none")]
1684 pub account_holder_name: Option<String>,
1685 pub account_number: String,
1687 pub bank_code: String,
1689 pub branch_code: String,
1691 #[serde(skip_serializing_if = "Option::is_none")]
1692 pub reference: Option<String>,
1693 pub suffix: String,
1695}
1696#[cfg(feature = "redact-generated-debug")]
1697impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNzBankAccount {
1698 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1699 f.debug_struct("CreateSetupIntentPaymentMethodDataNzBankAccount").finish_non_exhaustive()
1700 }
1701}
1702impl CreateSetupIntentPaymentMethodDataNzBankAccount {
1703 pub fn new(
1704 account_number: impl Into<String>,
1705 bank_code: impl Into<String>,
1706 branch_code: impl Into<String>,
1707 suffix: impl Into<String>,
1708 ) -> Self {
1709 Self {
1710 account_holder_name: None,
1711 account_number: account_number.into(),
1712 bank_code: bank_code.into(),
1713 branch_code: branch_code.into(),
1714 reference: None,
1715 suffix: suffix.into(),
1716 }
1717 }
1718}
1719#[derive(Clone, Eq, PartialEq)]
1721#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1722#[derive(serde::Serialize)]
1723pub struct CreateSetupIntentPaymentMethodDataP24 {
1724 #[serde(skip_serializing_if = "Option::is_none")]
1726 pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
1727}
1728#[cfg(feature = "redact-generated-debug")]
1729impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24 {
1730 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1731 f.debug_struct("CreateSetupIntentPaymentMethodDataP24").finish_non_exhaustive()
1732 }
1733}
1734impl CreateSetupIntentPaymentMethodDataP24 {
1735 pub fn new() -> Self {
1736 Self { bank: None }
1737 }
1738}
1739impl Default for CreateSetupIntentPaymentMethodDataP24 {
1740 fn default() -> Self {
1741 Self::new()
1742 }
1743}
1744#[derive(Clone, Eq, PartialEq)]
1746#[non_exhaustive]
1747pub enum CreateSetupIntentPaymentMethodDataP24Bank {
1748 AliorBank,
1749 BankMillennium,
1750 BankNowyBfgSa,
1751 BankPekaoSa,
1752 BankiSpbdzielcze,
1753 Blik,
1754 BnpParibas,
1755 Boz,
1756 CitiHandlowy,
1757 CreditAgricole,
1758 Envelobank,
1759 EtransferPocztowy24,
1760 GetinBank,
1761 Ideabank,
1762 Ing,
1763 Inteligo,
1764 MbankMtransfer,
1765 NestPrzelew,
1766 NoblePay,
1767 PbacZIpko,
1768 PlusBank,
1769 SantanderPrzelew24,
1770 TmobileUsbugiBankowe,
1771 ToyotaBank,
1772 Velobank,
1773 VolkswagenBank,
1774 Unknown(String),
1776}
1777impl CreateSetupIntentPaymentMethodDataP24Bank {
1778 pub fn as_str(&self) -> &str {
1779 use CreateSetupIntentPaymentMethodDataP24Bank::*;
1780 match self {
1781 AliorBank => "alior_bank",
1782 BankMillennium => "bank_millennium",
1783 BankNowyBfgSa => "bank_nowy_bfg_sa",
1784 BankPekaoSa => "bank_pekao_sa",
1785 BankiSpbdzielcze => "banki_spbdzielcze",
1786 Blik => "blik",
1787 BnpParibas => "bnp_paribas",
1788 Boz => "boz",
1789 CitiHandlowy => "citi_handlowy",
1790 CreditAgricole => "credit_agricole",
1791 Envelobank => "envelobank",
1792 EtransferPocztowy24 => "etransfer_pocztowy24",
1793 GetinBank => "getin_bank",
1794 Ideabank => "ideabank",
1795 Ing => "ing",
1796 Inteligo => "inteligo",
1797 MbankMtransfer => "mbank_mtransfer",
1798 NestPrzelew => "nest_przelew",
1799 NoblePay => "noble_pay",
1800 PbacZIpko => "pbac_z_ipko",
1801 PlusBank => "plus_bank",
1802 SantanderPrzelew24 => "santander_przelew24",
1803 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1804 ToyotaBank => "toyota_bank",
1805 Velobank => "velobank",
1806 VolkswagenBank => "volkswagen_bank",
1807 Unknown(v) => v,
1808 }
1809 }
1810}
1811
1812impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
1813 type Err = std::convert::Infallible;
1814 fn from_str(s: &str) -> Result<Self, Self::Err> {
1815 use CreateSetupIntentPaymentMethodDataP24Bank::*;
1816 match s {
1817 "alior_bank" => Ok(AliorBank),
1818 "bank_millennium" => Ok(BankMillennium),
1819 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1820 "bank_pekao_sa" => Ok(BankPekaoSa),
1821 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1822 "blik" => Ok(Blik),
1823 "bnp_paribas" => Ok(BnpParibas),
1824 "boz" => Ok(Boz),
1825 "citi_handlowy" => Ok(CitiHandlowy),
1826 "credit_agricole" => Ok(CreditAgricole),
1827 "envelobank" => Ok(Envelobank),
1828 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1829 "getin_bank" => Ok(GetinBank),
1830 "ideabank" => Ok(Ideabank),
1831 "ing" => Ok(Ing),
1832 "inteligo" => Ok(Inteligo),
1833 "mbank_mtransfer" => Ok(MbankMtransfer),
1834 "nest_przelew" => Ok(NestPrzelew),
1835 "noble_pay" => Ok(NoblePay),
1836 "pbac_z_ipko" => Ok(PbacZIpko),
1837 "plus_bank" => Ok(PlusBank),
1838 "santander_przelew24" => Ok(SantanderPrzelew24),
1839 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1840 "toyota_bank" => Ok(ToyotaBank),
1841 "velobank" => Ok(Velobank),
1842 "volkswagen_bank" => Ok(VolkswagenBank),
1843 v => {
1844 tracing::warn!(
1845 "Unknown value '{}' for enum '{}'",
1846 v,
1847 "CreateSetupIntentPaymentMethodDataP24Bank"
1848 );
1849 Ok(Unknown(v.to_owned()))
1850 }
1851 }
1852 }
1853}
1854impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
1855 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1856 f.write_str(self.as_str())
1857 }
1858}
1859
1860#[cfg(not(feature = "redact-generated-debug"))]
1861impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1862 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1863 f.write_str(self.as_str())
1864 }
1865}
1866#[cfg(feature = "redact-generated-debug")]
1867impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1868 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1869 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataP24Bank))
1870 .finish_non_exhaustive()
1871 }
1872}
1873impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
1874 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1875 where
1876 S: serde::Serializer,
1877 {
1878 serializer.serialize_str(self.as_str())
1879 }
1880}
1881#[cfg(feature = "deserialize")]
1882impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
1883 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1884 use std::str::FromStr;
1885 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1886 Ok(Self::from_str(&s).expect("infallible"))
1887 }
1888}
1889#[derive(Clone, Eq, PartialEq)]
1891#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1892#[derive(serde::Serialize)]
1893pub struct CreateSetupIntentPaymentMethodDataPayto {
1894 #[serde(skip_serializing_if = "Option::is_none")]
1896 pub account_number: Option<String>,
1897 #[serde(skip_serializing_if = "Option::is_none")]
1899 pub bsb_number: Option<String>,
1900 #[serde(skip_serializing_if = "Option::is_none")]
1902 pub pay_id: Option<String>,
1903}
1904#[cfg(feature = "redact-generated-debug")]
1905impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataPayto {
1906 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1907 f.debug_struct("CreateSetupIntentPaymentMethodDataPayto").finish_non_exhaustive()
1908 }
1909}
1910impl CreateSetupIntentPaymentMethodDataPayto {
1911 pub fn new() -> Self {
1912 Self { account_number: None, bsb_number: None, pay_id: None }
1913 }
1914}
1915impl Default for CreateSetupIntentPaymentMethodDataPayto {
1916 fn default() -> Self {
1917 Self::new()
1918 }
1919}
1920#[derive(Clone, Eq, PartialEq)]
1922#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1923#[derive(serde::Serialize)]
1924pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
1925 pub iban: String,
1927}
1928#[cfg(feature = "redact-generated-debug")]
1929impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSepaDebit {
1930 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1931 f.debug_struct("CreateSetupIntentPaymentMethodDataSepaDebit").finish_non_exhaustive()
1932 }
1933}
1934impl CreateSetupIntentPaymentMethodDataSepaDebit {
1935 pub fn new(iban: impl Into<String>) -> Self {
1936 Self { iban: iban.into() }
1937 }
1938}
1939#[derive(Clone, Eq, PartialEq)]
1941#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1942#[derive(serde::Serialize)]
1943pub struct CreateSetupIntentPaymentMethodDataSofort {
1944 pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
1946}
1947#[cfg(feature = "redact-generated-debug")]
1948impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofort {
1949 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1950 f.debug_struct("CreateSetupIntentPaymentMethodDataSofort").finish_non_exhaustive()
1951 }
1952}
1953impl CreateSetupIntentPaymentMethodDataSofort {
1954 pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
1955 Self { country: country.into() }
1956 }
1957}
1958#[derive(Clone, Eq, PartialEq)]
1960#[non_exhaustive]
1961pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
1962 At,
1963 Be,
1964 De,
1965 Es,
1966 It,
1967 Nl,
1968 Unknown(String),
1970}
1971impl CreateSetupIntentPaymentMethodDataSofortCountry {
1972 pub fn as_str(&self) -> &str {
1973 use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1974 match self {
1975 At => "AT",
1976 Be => "BE",
1977 De => "DE",
1978 Es => "ES",
1979 It => "IT",
1980 Nl => "NL",
1981 Unknown(v) => v,
1982 }
1983 }
1984}
1985
1986impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
1987 type Err = std::convert::Infallible;
1988 fn from_str(s: &str) -> Result<Self, Self::Err> {
1989 use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1990 match s {
1991 "AT" => Ok(At),
1992 "BE" => Ok(Be),
1993 "DE" => Ok(De),
1994 "ES" => Ok(Es),
1995 "IT" => Ok(It),
1996 "NL" => Ok(Nl),
1997 v => {
1998 tracing::warn!(
1999 "Unknown value '{}' for enum '{}'",
2000 v,
2001 "CreateSetupIntentPaymentMethodDataSofortCountry"
2002 );
2003 Ok(Unknown(v.to_owned()))
2004 }
2005 }
2006 }
2007}
2008impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
2009 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2010 f.write_str(self.as_str())
2011 }
2012}
2013
2014#[cfg(not(feature = "redact-generated-debug"))]
2015impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
2016 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2017 f.write_str(self.as_str())
2018 }
2019}
2020#[cfg(feature = "redact-generated-debug")]
2021impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
2022 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2023 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataSofortCountry))
2024 .finish_non_exhaustive()
2025 }
2026}
2027impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
2028 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2029 where
2030 S: serde::Serializer,
2031 {
2032 serializer.serialize_str(self.as_str())
2033 }
2034}
2035#[cfg(feature = "deserialize")]
2036impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
2037 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2038 use std::str::FromStr;
2039 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2040 Ok(Self::from_str(&s).expect("infallible"))
2041 }
2042}
2043#[derive(Clone, Eq, PartialEq)]
2047#[non_exhaustive]
2048pub enum CreateSetupIntentPaymentMethodDataType {
2049 AcssDebit,
2050 Affirm,
2051 AfterpayClearpay,
2052 Alipay,
2053 Alma,
2054 AmazonPay,
2055 AuBecsDebit,
2056 BacsDebit,
2057 Bancontact,
2058 Billie,
2059 Blik,
2060 Boleto,
2061 Cashapp,
2062 Crypto,
2063 CustomerBalance,
2064 Eps,
2065 Fpx,
2066 Giropay,
2067 Grabpay,
2068 Ideal,
2069 KakaoPay,
2070 Klarna,
2071 Konbini,
2072 KrCard,
2073 Link,
2074 MbWay,
2075 Mobilepay,
2076 Multibanco,
2077 NaverPay,
2078 NzBankAccount,
2079 Oxxo,
2080 P24,
2081 PayByBank,
2082 Payco,
2083 Paynow,
2084 Paypal,
2085 Payto,
2086 Pix,
2087 Promptpay,
2088 RevolutPay,
2089 SamsungPay,
2090 Satispay,
2091 SepaDebit,
2092 Sofort,
2093 Sunbit,
2094 Swish,
2095 Twint,
2096 Upi,
2097 UsBankAccount,
2098 WechatPay,
2099 Zip,
2100 Unknown(String),
2102}
2103impl CreateSetupIntentPaymentMethodDataType {
2104 pub fn as_str(&self) -> &str {
2105 use CreateSetupIntentPaymentMethodDataType::*;
2106 match self {
2107 AcssDebit => "acss_debit",
2108 Affirm => "affirm",
2109 AfterpayClearpay => "afterpay_clearpay",
2110 Alipay => "alipay",
2111 Alma => "alma",
2112 AmazonPay => "amazon_pay",
2113 AuBecsDebit => "au_becs_debit",
2114 BacsDebit => "bacs_debit",
2115 Bancontact => "bancontact",
2116 Billie => "billie",
2117 Blik => "blik",
2118 Boleto => "boleto",
2119 Cashapp => "cashapp",
2120 Crypto => "crypto",
2121 CustomerBalance => "customer_balance",
2122 Eps => "eps",
2123 Fpx => "fpx",
2124 Giropay => "giropay",
2125 Grabpay => "grabpay",
2126 Ideal => "ideal",
2127 KakaoPay => "kakao_pay",
2128 Klarna => "klarna",
2129 Konbini => "konbini",
2130 KrCard => "kr_card",
2131 Link => "link",
2132 MbWay => "mb_way",
2133 Mobilepay => "mobilepay",
2134 Multibanco => "multibanco",
2135 NaverPay => "naver_pay",
2136 NzBankAccount => "nz_bank_account",
2137 Oxxo => "oxxo",
2138 P24 => "p24",
2139 PayByBank => "pay_by_bank",
2140 Payco => "payco",
2141 Paynow => "paynow",
2142 Paypal => "paypal",
2143 Payto => "payto",
2144 Pix => "pix",
2145 Promptpay => "promptpay",
2146 RevolutPay => "revolut_pay",
2147 SamsungPay => "samsung_pay",
2148 Satispay => "satispay",
2149 SepaDebit => "sepa_debit",
2150 Sofort => "sofort",
2151 Sunbit => "sunbit",
2152 Swish => "swish",
2153 Twint => "twint",
2154 Upi => "upi",
2155 UsBankAccount => "us_bank_account",
2156 WechatPay => "wechat_pay",
2157 Zip => "zip",
2158 Unknown(v) => v,
2159 }
2160 }
2161}
2162
2163impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
2164 type Err = std::convert::Infallible;
2165 fn from_str(s: &str) -> Result<Self, Self::Err> {
2166 use CreateSetupIntentPaymentMethodDataType::*;
2167 match s {
2168 "acss_debit" => Ok(AcssDebit),
2169 "affirm" => Ok(Affirm),
2170 "afterpay_clearpay" => Ok(AfterpayClearpay),
2171 "alipay" => Ok(Alipay),
2172 "alma" => Ok(Alma),
2173 "amazon_pay" => Ok(AmazonPay),
2174 "au_becs_debit" => Ok(AuBecsDebit),
2175 "bacs_debit" => Ok(BacsDebit),
2176 "bancontact" => Ok(Bancontact),
2177 "billie" => Ok(Billie),
2178 "blik" => Ok(Blik),
2179 "boleto" => Ok(Boleto),
2180 "cashapp" => Ok(Cashapp),
2181 "crypto" => Ok(Crypto),
2182 "customer_balance" => Ok(CustomerBalance),
2183 "eps" => Ok(Eps),
2184 "fpx" => Ok(Fpx),
2185 "giropay" => Ok(Giropay),
2186 "grabpay" => Ok(Grabpay),
2187 "ideal" => Ok(Ideal),
2188 "kakao_pay" => Ok(KakaoPay),
2189 "klarna" => Ok(Klarna),
2190 "konbini" => Ok(Konbini),
2191 "kr_card" => Ok(KrCard),
2192 "link" => Ok(Link),
2193 "mb_way" => Ok(MbWay),
2194 "mobilepay" => Ok(Mobilepay),
2195 "multibanco" => Ok(Multibanco),
2196 "naver_pay" => Ok(NaverPay),
2197 "nz_bank_account" => Ok(NzBankAccount),
2198 "oxxo" => Ok(Oxxo),
2199 "p24" => Ok(P24),
2200 "pay_by_bank" => Ok(PayByBank),
2201 "payco" => Ok(Payco),
2202 "paynow" => Ok(Paynow),
2203 "paypal" => Ok(Paypal),
2204 "payto" => Ok(Payto),
2205 "pix" => Ok(Pix),
2206 "promptpay" => Ok(Promptpay),
2207 "revolut_pay" => Ok(RevolutPay),
2208 "samsung_pay" => Ok(SamsungPay),
2209 "satispay" => Ok(Satispay),
2210 "sepa_debit" => Ok(SepaDebit),
2211 "sofort" => Ok(Sofort),
2212 "sunbit" => Ok(Sunbit),
2213 "swish" => Ok(Swish),
2214 "twint" => Ok(Twint),
2215 "upi" => Ok(Upi),
2216 "us_bank_account" => Ok(UsBankAccount),
2217 "wechat_pay" => Ok(WechatPay),
2218 "zip" => Ok(Zip),
2219 v => {
2220 tracing::warn!(
2221 "Unknown value '{}' for enum '{}'",
2222 v,
2223 "CreateSetupIntentPaymentMethodDataType"
2224 );
2225 Ok(Unknown(v.to_owned()))
2226 }
2227 }
2228 }
2229}
2230impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
2231 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2232 f.write_str(self.as_str())
2233 }
2234}
2235
2236#[cfg(not(feature = "redact-generated-debug"))]
2237impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
2238 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2239 f.write_str(self.as_str())
2240 }
2241}
2242#[cfg(feature = "redact-generated-debug")]
2243impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
2244 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2245 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataType)).finish_non_exhaustive()
2246 }
2247}
2248impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
2249 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2250 where
2251 S: serde::Serializer,
2252 {
2253 serializer.serialize_str(self.as_str())
2254 }
2255}
2256#[cfg(feature = "deserialize")]
2257impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
2258 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2259 use std::str::FromStr;
2260 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2261 Ok(Self::from_str(&s).expect("infallible"))
2262 }
2263}
2264#[derive(Clone, Eq, PartialEq)]
2266#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2267#[derive(serde::Serialize)]
2268pub struct CreateSetupIntentPaymentMethodDataUpi {
2269 #[serde(skip_serializing_if = "Option::is_none")]
2271 pub mandate_options: Option<CreateSetupIntentPaymentMethodDataUpiMandateOptions>,
2272}
2273#[cfg(feature = "redact-generated-debug")]
2274impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpi {
2275 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2276 f.debug_struct("CreateSetupIntentPaymentMethodDataUpi").finish_non_exhaustive()
2277 }
2278}
2279impl CreateSetupIntentPaymentMethodDataUpi {
2280 pub fn new() -> Self {
2281 Self { mandate_options: None }
2282 }
2283}
2284impl Default for CreateSetupIntentPaymentMethodDataUpi {
2285 fn default() -> Self {
2286 Self::new()
2287 }
2288}
2289#[derive(Clone, Eq, PartialEq)]
2291#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2292#[derive(serde::Serialize)]
2293pub struct CreateSetupIntentPaymentMethodDataUpiMandateOptions {
2294 #[serde(skip_serializing_if = "Option::is_none")]
2296 pub amount: Option<i64>,
2297 #[serde(skip_serializing_if = "Option::is_none")]
2301 pub amount_type: Option<CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType>,
2302 #[serde(skip_serializing_if = "Option::is_none")]
2304 pub description: Option<String>,
2305 #[serde(skip_serializing_if = "Option::is_none")]
2307 pub end_date: Option<stripe_types::Timestamp>,
2308}
2309#[cfg(feature = "redact-generated-debug")]
2310impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpiMandateOptions {
2311 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2312 f.debug_struct("CreateSetupIntentPaymentMethodDataUpiMandateOptions")
2313 .finish_non_exhaustive()
2314 }
2315}
2316impl CreateSetupIntentPaymentMethodDataUpiMandateOptions {
2317 pub fn new() -> Self {
2318 Self { amount: None, amount_type: None, description: None, end_date: None }
2319 }
2320}
2321impl Default for CreateSetupIntentPaymentMethodDataUpiMandateOptions {
2322 fn default() -> Self {
2323 Self::new()
2324 }
2325}
2326#[derive(Clone, Eq, PartialEq)]
2330#[non_exhaustive]
2331pub enum CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2332 Fixed,
2333 Maximum,
2334 Unknown(String),
2336}
2337impl CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2338 pub fn as_str(&self) -> &str {
2339 use CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
2340 match self {
2341 Fixed => "fixed",
2342 Maximum => "maximum",
2343 Unknown(v) => v,
2344 }
2345 }
2346}
2347
2348impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2349 type Err = std::convert::Infallible;
2350 fn from_str(s: &str) -> Result<Self, Self::Err> {
2351 use CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
2352 match s {
2353 "fixed" => Ok(Fixed),
2354 "maximum" => Ok(Maximum),
2355 v => {
2356 tracing::warn!(
2357 "Unknown value '{}' for enum '{}'",
2358 v,
2359 "CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType"
2360 );
2361 Ok(Unknown(v.to_owned()))
2362 }
2363 }
2364 }
2365}
2366impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2367 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2368 f.write_str(self.as_str())
2369 }
2370}
2371
2372#[cfg(not(feature = "redact-generated-debug"))]
2373impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2374 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2375 f.write_str(self.as_str())
2376 }
2377}
2378#[cfg(feature = "redact-generated-debug")]
2379impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2380 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2381 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType))
2382 .finish_non_exhaustive()
2383 }
2384}
2385impl serde::Serialize for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
2386 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2387 where
2388 S: serde::Serializer,
2389 {
2390 serializer.serialize_str(self.as_str())
2391 }
2392}
2393#[cfg(feature = "deserialize")]
2394impl<'de> serde::Deserialize<'de>
2395 for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType
2396{
2397 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2398 use std::str::FromStr;
2399 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2400 Ok(Self::from_str(&s).expect("infallible"))
2401 }
2402}
2403#[derive(Clone, Eq, PartialEq)]
2405#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2406#[derive(serde::Serialize)]
2407pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
2408 #[serde(skip_serializing_if = "Option::is_none")]
2410 pub account_holder_type:
2411 Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
2412 #[serde(skip_serializing_if = "Option::is_none")]
2414 pub account_number: Option<String>,
2415 #[serde(skip_serializing_if = "Option::is_none")]
2417 pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
2418 #[serde(skip_serializing_if = "Option::is_none")]
2420 pub financial_connections_account: Option<String>,
2421 #[serde(skip_serializing_if = "Option::is_none")]
2423 pub routing_number: Option<String>,
2424}
2425#[cfg(feature = "redact-generated-debug")]
2426impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccount {
2427 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2428 f.debug_struct("CreateSetupIntentPaymentMethodDataUsBankAccount").finish_non_exhaustive()
2429 }
2430}
2431impl CreateSetupIntentPaymentMethodDataUsBankAccount {
2432 pub fn new() -> Self {
2433 Self {
2434 account_holder_type: None,
2435 account_number: None,
2436 account_type: None,
2437 financial_connections_account: None,
2438 routing_number: None,
2439 }
2440 }
2441}
2442impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
2443 fn default() -> Self {
2444 Self::new()
2445 }
2446}
2447#[derive(Clone, Eq, PartialEq)]
2449#[non_exhaustive]
2450pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2451 Company,
2452 Individual,
2453 Unknown(String),
2455}
2456impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2457 pub fn as_str(&self) -> &str {
2458 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2459 match self {
2460 Company => "company",
2461 Individual => "individual",
2462 Unknown(v) => v,
2463 }
2464 }
2465}
2466
2467impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2468 type Err = std::convert::Infallible;
2469 fn from_str(s: &str) -> Result<Self, Self::Err> {
2470 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2471 match s {
2472 "company" => Ok(Company),
2473 "individual" => Ok(Individual),
2474 v => {
2475 tracing::warn!(
2476 "Unknown value '{}' for enum '{}'",
2477 v,
2478 "CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
2479 );
2480 Ok(Unknown(v.to_owned()))
2481 }
2482 }
2483 }
2484}
2485impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2486 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2487 f.write_str(self.as_str())
2488 }
2489}
2490
2491#[cfg(not(feature = "redact-generated-debug"))]
2492impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2493 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2494 f.write_str(self.as_str())
2495 }
2496}
2497#[cfg(feature = "redact-generated-debug")]
2498impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2499 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2500 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType))
2501 .finish_non_exhaustive()
2502 }
2503}
2504impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2505 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2506 where
2507 S: serde::Serializer,
2508 {
2509 serializer.serialize_str(self.as_str())
2510 }
2511}
2512#[cfg(feature = "deserialize")]
2513impl<'de> serde::Deserialize<'de>
2514 for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
2515{
2516 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2517 use std::str::FromStr;
2518 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2519 Ok(Self::from_str(&s).expect("infallible"))
2520 }
2521}
2522#[derive(Clone, Eq, PartialEq)]
2524#[non_exhaustive]
2525pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2526 Checking,
2527 Savings,
2528 Unknown(String),
2530}
2531impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2532 pub fn as_str(&self) -> &str {
2533 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
2534 match self {
2535 Checking => "checking",
2536 Savings => "savings",
2537 Unknown(v) => v,
2538 }
2539 }
2540}
2541
2542impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2543 type Err = std::convert::Infallible;
2544 fn from_str(s: &str) -> Result<Self, Self::Err> {
2545 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
2546 match s {
2547 "checking" => Ok(Checking),
2548 "savings" => Ok(Savings),
2549 v => {
2550 tracing::warn!(
2551 "Unknown value '{}' for enum '{}'",
2552 v,
2553 "CreateSetupIntentPaymentMethodDataUsBankAccountAccountType"
2554 );
2555 Ok(Unknown(v.to_owned()))
2556 }
2557 }
2558 }
2559}
2560impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2561 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2562 f.write_str(self.as_str())
2563 }
2564}
2565
2566#[cfg(not(feature = "redact-generated-debug"))]
2567impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2568 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2569 f.write_str(self.as_str())
2570 }
2571}
2572#[cfg(feature = "redact-generated-debug")]
2573impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2574 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2575 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataUsBankAccountAccountType))
2576 .finish_non_exhaustive()
2577 }
2578}
2579impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2580 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2581 where
2582 S: serde::Serializer,
2583 {
2584 serializer.serialize_str(self.as_str())
2585 }
2586}
2587#[cfg(feature = "deserialize")]
2588impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2589 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2590 use std::str::FromStr;
2591 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2592 Ok(Self::from_str(&s).expect("infallible"))
2593 }
2594}
2595#[derive(Clone)]
2597#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2598#[derive(serde::Serialize)]
2599pub struct CreateSetupIntentPaymentMethodOptions {
2600 #[serde(skip_serializing_if = "Option::is_none")]
2602 pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
2603 #[serde(skip_serializing_if = "Option::is_none")]
2605 #[serde(with = "stripe_types::with_serde_json_opt")]
2606 pub amazon_pay: Option<miniserde::json::Value>,
2607 #[serde(skip_serializing_if = "Option::is_none")]
2609 pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
2610 #[serde(skip_serializing_if = "Option::is_none")]
2612 pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
2613 #[serde(skip_serializing_if = "Option::is_none")]
2615 #[serde(with = "stripe_types::with_serde_json_opt")]
2616 pub card_present: Option<miniserde::json::Value>,
2617 #[serde(skip_serializing_if = "Option::is_none")]
2619 pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
2620 #[serde(skip_serializing_if = "Option::is_none")]
2622 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
2623 #[serde(skip_serializing_if = "Option::is_none")]
2625 pub paypal: Option<PaymentMethodOptionsParam>,
2626 #[serde(skip_serializing_if = "Option::is_none")]
2628 pub payto: Option<CreateSetupIntentPaymentMethodOptionsPayto>,
2629 #[serde(skip_serializing_if = "Option::is_none")]
2631 pub pix: Option<CreateSetupIntentPaymentMethodOptionsPix>,
2632 #[serde(skip_serializing_if = "Option::is_none")]
2634 pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
2635 #[serde(skip_serializing_if = "Option::is_none")]
2637 pub upi: Option<CreateSetupIntentPaymentMethodOptionsUpi>,
2638 #[serde(skip_serializing_if = "Option::is_none")]
2640 pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
2641}
2642#[cfg(feature = "redact-generated-debug")]
2643impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptions {
2644 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2645 f.debug_struct("CreateSetupIntentPaymentMethodOptions").finish_non_exhaustive()
2646 }
2647}
2648impl CreateSetupIntentPaymentMethodOptions {
2649 pub fn new() -> Self {
2650 Self {
2651 acss_debit: None,
2652 amazon_pay: None,
2653 bacs_debit: None,
2654 card: None,
2655 card_present: None,
2656 klarna: None,
2657 link: None,
2658 paypal: None,
2659 payto: None,
2660 pix: None,
2661 sepa_debit: None,
2662 upi: None,
2663 us_bank_account: None,
2664 }
2665 }
2666}
2667impl Default for CreateSetupIntentPaymentMethodOptions {
2668 fn default() -> Self {
2669 Self::new()
2670 }
2671}
2672#[derive(Clone, Eq, PartialEq)]
2674#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2675#[derive(serde::Serialize)]
2676pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
2677 #[serde(skip_serializing_if = "Option::is_none")]
2680 pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
2681 #[serde(skip_serializing_if = "Option::is_none")]
2683 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2684 #[serde(skip_serializing_if = "Option::is_none")]
2686 pub verification_method:
2687 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2688}
2689#[cfg(feature = "redact-generated-debug")]
2690impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2691 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2692 f.debug_struct("CreateSetupIntentPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
2693 }
2694}
2695impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
2696 pub fn new() -> Self {
2697 Self { currency: None, mandate_options: None, verification_method: None }
2698 }
2699}
2700impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2701 fn default() -> Self {
2702 Self::new()
2703 }
2704}
2705#[derive(Clone, Eq, PartialEq)]
2708#[non_exhaustive]
2709pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2710 Cad,
2711 Usd,
2712 Unknown(String),
2714}
2715impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2716 pub fn as_str(&self) -> &str {
2717 use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2718 match self {
2719 Cad => "cad",
2720 Usd => "usd",
2721 Unknown(v) => v,
2722 }
2723 }
2724}
2725
2726impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2727 type Err = std::convert::Infallible;
2728 fn from_str(s: &str) -> Result<Self, Self::Err> {
2729 use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2730 match s {
2731 "cad" => Ok(Cad),
2732 "usd" => Ok(Usd),
2733 v => {
2734 tracing::warn!(
2735 "Unknown value '{}' for enum '{}'",
2736 v,
2737 "CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
2738 );
2739 Ok(Unknown(v.to_owned()))
2740 }
2741 }
2742 }
2743}
2744impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2745 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2746 f.write_str(self.as_str())
2747 }
2748}
2749
2750#[cfg(not(feature = "redact-generated-debug"))]
2751impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2752 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2753 f.write_str(self.as_str())
2754 }
2755}
2756#[cfg(feature = "redact-generated-debug")]
2757impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2758 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2759 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency))
2760 .finish_non_exhaustive()
2761 }
2762}
2763impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2764 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2765 where
2766 S: serde::Serializer,
2767 {
2768 serializer.serialize_str(self.as_str())
2769 }
2770}
2771#[cfg(feature = "deserialize")]
2772impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2773 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2774 use std::str::FromStr;
2775 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2776 Ok(Self::from_str(&s).expect("infallible"))
2777 }
2778}
2779#[derive(Clone, Eq, PartialEq)]
2781#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2782#[derive(serde::Serialize)]
2783pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2784 #[serde(skip_serializing_if = "Option::is_none")]
2788 pub custom_mandate_url: Option<String>,
2789 #[serde(skip_serializing_if = "Option::is_none")]
2791 pub default_for:
2792 Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
2793 #[serde(skip_serializing_if = "Option::is_none")]
2796 pub interval_description: Option<String>,
2797 #[serde(skip_serializing_if = "Option::is_none")]
2799 pub payment_schedule:
2800 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2801 #[serde(skip_serializing_if = "Option::is_none")]
2803 pub transaction_type:
2804 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2805}
2806#[cfg(feature = "redact-generated-debug")]
2807impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2808 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2809 f.debug_struct("CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions")
2810 .finish_non_exhaustive()
2811 }
2812}
2813impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2814 pub fn new() -> Self {
2815 Self {
2816 custom_mandate_url: None,
2817 default_for: None,
2818 interval_description: None,
2819 payment_schedule: None,
2820 transaction_type: None,
2821 }
2822 }
2823}
2824impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2825 fn default() -> Self {
2826 Self::new()
2827 }
2828}
2829#[derive(Clone, Eq, PartialEq)]
2831#[non_exhaustive]
2832pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2833 Invoice,
2834 Subscription,
2835 Unknown(String),
2837}
2838impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2839 pub fn as_str(&self) -> &str {
2840 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2841 match self {
2842 Invoice => "invoice",
2843 Subscription => "subscription",
2844 Unknown(v) => v,
2845 }
2846 }
2847}
2848
2849impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2850 type Err = std::convert::Infallible;
2851 fn from_str(s: &str) -> Result<Self, Self::Err> {
2852 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2853 match s {
2854 "invoice" => Ok(Invoice),
2855 "subscription" => Ok(Subscription),
2856 v => {
2857 tracing::warn!(
2858 "Unknown value '{}' for enum '{}'",
2859 v,
2860 "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
2861 );
2862 Ok(Unknown(v.to_owned()))
2863 }
2864 }
2865 }
2866}
2867impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2868 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2869 f.write_str(self.as_str())
2870 }
2871}
2872
2873#[cfg(not(feature = "redact-generated-debug"))]
2874impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2875 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2876 f.write_str(self.as_str())
2877 }
2878}
2879#[cfg(feature = "redact-generated-debug")]
2880impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2881 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2882 f.debug_struct(stringify!(
2883 CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2884 ))
2885 .finish_non_exhaustive()
2886 }
2887}
2888impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2889 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2890 where
2891 S: serde::Serializer,
2892 {
2893 serializer.serialize_str(self.as_str())
2894 }
2895}
2896#[cfg(feature = "deserialize")]
2897impl<'de> serde::Deserialize<'de>
2898 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2899{
2900 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2901 use std::str::FromStr;
2902 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2903 Ok(Self::from_str(&s).expect("infallible"))
2904 }
2905}
2906#[derive(Clone, Eq, PartialEq)]
2908#[non_exhaustive]
2909pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2910 Combined,
2911 Interval,
2912 Sporadic,
2913 Unknown(String),
2915}
2916impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2917 pub fn as_str(&self) -> &str {
2918 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2919 match self {
2920 Combined => "combined",
2921 Interval => "interval",
2922 Sporadic => "sporadic",
2923 Unknown(v) => v,
2924 }
2925 }
2926}
2927
2928impl std::str::FromStr
2929 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2930{
2931 type Err = std::convert::Infallible;
2932 fn from_str(s: &str) -> Result<Self, Self::Err> {
2933 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2934 match s {
2935 "combined" => Ok(Combined),
2936 "interval" => Ok(Interval),
2937 "sporadic" => Ok(Sporadic),
2938 v => {
2939 tracing::warn!(
2940 "Unknown value '{}' for enum '{}'",
2941 v,
2942 "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
2943 );
2944 Ok(Unknown(v.to_owned()))
2945 }
2946 }
2947 }
2948}
2949impl std::fmt::Display
2950 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2951{
2952 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2953 f.write_str(self.as_str())
2954 }
2955}
2956
2957#[cfg(not(feature = "redact-generated-debug"))]
2958impl std::fmt::Debug
2959 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2960{
2961 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2962 f.write_str(self.as_str())
2963 }
2964}
2965#[cfg(feature = "redact-generated-debug")]
2966impl std::fmt::Debug
2967 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2968{
2969 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2970 f.debug_struct(stringify!(
2971 CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2972 ))
2973 .finish_non_exhaustive()
2974 }
2975}
2976impl serde::Serialize
2977 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2978{
2979 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2980 where
2981 S: serde::Serializer,
2982 {
2983 serializer.serialize_str(self.as_str())
2984 }
2985}
2986#[cfg(feature = "deserialize")]
2987impl<'de> serde::Deserialize<'de>
2988 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2989{
2990 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2991 use std::str::FromStr;
2992 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2993 Ok(Self::from_str(&s).expect("infallible"))
2994 }
2995}
2996#[derive(Clone, Eq, PartialEq)]
2998#[non_exhaustive]
2999pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
3000 Business,
3001 Personal,
3002 Unknown(String),
3004}
3005impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
3006 pub fn as_str(&self) -> &str {
3007 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
3008 match self {
3009 Business => "business",
3010 Personal => "personal",
3011 Unknown(v) => v,
3012 }
3013 }
3014}
3015
3016impl std::str::FromStr
3017 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3018{
3019 type Err = std::convert::Infallible;
3020 fn from_str(s: &str) -> Result<Self, Self::Err> {
3021 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
3022 match s {
3023 "business" => Ok(Business),
3024 "personal" => Ok(Personal),
3025 v => {
3026 tracing::warn!(
3027 "Unknown value '{}' for enum '{}'",
3028 v,
3029 "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
3030 );
3031 Ok(Unknown(v.to_owned()))
3032 }
3033 }
3034 }
3035}
3036impl std::fmt::Display
3037 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3038{
3039 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3040 f.write_str(self.as_str())
3041 }
3042}
3043
3044#[cfg(not(feature = "redact-generated-debug"))]
3045impl std::fmt::Debug
3046 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3047{
3048 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3049 f.write_str(self.as_str())
3050 }
3051}
3052#[cfg(feature = "redact-generated-debug")]
3053impl std::fmt::Debug
3054 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3055{
3056 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3057 f.debug_struct(stringify!(
3058 CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3059 ))
3060 .finish_non_exhaustive()
3061 }
3062}
3063impl serde::Serialize
3064 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3065{
3066 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3067 where
3068 S: serde::Serializer,
3069 {
3070 serializer.serialize_str(self.as_str())
3071 }
3072}
3073#[cfg(feature = "deserialize")]
3074impl<'de> serde::Deserialize<'de>
3075 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3076{
3077 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3078 use std::str::FromStr;
3079 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3080 Ok(Self::from_str(&s).expect("infallible"))
3081 }
3082}
3083#[derive(Clone, Eq, PartialEq)]
3085#[non_exhaustive]
3086pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3087 Automatic,
3088 Instant,
3089 Microdeposits,
3090 Unknown(String),
3092}
3093impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3094 pub fn as_str(&self) -> &str {
3095 use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
3096 match self {
3097 Automatic => "automatic",
3098 Instant => "instant",
3099 Microdeposits => "microdeposits",
3100 Unknown(v) => v,
3101 }
3102 }
3103}
3104
3105impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3106 type Err = std::convert::Infallible;
3107 fn from_str(s: &str) -> Result<Self, Self::Err> {
3108 use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
3109 match s {
3110 "automatic" => Ok(Automatic),
3111 "instant" => Ok(Instant),
3112 "microdeposits" => Ok(Microdeposits),
3113 v => {
3114 tracing::warn!(
3115 "Unknown value '{}' for enum '{}'",
3116 v,
3117 "CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
3118 );
3119 Ok(Unknown(v.to_owned()))
3120 }
3121 }
3122 }
3123}
3124impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3125 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3126 f.write_str(self.as_str())
3127 }
3128}
3129
3130#[cfg(not(feature = "redact-generated-debug"))]
3131impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3132 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3133 f.write_str(self.as_str())
3134 }
3135}
3136#[cfg(feature = "redact-generated-debug")]
3137impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3138 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3139 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod))
3140 .finish_non_exhaustive()
3141 }
3142}
3143impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3144 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3145 where
3146 S: serde::Serializer,
3147 {
3148 serializer.serialize_str(self.as_str())
3149 }
3150}
3151#[cfg(feature = "deserialize")]
3152impl<'de> serde::Deserialize<'de>
3153 for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
3154{
3155 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3156 use std::str::FromStr;
3157 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3158 Ok(Self::from_str(&s).expect("infallible"))
3159 }
3160}
3161#[derive(Clone, Eq, PartialEq)]
3163#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3164#[derive(serde::Serialize)]
3165pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
3166 #[serde(skip_serializing_if = "Option::is_none")]
3168 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
3169}
3170#[cfg(feature = "redact-generated-debug")]
3171impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsBacsDebit {
3172 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3173 f.debug_struct("CreateSetupIntentPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
3174 }
3175}
3176impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
3177 pub fn new() -> Self {
3178 Self { mandate_options: None }
3179 }
3180}
3181impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
3182 fn default() -> Self {
3183 Self::new()
3184 }
3185}
3186#[derive(Clone, Eq, PartialEq)]
3188#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3189#[derive(serde::Serialize)]
3190pub struct CreateSetupIntentPaymentMethodOptionsCard {
3191 #[serde(skip_serializing_if = "Option::is_none")]
3193 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
3194 #[serde(skip_serializing_if = "Option::is_none")]
3198 pub moto: Option<bool>,
3199 #[serde(skip_serializing_if = "Option::is_none")]
3203 pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
3204 #[serde(skip_serializing_if = "Option::is_none")]
3209 pub request_three_d_secure:
3210 Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
3211 #[serde(skip_serializing_if = "Option::is_none")]
3214 pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
3215}
3216#[cfg(feature = "redact-generated-debug")]
3217impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCard {
3218 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3219 f.debug_struct("CreateSetupIntentPaymentMethodOptionsCard").finish_non_exhaustive()
3220 }
3221}
3222impl CreateSetupIntentPaymentMethodOptionsCard {
3223 pub fn new() -> Self {
3224 Self {
3225 mandate_options: None,
3226 moto: None,
3227 network: None,
3228 request_three_d_secure: None,
3229 three_d_secure: None,
3230 }
3231 }
3232}
3233impl Default for CreateSetupIntentPaymentMethodOptionsCard {
3234 fn default() -> Self {
3235 Self::new()
3236 }
3237}
3238#[derive(Clone, Eq, PartialEq)]
3240#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3241#[derive(serde::Serialize)]
3242pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
3243 pub amount: i64,
3245 pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
3249 pub currency: stripe_types::Currency,
3253 #[serde(skip_serializing_if = "Option::is_none")]
3255 pub description: Option<String>,
3256 #[serde(skip_serializing_if = "Option::is_none")]
3260 pub end_date: Option<stripe_types::Timestamp>,
3261 pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
3263 #[serde(skip_serializing_if = "Option::is_none")]
3268 pub interval_count: Option<u64>,
3269 pub reference: String,
3271 pub start_date: stripe_types::Timestamp,
3273 #[serde(skip_serializing_if = "Option::is_none")]
3275 pub supported_types:
3276 Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
3277}
3278#[cfg(feature = "redact-generated-debug")]
3279impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
3280 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3281 f.debug_struct("CreateSetupIntentPaymentMethodOptionsCardMandateOptions")
3282 .finish_non_exhaustive()
3283 }
3284}
3285impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
3286 pub fn new(
3287 amount: impl Into<i64>,
3288 amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
3289 currency: impl Into<stripe_types::Currency>,
3290 interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
3291 reference: impl Into<String>,
3292 start_date: impl Into<stripe_types::Timestamp>,
3293 ) -> Self {
3294 Self {
3295 amount: amount.into(),
3296 amount_type: amount_type.into(),
3297 currency: currency.into(),
3298 description: None,
3299 end_date: None,
3300 interval: interval.into(),
3301 interval_count: None,
3302 reference: reference.into(),
3303 start_date: start_date.into(),
3304 supported_types: None,
3305 }
3306 }
3307}
3308#[derive(Clone, Eq, PartialEq)]
3312#[non_exhaustive]
3313pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3314 Fixed,
3315 Maximum,
3316 Unknown(String),
3318}
3319impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3320 pub fn as_str(&self) -> &str {
3321 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
3322 match self {
3323 Fixed => "fixed",
3324 Maximum => "maximum",
3325 Unknown(v) => v,
3326 }
3327 }
3328}
3329
3330impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3331 type Err = std::convert::Infallible;
3332 fn from_str(s: &str) -> Result<Self, Self::Err> {
3333 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
3334 match s {
3335 "fixed" => Ok(Fixed),
3336 "maximum" => Ok(Maximum),
3337 v => {
3338 tracing::warn!(
3339 "Unknown value '{}' for enum '{}'",
3340 v,
3341 "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
3342 );
3343 Ok(Unknown(v.to_owned()))
3344 }
3345 }
3346 }
3347}
3348impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3349 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3350 f.write_str(self.as_str())
3351 }
3352}
3353
3354#[cfg(not(feature = "redact-generated-debug"))]
3355impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3356 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3357 f.write_str(self.as_str())
3358 }
3359}
3360#[cfg(feature = "redact-generated-debug")]
3361impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3362 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3363 f.debug_struct(stringify!(
3364 CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
3365 ))
3366 .finish_non_exhaustive()
3367 }
3368}
3369impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
3370 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3371 where
3372 S: serde::Serializer,
3373 {
3374 serializer.serialize_str(self.as_str())
3375 }
3376}
3377#[cfg(feature = "deserialize")]
3378impl<'de> serde::Deserialize<'de>
3379 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
3380{
3381 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3382 use std::str::FromStr;
3383 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3384 Ok(Self::from_str(&s).expect("infallible"))
3385 }
3386}
3387#[derive(Clone, Eq, PartialEq)]
3389#[non_exhaustive]
3390pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3391 Day,
3392 Month,
3393 Sporadic,
3394 Week,
3395 Year,
3396 Unknown(String),
3398}
3399impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3400 pub fn as_str(&self) -> &str {
3401 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
3402 match self {
3403 Day => "day",
3404 Month => "month",
3405 Sporadic => "sporadic",
3406 Week => "week",
3407 Year => "year",
3408 Unknown(v) => v,
3409 }
3410 }
3411}
3412
3413impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3414 type Err = std::convert::Infallible;
3415 fn from_str(s: &str) -> Result<Self, Self::Err> {
3416 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
3417 match s {
3418 "day" => Ok(Day),
3419 "month" => Ok(Month),
3420 "sporadic" => Ok(Sporadic),
3421 "week" => Ok(Week),
3422 "year" => Ok(Year),
3423 v => {
3424 tracing::warn!(
3425 "Unknown value '{}' for enum '{}'",
3426 v,
3427 "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
3428 );
3429 Ok(Unknown(v.to_owned()))
3430 }
3431 }
3432 }
3433}
3434impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3435 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3436 f.write_str(self.as_str())
3437 }
3438}
3439
3440#[cfg(not(feature = "redact-generated-debug"))]
3441impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3442 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3443 f.write_str(self.as_str())
3444 }
3445}
3446#[cfg(feature = "redact-generated-debug")]
3447impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3448 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3449 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval))
3450 .finish_non_exhaustive()
3451 }
3452}
3453impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
3454 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3455 where
3456 S: serde::Serializer,
3457 {
3458 serializer.serialize_str(self.as_str())
3459 }
3460}
3461#[cfg(feature = "deserialize")]
3462impl<'de> serde::Deserialize<'de>
3463 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
3464{
3465 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3466 use std::str::FromStr;
3467 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3468 Ok(Self::from_str(&s).expect("infallible"))
3469 }
3470}
3471#[derive(Clone, Eq, PartialEq)]
3473#[non_exhaustive]
3474pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3475 India,
3476 Unknown(String),
3478}
3479impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3480 pub fn as_str(&self) -> &str {
3481 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
3482 match self {
3483 India => "india",
3484 Unknown(v) => v,
3485 }
3486 }
3487}
3488
3489impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3490 type Err = std::convert::Infallible;
3491 fn from_str(s: &str) -> Result<Self, Self::Err> {
3492 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
3493 match s {
3494 "india" => Ok(India),
3495 v => {
3496 tracing::warn!(
3497 "Unknown value '{}' for enum '{}'",
3498 v,
3499 "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
3500 );
3501 Ok(Unknown(v.to_owned()))
3502 }
3503 }
3504 }
3505}
3506impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3507 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3508 f.write_str(self.as_str())
3509 }
3510}
3511
3512#[cfg(not(feature = "redact-generated-debug"))]
3513impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3514 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3515 f.write_str(self.as_str())
3516 }
3517}
3518#[cfg(feature = "redact-generated-debug")]
3519impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3520 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3521 f.debug_struct(stringify!(
3522 CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
3523 ))
3524 .finish_non_exhaustive()
3525 }
3526}
3527impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
3528 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3529 where
3530 S: serde::Serializer,
3531 {
3532 serializer.serialize_str(self.as_str())
3533 }
3534}
3535#[cfg(feature = "deserialize")]
3536impl<'de> serde::Deserialize<'de>
3537 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
3538{
3539 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3540 use std::str::FromStr;
3541 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3542 Ok(Self::from_str(&s).expect("infallible"))
3543 }
3544}
3545#[derive(Clone, Eq, PartialEq)]
3549#[non_exhaustive]
3550pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
3551 Amex,
3552 CartesBancaires,
3553 Diners,
3554 Discover,
3555 EftposAu,
3556 Girocard,
3557 Interac,
3558 Jcb,
3559 Link,
3560 Mastercard,
3561 Unionpay,
3562 Unknown,
3563 Visa,
3564 _Unknown(String),
3567}
3568impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
3569 pub fn as_str(&self) -> &str {
3570 use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
3571 match self {
3572 Amex => "amex",
3573 CartesBancaires => "cartes_bancaires",
3574 Diners => "diners",
3575 Discover => "discover",
3576 EftposAu => "eftpos_au",
3577 Girocard => "girocard",
3578 Interac => "interac",
3579 Jcb => "jcb",
3580 Link => "link",
3581 Mastercard => "mastercard",
3582 Unionpay => "unionpay",
3583 Unknown => "unknown",
3584 Visa => "visa",
3585 _Unknown(v) => v,
3586 }
3587 }
3588}
3589
3590impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3591 type Err = std::convert::Infallible;
3592 fn from_str(s: &str) -> Result<Self, Self::Err> {
3593 use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
3594 match s {
3595 "amex" => Ok(Amex),
3596 "cartes_bancaires" => Ok(CartesBancaires),
3597 "diners" => Ok(Diners),
3598 "discover" => Ok(Discover),
3599 "eftpos_au" => Ok(EftposAu),
3600 "girocard" => Ok(Girocard),
3601 "interac" => Ok(Interac),
3602 "jcb" => Ok(Jcb),
3603 "link" => Ok(Link),
3604 "mastercard" => Ok(Mastercard),
3605 "unionpay" => Ok(Unionpay),
3606 "unknown" => Ok(Unknown),
3607 "visa" => Ok(Visa),
3608 v => {
3609 tracing::warn!(
3610 "Unknown value '{}' for enum '{}'",
3611 v,
3612 "CreateSetupIntentPaymentMethodOptionsCardNetwork"
3613 );
3614 Ok(_Unknown(v.to_owned()))
3615 }
3616 }
3617 }
3618}
3619impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3620 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3621 f.write_str(self.as_str())
3622 }
3623}
3624
3625#[cfg(not(feature = "redact-generated-debug"))]
3626impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3627 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3628 f.write_str(self.as_str())
3629 }
3630}
3631#[cfg(feature = "redact-generated-debug")]
3632impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3633 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3634 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardNetwork))
3635 .finish_non_exhaustive()
3636 }
3637}
3638impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3639 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3640 where
3641 S: serde::Serializer,
3642 {
3643 serializer.serialize_str(self.as_str())
3644 }
3645}
3646#[cfg(feature = "deserialize")]
3647impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3648 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3649 use std::str::FromStr;
3650 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3651 Ok(Self::from_str(&s).expect("infallible"))
3652 }
3653}
3654#[derive(Clone, Eq, PartialEq)]
3659#[non_exhaustive]
3660pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3661 Any,
3662 Automatic,
3663 Challenge,
3664 Unknown(String),
3666}
3667impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3668 pub fn as_str(&self) -> &str {
3669 use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
3670 match self {
3671 Any => "any",
3672 Automatic => "automatic",
3673 Challenge => "challenge",
3674 Unknown(v) => v,
3675 }
3676 }
3677}
3678
3679impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3680 type Err = std::convert::Infallible;
3681 fn from_str(s: &str) -> Result<Self, Self::Err> {
3682 use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
3683 match s {
3684 "any" => Ok(Any),
3685 "automatic" => Ok(Automatic),
3686 "challenge" => Ok(Challenge),
3687 v => {
3688 tracing::warn!(
3689 "Unknown value '{}' for enum '{}'",
3690 v,
3691 "CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
3692 );
3693 Ok(Unknown(v.to_owned()))
3694 }
3695 }
3696 }
3697}
3698impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3699 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3700 f.write_str(self.as_str())
3701 }
3702}
3703
3704#[cfg(not(feature = "redact-generated-debug"))]
3705impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3706 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3707 f.write_str(self.as_str())
3708 }
3709}
3710#[cfg(feature = "redact-generated-debug")]
3711impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3712 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3713 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure))
3714 .finish_non_exhaustive()
3715 }
3716}
3717impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3718 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3719 where
3720 S: serde::Serializer,
3721 {
3722 serializer.serialize_str(self.as_str())
3723 }
3724}
3725#[cfg(feature = "deserialize")]
3726impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3727 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3728 use std::str::FromStr;
3729 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3730 Ok(Self::from_str(&s).expect("infallible"))
3731 }
3732}
3733#[derive(Clone, Eq, PartialEq)]
3736#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3737#[derive(serde::Serialize)]
3738pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3739 #[serde(skip_serializing_if = "Option::is_none")]
3741 pub ares_trans_status:
3742 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
3743 #[serde(skip_serializing_if = "Option::is_none")]
3748 pub cryptogram: Option<String>,
3749 #[serde(skip_serializing_if = "Option::is_none")]
3752 pub electronic_commerce_indicator:
3753 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
3754 #[serde(skip_serializing_if = "Option::is_none")]
3758 pub network_options:
3759 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
3760 #[serde(skip_serializing_if = "Option::is_none")]
3763 pub requestor_challenge_indicator: Option<String>,
3764 #[serde(skip_serializing_if = "Option::is_none")]
3767 pub transaction_id: Option<String>,
3768 #[serde(skip_serializing_if = "Option::is_none")]
3770 pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
3771}
3772#[cfg(feature = "redact-generated-debug")]
3773impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3774 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3775 f.debug_struct("CreateSetupIntentPaymentMethodOptionsCardThreeDSecure")
3776 .finish_non_exhaustive()
3777 }
3778}
3779impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3780 pub fn new() -> Self {
3781 Self {
3782 ares_trans_status: None,
3783 cryptogram: None,
3784 electronic_commerce_indicator: None,
3785 network_options: None,
3786 requestor_challenge_indicator: None,
3787 transaction_id: None,
3788 version: None,
3789 }
3790 }
3791}
3792impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3793 fn default() -> Self {
3794 Self::new()
3795 }
3796}
3797#[derive(Clone, Eq, PartialEq)]
3799#[non_exhaustive]
3800pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3801 A,
3802 C,
3803 I,
3804 N,
3805 R,
3806 U,
3807 Y,
3808 Unknown(String),
3810}
3811impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3812 pub fn as_str(&self) -> &str {
3813 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
3814 match self {
3815 A => "A",
3816 C => "C",
3817 I => "I",
3818 N => "N",
3819 R => "R",
3820 U => "U",
3821 Y => "Y",
3822 Unknown(v) => v,
3823 }
3824 }
3825}
3826
3827impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3828 type Err = std::convert::Infallible;
3829 fn from_str(s: &str) -> Result<Self, Self::Err> {
3830 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
3831 match s {
3832 "A" => Ok(A),
3833 "C" => Ok(C),
3834 "I" => Ok(I),
3835 "N" => Ok(N),
3836 "R" => Ok(R),
3837 "U" => Ok(U),
3838 "Y" => Ok(Y),
3839 v => {
3840 tracing::warn!(
3841 "Unknown value '{}' for enum '{}'",
3842 v,
3843 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
3844 );
3845 Ok(Unknown(v.to_owned()))
3846 }
3847 }
3848 }
3849}
3850impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3851 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3852 f.write_str(self.as_str())
3853 }
3854}
3855
3856#[cfg(not(feature = "redact-generated-debug"))]
3857impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3858 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3859 f.write_str(self.as_str())
3860 }
3861}
3862#[cfg(feature = "redact-generated-debug")]
3863impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3864 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3865 f.debug_struct(stringify!(
3866 CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3867 ))
3868 .finish_non_exhaustive()
3869 }
3870}
3871impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3872 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3873 where
3874 S: serde::Serializer,
3875 {
3876 serializer.serialize_str(self.as_str())
3877 }
3878}
3879#[cfg(feature = "deserialize")]
3880impl<'de> serde::Deserialize<'de>
3881 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3882{
3883 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3884 use std::str::FromStr;
3885 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3886 Ok(Self::from_str(&s).expect("infallible"))
3887 }
3888}
3889#[derive(Clone, Eq, PartialEq)]
3892#[non_exhaustive]
3893pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3894 V01,
3895 V02,
3896 V05,
3897 V06,
3898 V07,
3899 Unknown(String),
3901}
3902impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3903 pub fn as_str(&self) -> &str {
3904 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3905 match self {
3906 V01 => "01",
3907 V02 => "02",
3908 V05 => "05",
3909 V06 => "06",
3910 V07 => "07",
3911 Unknown(v) => v,
3912 }
3913 }
3914}
3915
3916impl std::str::FromStr
3917 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3918{
3919 type Err = std::convert::Infallible;
3920 fn from_str(s: &str) -> Result<Self, Self::Err> {
3921 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3922 match s {
3923 "01" => Ok(V01),
3924 "02" => Ok(V02),
3925 "05" => Ok(V05),
3926 "06" => Ok(V06),
3927 "07" => Ok(V07),
3928 v => {
3929 tracing::warn!(
3930 "Unknown value '{}' for enum '{}'",
3931 v,
3932 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
3933 );
3934 Ok(Unknown(v.to_owned()))
3935 }
3936 }
3937 }
3938}
3939impl std::fmt::Display
3940 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3941{
3942 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3943 f.write_str(self.as_str())
3944 }
3945}
3946
3947#[cfg(not(feature = "redact-generated-debug"))]
3948impl std::fmt::Debug
3949 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3950{
3951 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3952 f.write_str(self.as_str())
3953 }
3954}
3955#[cfg(feature = "redact-generated-debug")]
3956impl std::fmt::Debug
3957 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3958{
3959 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3960 f.debug_struct(stringify!(
3961 CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3962 ))
3963 .finish_non_exhaustive()
3964 }
3965}
3966impl serde::Serialize
3967 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3968{
3969 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3970 where
3971 S: serde::Serializer,
3972 {
3973 serializer.serialize_str(self.as_str())
3974 }
3975}
3976#[cfg(feature = "deserialize")]
3977impl<'de> serde::Deserialize<'de>
3978 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3979{
3980 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3981 use std::str::FromStr;
3982 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3983 Ok(Self::from_str(&s).expect("infallible"))
3984 }
3985}
3986#[derive(Clone, Eq, PartialEq)]
3990#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3991#[derive(serde::Serialize)]
3992pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3993 #[serde(skip_serializing_if = "Option::is_none")]
3995 pub cartes_bancaires:
3996 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
3997}
3998#[cfg(feature = "redact-generated-debug")]
3999impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
4000 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4001 f.debug_struct("CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions")
4002 .finish_non_exhaustive()
4003 }
4004}
4005impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
4006 pub fn new() -> Self {
4007 Self { cartes_bancaires: None }
4008 }
4009}
4010impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
4011 fn default() -> Self {
4012 Self::new()
4013 }
4014}
4015#[derive(Clone, Eq, PartialEq)]
4017#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4018#[derive(serde::Serialize)]
4019pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
4020 pub cb_avalgo:
4024 CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
4025 #[serde(skip_serializing_if = "Option::is_none")]
4030 pub cb_exemption: Option<String>,
4031 #[serde(skip_serializing_if = "Option::is_none")]
4034 pub cb_score: Option<i64>,
4035}
4036#[cfg(feature = "redact-generated-debug")]
4037impl std::fmt::Debug
4038 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires
4039{
4040 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4041 f.debug_struct(
4042 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires",
4043 )
4044 .finish_non_exhaustive()
4045 }
4046}
4047impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
4048 pub fn new(
4049 cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
4050 ) -> Self {
4051 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
4052 }
4053}
4054#[derive(Clone, Eq, PartialEq)]
4058#[non_exhaustive]
4059pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4060{
4061 V0,
4062 V1,
4063 V2,
4064 V3,
4065 V4,
4066 A,
4067 Unknown(String),
4069}
4070impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
4071 pub fn as_str(&self) -> &str {
4072 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
4073 match self {
4074 V0 => "0",
4075 V1 => "1",
4076 V2 => "2",
4077 V3 => "3",
4078 V4 => "4",
4079 A => "A",
4080 Unknown(v) => v,
4081 }
4082 }
4083}
4084
4085impl std::str::FromStr
4086 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4087{
4088 type Err = std::convert::Infallible;
4089 fn from_str(s: &str) -> Result<Self, Self::Err> {
4090 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
4091 match s {
4092 "0" => Ok(V0),
4093 "1" => Ok(V1),
4094 "2" => Ok(V2),
4095 "3" => Ok(V3),
4096 "4" => Ok(V4),
4097 "A" => Ok(A),
4098 v => {
4099 tracing::warn!(
4100 "Unknown value '{}' for enum '{}'",
4101 v,
4102 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
4103 );
4104 Ok(Unknown(v.to_owned()))
4105 }
4106 }
4107 }
4108}
4109impl std::fmt::Display
4110 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4111{
4112 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4113 f.write_str(self.as_str())
4114 }
4115}
4116
4117#[cfg(not(feature = "redact-generated-debug"))]
4118impl std::fmt::Debug
4119 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4120{
4121 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4122 f.write_str(self.as_str())
4123 }
4124}
4125#[cfg(feature = "redact-generated-debug")]
4126impl std::fmt::Debug
4127 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4128{
4129 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4130 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo)).finish_non_exhaustive()
4131 }
4132}
4133impl serde::Serialize
4134 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4135{
4136 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4137 where
4138 S: serde::Serializer,
4139 {
4140 serializer.serialize_str(self.as_str())
4141 }
4142}
4143#[cfg(feature = "deserialize")]
4144impl<'de> serde::Deserialize<'de>
4145 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
4146{
4147 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4148 use std::str::FromStr;
4149 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4150 Ok(Self::from_str(&s).expect("infallible"))
4151 }
4152}
4153#[derive(Clone, Eq, PartialEq)]
4155#[non_exhaustive]
4156pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4157 V1_0_2,
4158 V2_1_0,
4159 V2_2_0,
4160 V2_3_0,
4161 V2_3_1,
4162 Unknown(String),
4164}
4165impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4166 pub fn as_str(&self) -> &str {
4167 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
4168 match self {
4169 V1_0_2 => "1.0.2",
4170 V2_1_0 => "2.1.0",
4171 V2_2_0 => "2.2.0",
4172 V2_3_0 => "2.3.0",
4173 V2_3_1 => "2.3.1",
4174 Unknown(v) => v,
4175 }
4176 }
4177}
4178
4179impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4180 type Err = std::convert::Infallible;
4181 fn from_str(s: &str) -> Result<Self, Self::Err> {
4182 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
4183 match s {
4184 "1.0.2" => Ok(V1_0_2),
4185 "2.1.0" => Ok(V2_1_0),
4186 "2.2.0" => Ok(V2_2_0),
4187 "2.3.0" => Ok(V2_3_0),
4188 "2.3.1" => Ok(V2_3_1),
4189 v => {
4190 tracing::warn!(
4191 "Unknown value '{}' for enum '{}'",
4192 v,
4193 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
4194 );
4195 Ok(Unknown(v.to_owned()))
4196 }
4197 }
4198 }
4199}
4200impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4201 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4202 f.write_str(self.as_str())
4203 }
4204}
4205
4206#[cfg(not(feature = "redact-generated-debug"))]
4207impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4208 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4209 f.write_str(self.as_str())
4210 }
4211}
4212#[cfg(feature = "redact-generated-debug")]
4213impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4214 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4215 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion))
4216 .finish_non_exhaustive()
4217 }
4218}
4219impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4220 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4221 where
4222 S: serde::Serializer,
4223 {
4224 serializer.serialize_str(self.as_str())
4225 }
4226}
4227#[cfg(feature = "deserialize")]
4228impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
4229 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4230 use std::str::FromStr;
4231 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4232 Ok(Self::from_str(&s).expect("infallible"))
4233 }
4234}
4235#[derive(Clone, Eq, PartialEq)]
4237#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4238#[derive(serde::Serialize)]
4239pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
4240 #[serde(skip_serializing_if = "Option::is_none")]
4242 pub currency: Option<stripe_types::Currency>,
4243 #[serde(skip_serializing_if = "Option::is_none")]
4245 pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
4246 #[serde(skip_serializing_if = "Option::is_none")]
4248 pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
4249 #[serde(skip_serializing_if = "Option::is_none")]
4251 pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
4252}
4253#[cfg(feature = "redact-generated-debug")]
4254impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarna {
4255 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4256 f.debug_struct("CreateSetupIntentPaymentMethodOptionsKlarna").finish_non_exhaustive()
4257 }
4258}
4259impl CreateSetupIntentPaymentMethodOptionsKlarna {
4260 pub fn new() -> Self {
4261 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
4262 }
4263}
4264impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
4265 fn default() -> Self {
4266 Self::new()
4267 }
4268}
4269#[derive(Clone, Eq, PartialEq)]
4271#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4272#[derive(serde::Serialize)]
4273pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
4274 #[serde(skip_serializing_if = "Option::is_none")]
4277 pub average_amount: Option<i64>,
4278 #[serde(skip_serializing_if = "Option::is_none")]
4281 pub maximum_amount: Option<i64>,
4282 #[serde(skip_serializing_if = "Option::is_none")]
4285 pub minimum_amount: Option<i64>,
4286 #[serde(skip_serializing_if = "Option::is_none")]
4288 pub purchase_interval:
4289 Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
4290 #[serde(skip_serializing_if = "Option::is_none")]
4292 pub purchase_interval_count: Option<u64>,
4293}
4294#[cfg(feature = "redact-generated-debug")]
4295impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
4296 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4297 f.debug_struct("CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand")
4298 .finish_non_exhaustive()
4299 }
4300}
4301impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
4302 pub fn new() -> Self {
4303 Self {
4304 average_amount: None,
4305 maximum_amount: None,
4306 minimum_amount: None,
4307 purchase_interval: None,
4308 purchase_interval_count: None,
4309 }
4310 }
4311}
4312impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
4313 fn default() -> Self {
4314 Self::new()
4315 }
4316}
4317#[derive(Clone, Eq, PartialEq)]
4319#[non_exhaustive]
4320pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4321 Day,
4322 Month,
4323 Week,
4324 Year,
4325 Unknown(String),
4327}
4328impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4329 pub fn as_str(&self) -> &str {
4330 use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
4331 match self {
4332 Day => "day",
4333 Month => "month",
4334 Week => "week",
4335 Year => "year",
4336 Unknown(v) => v,
4337 }
4338 }
4339}
4340
4341impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4342 type Err = std::convert::Infallible;
4343 fn from_str(s: &str) -> Result<Self, Self::Err> {
4344 use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
4345 match s {
4346 "day" => Ok(Day),
4347 "month" => Ok(Month),
4348 "week" => Ok(Week),
4349 "year" => Ok(Year),
4350 v => {
4351 tracing::warn!(
4352 "Unknown value '{}' for enum '{}'",
4353 v,
4354 "CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
4355 );
4356 Ok(Unknown(v.to_owned()))
4357 }
4358 }
4359 }
4360}
4361impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4362 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4363 f.write_str(self.as_str())
4364 }
4365}
4366
4367#[cfg(not(feature = "redact-generated-debug"))]
4368impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4369 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4370 f.write_str(self.as_str())
4371 }
4372}
4373#[cfg(feature = "redact-generated-debug")]
4374impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4375 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4376 f.debug_struct(stringify!(
4377 CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
4378 ))
4379 .finish_non_exhaustive()
4380 }
4381}
4382impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
4383 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4384 where
4385 S: serde::Serializer,
4386 {
4387 serializer.serialize_str(self.as_str())
4388 }
4389}
4390#[cfg(feature = "deserialize")]
4391impl<'de> serde::Deserialize<'de>
4392 for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
4393{
4394 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4395 use std::str::FromStr;
4396 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4397 Ok(Self::from_str(&s).expect("infallible"))
4398 }
4399}
4400#[derive(Clone, Eq, PartialEq)]
4402#[non_exhaustive]
4403pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4404 CsMinusCz,
4405 DaMinusDk,
4406 DeMinusAt,
4407 DeMinusCh,
4408 DeMinusDe,
4409 ElMinusGr,
4410 EnMinusAt,
4411 EnMinusAu,
4412 EnMinusBe,
4413 EnMinusCa,
4414 EnMinusCh,
4415 EnMinusCz,
4416 EnMinusDe,
4417 EnMinusDk,
4418 EnMinusEs,
4419 EnMinusFi,
4420 EnMinusFr,
4421 EnMinusGb,
4422 EnMinusGr,
4423 EnMinusIe,
4424 EnMinusIt,
4425 EnMinusNl,
4426 EnMinusNo,
4427 EnMinusNz,
4428 EnMinusPl,
4429 EnMinusPt,
4430 EnMinusRo,
4431 EnMinusSe,
4432 EnMinusUs,
4433 EsMinusEs,
4434 EsMinusUs,
4435 FiMinusFi,
4436 FrMinusBe,
4437 FrMinusCa,
4438 FrMinusCh,
4439 FrMinusFr,
4440 ItMinusCh,
4441 ItMinusIt,
4442 NbMinusNo,
4443 NlMinusBe,
4444 NlMinusNl,
4445 PlMinusPl,
4446 PtMinusPt,
4447 RoMinusRo,
4448 SvMinusFi,
4449 SvMinusSe,
4450 Unknown(String),
4452}
4453impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4454 pub fn as_str(&self) -> &str {
4455 use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
4456 match self {
4457 CsMinusCz => "cs-CZ",
4458 DaMinusDk => "da-DK",
4459 DeMinusAt => "de-AT",
4460 DeMinusCh => "de-CH",
4461 DeMinusDe => "de-DE",
4462 ElMinusGr => "el-GR",
4463 EnMinusAt => "en-AT",
4464 EnMinusAu => "en-AU",
4465 EnMinusBe => "en-BE",
4466 EnMinusCa => "en-CA",
4467 EnMinusCh => "en-CH",
4468 EnMinusCz => "en-CZ",
4469 EnMinusDe => "en-DE",
4470 EnMinusDk => "en-DK",
4471 EnMinusEs => "en-ES",
4472 EnMinusFi => "en-FI",
4473 EnMinusFr => "en-FR",
4474 EnMinusGb => "en-GB",
4475 EnMinusGr => "en-GR",
4476 EnMinusIe => "en-IE",
4477 EnMinusIt => "en-IT",
4478 EnMinusNl => "en-NL",
4479 EnMinusNo => "en-NO",
4480 EnMinusNz => "en-NZ",
4481 EnMinusPl => "en-PL",
4482 EnMinusPt => "en-PT",
4483 EnMinusRo => "en-RO",
4484 EnMinusSe => "en-SE",
4485 EnMinusUs => "en-US",
4486 EsMinusEs => "es-ES",
4487 EsMinusUs => "es-US",
4488 FiMinusFi => "fi-FI",
4489 FrMinusBe => "fr-BE",
4490 FrMinusCa => "fr-CA",
4491 FrMinusCh => "fr-CH",
4492 FrMinusFr => "fr-FR",
4493 ItMinusCh => "it-CH",
4494 ItMinusIt => "it-IT",
4495 NbMinusNo => "nb-NO",
4496 NlMinusBe => "nl-BE",
4497 NlMinusNl => "nl-NL",
4498 PlMinusPl => "pl-PL",
4499 PtMinusPt => "pt-PT",
4500 RoMinusRo => "ro-RO",
4501 SvMinusFi => "sv-FI",
4502 SvMinusSe => "sv-SE",
4503 Unknown(v) => v,
4504 }
4505 }
4506}
4507
4508impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4509 type Err = std::convert::Infallible;
4510 fn from_str(s: &str) -> Result<Self, Self::Err> {
4511 use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
4512 match s {
4513 "cs-CZ" => Ok(CsMinusCz),
4514 "da-DK" => Ok(DaMinusDk),
4515 "de-AT" => Ok(DeMinusAt),
4516 "de-CH" => Ok(DeMinusCh),
4517 "de-DE" => Ok(DeMinusDe),
4518 "el-GR" => Ok(ElMinusGr),
4519 "en-AT" => Ok(EnMinusAt),
4520 "en-AU" => Ok(EnMinusAu),
4521 "en-BE" => Ok(EnMinusBe),
4522 "en-CA" => Ok(EnMinusCa),
4523 "en-CH" => Ok(EnMinusCh),
4524 "en-CZ" => Ok(EnMinusCz),
4525 "en-DE" => Ok(EnMinusDe),
4526 "en-DK" => Ok(EnMinusDk),
4527 "en-ES" => Ok(EnMinusEs),
4528 "en-FI" => Ok(EnMinusFi),
4529 "en-FR" => Ok(EnMinusFr),
4530 "en-GB" => Ok(EnMinusGb),
4531 "en-GR" => Ok(EnMinusGr),
4532 "en-IE" => Ok(EnMinusIe),
4533 "en-IT" => Ok(EnMinusIt),
4534 "en-NL" => Ok(EnMinusNl),
4535 "en-NO" => Ok(EnMinusNo),
4536 "en-NZ" => Ok(EnMinusNz),
4537 "en-PL" => Ok(EnMinusPl),
4538 "en-PT" => Ok(EnMinusPt),
4539 "en-RO" => Ok(EnMinusRo),
4540 "en-SE" => Ok(EnMinusSe),
4541 "en-US" => Ok(EnMinusUs),
4542 "es-ES" => Ok(EsMinusEs),
4543 "es-US" => Ok(EsMinusUs),
4544 "fi-FI" => Ok(FiMinusFi),
4545 "fr-BE" => Ok(FrMinusBe),
4546 "fr-CA" => Ok(FrMinusCa),
4547 "fr-CH" => Ok(FrMinusCh),
4548 "fr-FR" => Ok(FrMinusFr),
4549 "it-CH" => Ok(ItMinusCh),
4550 "it-IT" => Ok(ItMinusIt),
4551 "nb-NO" => Ok(NbMinusNo),
4552 "nl-BE" => Ok(NlMinusBe),
4553 "nl-NL" => Ok(NlMinusNl),
4554 "pl-PL" => Ok(PlMinusPl),
4555 "pt-PT" => Ok(PtMinusPt),
4556 "ro-RO" => Ok(RoMinusRo),
4557 "sv-FI" => Ok(SvMinusFi),
4558 "sv-SE" => Ok(SvMinusSe),
4559 v => {
4560 tracing::warn!(
4561 "Unknown value '{}' for enum '{}'",
4562 v,
4563 "CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
4564 );
4565 Ok(Unknown(v.to_owned()))
4566 }
4567 }
4568 }
4569}
4570impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4571 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4572 f.write_str(self.as_str())
4573 }
4574}
4575
4576#[cfg(not(feature = "redact-generated-debug"))]
4577impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4578 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4579 f.write_str(self.as_str())
4580 }
4581}
4582#[cfg(feature = "redact-generated-debug")]
4583impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4584 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4585 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale))
4586 .finish_non_exhaustive()
4587 }
4588}
4589impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4590 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4591 where
4592 S: serde::Serializer,
4593 {
4594 serializer.serialize_str(self.as_str())
4595 }
4596}
4597#[cfg(feature = "deserialize")]
4598impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
4599 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4600 use std::str::FromStr;
4601 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4602 Ok(Self::from_str(&s).expect("infallible"))
4603 }
4604}
4605#[derive(Clone, Eq, PartialEq)]
4607#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4608#[derive(serde::Serialize)]
4609pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
4610 pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
4612 #[serde(skip_serializing_if = "Option::is_none")]
4615 pub interval_count: Option<u64>,
4616 #[serde(skip_serializing_if = "Option::is_none")]
4618 pub name: Option<String>,
4619 pub next_billing: SubscriptionNextBillingParam,
4621 pub reference: String,
4624}
4625#[cfg(feature = "redact-generated-debug")]
4626impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
4627 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4628 f.debug_struct("CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions")
4629 .finish_non_exhaustive()
4630 }
4631}
4632impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
4633 pub fn new(
4634 interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
4635 next_billing: impl Into<SubscriptionNextBillingParam>,
4636 reference: impl Into<String>,
4637 ) -> Self {
4638 Self {
4639 interval: interval.into(),
4640 interval_count: None,
4641 name: None,
4642 next_billing: next_billing.into(),
4643 reference: reference.into(),
4644 }
4645 }
4646}
4647#[derive(Clone, Eq, PartialEq)]
4649#[non_exhaustive]
4650pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4651 Day,
4652 Month,
4653 Week,
4654 Year,
4655 Unknown(String),
4657}
4658impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4659 pub fn as_str(&self) -> &str {
4660 use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
4661 match self {
4662 Day => "day",
4663 Month => "month",
4664 Week => "week",
4665 Year => "year",
4666 Unknown(v) => v,
4667 }
4668 }
4669}
4670
4671impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4672 type Err = std::convert::Infallible;
4673 fn from_str(s: &str) -> Result<Self, Self::Err> {
4674 use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
4675 match s {
4676 "day" => Ok(Day),
4677 "month" => Ok(Month),
4678 "week" => Ok(Week),
4679 "year" => Ok(Year),
4680 v => {
4681 tracing::warn!(
4682 "Unknown value '{}' for enum '{}'",
4683 v,
4684 "CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
4685 );
4686 Ok(Unknown(v.to_owned()))
4687 }
4688 }
4689 }
4690}
4691impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4692 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4693 f.write_str(self.as_str())
4694 }
4695}
4696
4697#[cfg(not(feature = "redact-generated-debug"))]
4698impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4699 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4700 f.write_str(self.as_str())
4701 }
4702}
4703#[cfg(feature = "redact-generated-debug")]
4704impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4705 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4706 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval))
4707 .finish_non_exhaustive()
4708 }
4709}
4710impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
4711 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4712 where
4713 S: serde::Serializer,
4714 {
4715 serializer.serialize_str(self.as_str())
4716 }
4717}
4718#[cfg(feature = "deserialize")]
4719impl<'de> serde::Deserialize<'de>
4720 for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
4721{
4722 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4723 use std::str::FromStr;
4724 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4725 Ok(Self::from_str(&s).expect("infallible"))
4726 }
4727}
4728#[derive(Clone, Eq, PartialEq)]
4730#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4731#[derive(serde::Serialize)]
4732pub struct CreateSetupIntentPaymentMethodOptionsPayto {
4733 #[serde(skip_serializing_if = "Option::is_none")]
4735 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
4736}
4737#[cfg(feature = "redact-generated-debug")]
4738impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPayto {
4739 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4740 f.debug_struct("CreateSetupIntentPaymentMethodOptionsPayto").finish_non_exhaustive()
4741 }
4742}
4743impl CreateSetupIntentPaymentMethodOptionsPayto {
4744 pub fn new() -> Self {
4745 Self { mandate_options: None }
4746 }
4747}
4748impl Default for CreateSetupIntentPaymentMethodOptionsPayto {
4749 fn default() -> Self {
4750 Self::new()
4751 }
4752}
4753#[derive(Clone, Eq, PartialEq)]
4755#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4756#[derive(serde::Serialize)]
4757pub struct CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4758 #[serde(skip_serializing_if = "Option::is_none")]
4760 pub amount: Option<i64>,
4761 #[serde(skip_serializing_if = "Option::is_none")]
4765 pub amount_type: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
4766 #[serde(skip_serializing_if = "Option::is_none")]
4768 pub end_date: Option<String>,
4769 #[serde(skip_serializing_if = "Option::is_none")]
4771 pub payment_schedule:
4772 Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
4773 #[serde(skip_serializing_if = "Option::is_none")]
4777 pub payments_per_period: Option<i64>,
4778 #[serde(skip_serializing_if = "Option::is_none")]
4780 pub purpose: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
4781 #[serde(skip_serializing_if = "Option::is_none")]
4783 pub start_date: Option<String>,
4784}
4785#[cfg(feature = "redact-generated-debug")]
4786impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4787 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4788 f.debug_struct("CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions")
4789 .finish_non_exhaustive()
4790 }
4791}
4792impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4793 pub fn new() -> Self {
4794 Self {
4795 amount: None,
4796 amount_type: None,
4797 end_date: None,
4798 payment_schedule: None,
4799 payments_per_period: None,
4800 purpose: None,
4801 start_date: None,
4802 }
4803 }
4804}
4805impl Default for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4806 fn default() -> Self {
4807 Self::new()
4808 }
4809}
4810#[derive(Clone, Eq, PartialEq)]
4814#[non_exhaustive]
4815pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4816 Fixed,
4817 Maximum,
4818 Unknown(String),
4820}
4821impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4822 pub fn as_str(&self) -> &str {
4823 use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
4824 match self {
4825 Fixed => "fixed",
4826 Maximum => "maximum",
4827 Unknown(v) => v,
4828 }
4829 }
4830}
4831
4832impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4833 type Err = std::convert::Infallible;
4834 fn from_str(s: &str) -> Result<Self, Self::Err> {
4835 use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
4836 match s {
4837 "fixed" => Ok(Fixed),
4838 "maximum" => Ok(Maximum),
4839 v => {
4840 tracing::warn!(
4841 "Unknown value '{}' for enum '{}'",
4842 v,
4843 "CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
4844 );
4845 Ok(Unknown(v.to_owned()))
4846 }
4847 }
4848 }
4849}
4850impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4851 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4852 f.write_str(self.as_str())
4853 }
4854}
4855
4856#[cfg(not(feature = "redact-generated-debug"))]
4857impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4858 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4859 f.write_str(self.as_str())
4860 }
4861}
4862#[cfg(feature = "redact-generated-debug")]
4863impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4864 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4865 f.debug_struct(stringify!(
4866 CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
4867 ))
4868 .finish_non_exhaustive()
4869 }
4870}
4871impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4872 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4873 where
4874 S: serde::Serializer,
4875 {
4876 serializer.serialize_str(self.as_str())
4877 }
4878}
4879#[cfg(feature = "deserialize")]
4880impl<'de> serde::Deserialize<'de>
4881 for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
4882{
4883 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4884 use std::str::FromStr;
4885 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4886 Ok(Self::from_str(&s).expect("infallible"))
4887 }
4888}
4889#[derive(Clone, Eq, PartialEq)]
4891#[non_exhaustive]
4892pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4893 Adhoc,
4894 Annual,
4895 Daily,
4896 Fortnightly,
4897 Monthly,
4898 Quarterly,
4899 SemiAnnual,
4900 Weekly,
4901 Unknown(String),
4903}
4904impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4905 pub fn as_str(&self) -> &str {
4906 use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
4907 match self {
4908 Adhoc => "adhoc",
4909 Annual => "annual",
4910 Daily => "daily",
4911 Fortnightly => "fortnightly",
4912 Monthly => "monthly",
4913 Quarterly => "quarterly",
4914 SemiAnnual => "semi_annual",
4915 Weekly => "weekly",
4916 Unknown(v) => v,
4917 }
4918 }
4919}
4920
4921impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4922 type Err = std::convert::Infallible;
4923 fn from_str(s: &str) -> Result<Self, Self::Err> {
4924 use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
4925 match s {
4926 "adhoc" => Ok(Adhoc),
4927 "annual" => Ok(Annual),
4928 "daily" => Ok(Daily),
4929 "fortnightly" => Ok(Fortnightly),
4930 "monthly" => Ok(Monthly),
4931 "quarterly" => Ok(Quarterly),
4932 "semi_annual" => Ok(SemiAnnual),
4933 "weekly" => Ok(Weekly),
4934 v => {
4935 tracing::warn!(
4936 "Unknown value '{}' for enum '{}'",
4937 v,
4938 "CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
4939 );
4940 Ok(Unknown(v.to_owned()))
4941 }
4942 }
4943 }
4944}
4945impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4946 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4947 f.write_str(self.as_str())
4948 }
4949}
4950
4951#[cfg(not(feature = "redact-generated-debug"))]
4952impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4953 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4954 f.write_str(self.as_str())
4955 }
4956}
4957#[cfg(feature = "redact-generated-debug")]
4958impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4959 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4960 f.debug_struct(stringify!(
4961 CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
4962 ))
4963 .finish_non_exhaustive()
4964 }
4965}
4966impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4967 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4968 where
4969 S: serde::Serializer,
4970 {
4971 serializer.serialize_str(self.as_str())
4972 }
4973}
4974#[cfg(feature = "deserialize")]
4975impl<'de> serde::Deserialize<'de>
4976 for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
4977{
4978 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4979 use std::str::FromStr;
4980 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4981 Ok(Self::from_str(&s).expect("infallible"))
4982 }
4983}
4984#[derive(Clone, Eq, PartialEq)]
4986#[non_exhaustive]
4987pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4988 DependantSupport,
4989 Government,
4990 Loan,
4991 Mortgage,
4992 Other,
4993 Pension,
4994 Personal,
4995 Retail,
4996 Salary,
4997 Tax,
4998 Utility,
4999 Unknown(String),
5001}
5002impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
5003 pub fn as_str(&self) -> &str {
5004 use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
5005 match self {
5006 DependantSupport => "dependant_support",
5007 Government => "government",
5008 Loan => "loan",
5009 Mortgage => "mortgage",
5010 Other => "other",
5011 Pension => "pension",
5012 Personal => "personal",
5013 Retail => "retail",
5014 Salary => "salary",
5015 Tax => "tax",
5016 Utility => "utility",
5017 Unknown(v) => v,
5018 }
5019 }
5020}
5021
5022impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
5023 type Err = std::convert::Infallible;
5024 fn from_str(s: &str) -> Result<Self, Self::Err> {
5025 use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
5026 match s {
5027 "dependant_support" => Ok(DependantSupport),
5028 "government" => Ok(Government),
5029 "loan" => Ok(Loan),
5030 "mortgage" => Ok(Mortgage),
5031 "other" => Ok(Other),
5032 "pension" => Ok(Pension),
5033 "personal" => Ok(Personal),
5034 "retail" => Ok(Retail),
5035 "salary" => Ok(Salary),
5036 "tax" => Ok(Tax),
5037 "utility" => Ok(Utility),
5038 v => {
5039 tracing::warn!(
5040 "Unknown value '{}' for enum '{}'",
5041 v,
5042 "CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
5043 );
5044 Ok(Unknown(v.to_owned()))
5045 }
5046 }
5047 }
5048}
5049impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
5050 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5051 f.write_str(self.as_str())
5052 }
5053}
5054
5055#[cfg(not(feature = "redact-generated-debug"))]
5056impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
5057 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5058 f.write_str(self.as_str())
5059 }
5060}
5061#[cfg(feature = "redact-generated-debug")]
5062impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
5063 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5064 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose))
5065 .finish_non_exhaustive()
5066 }
5067}
5068impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
5069 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5070 where
5071 S: serde::Serializer,
5072 {
5073 serializer.serialize_str(self.as_str())
5074 }
5075}
5076#[cfg(feature = "deserialize")]
5077impl<'de> serde::Deserialize<'de>
5078 for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
5079{
5080 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5081 use std::str::FromStr;
5082 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5083 Ok(Self::from_str(&s).expect("infallible"))
5084 }
5085}
5086#[derive(Clone, Eq, PartialEq)]
5088#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5089#[derive(serde::Serialize)]
5090pub struct CreateSetupIntentPaymentMethodOptionsPix {
5091 #[serde(skip_serializing_if = "Option::is_none")]
5093 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsPixMandateOptions>,
5094}
5095#[cfg(feature = "redact-generated-debug")]
5096impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPix {
5097 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5098 f.debug_struct("CreateSetupIntentPaymentMethodOptionsPix").finish_non_exhaustive()
5099 }
5100}
5101impl CreateSetupIntentPaymentMethodOptionsPix {
5102 pub fn new() -> Self {
5103 Self { mandate_options: None }
5104 }
5105}
5106impl Default for CreateSetupIntentPaymentMethodOptionsPix {
5107 fn default() -> Self {
5108 Self::new()
5109 }
5110}
5111#[derive(Clone, Eq, PartialEq)]
5113#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5114#[derive(serde::Serialize)]
5115pub struct CreateSetupIntentPaymentMethodOptionsPixMandateOptions {
5116 #[serde(skip_serializing_if = "Option::is_none")]
5120 pub amount: Option<i64>,
5121 #[serde(skip_serializing_if = "Option::is_none")]
5123 pub amount_includes_iof:
5124 Option<CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof>,
5125 #[serde(skip_serializing_if = "Option::is_none")]
5127 pub amount_type: Option<CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType>,
5128 #[serde(skip_serializing_if = "Option::is_none")]
5131 pub currency: Option<stripe_types::Currency>,
5132 #[serde(skip_serializing_if = "Option::is_none")]
5136 pub end_date: Option<String>,
5137 #[serde(skip_serializing_if = "Option::is_none")]
5139 pub payment_schedule:
5140 Option<CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule>,
5141 #[serde(skip_serializing_if = "Option::is_none")]
5143 pub reference: Option<String>,
5144 #[serde(skip_serializing_if = "Option::is_none")]
5148 pub start_date: Option<String>,
5149}
5150#[cfg(feature = "redact-generated-debug")]
5151impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptions {
5152 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5153 f.debug_struct("CreateSetupIntentPaymentMethodOptionsPixMandateOptions")
5154 .finish_non_exhaustive()
5155 }
5156}
5157impl CreateSetupIntentPaymentMethodOptionsPixMandateOptions {
5158 pub fn new() -> Self {
5159 Self {
5160 amount: None,
5161 amount_includes_iof: None,
5162 amount_type: None,
5163 currency: None,
5164 end_date: None,
5165 payment_schedule: None,
5166 reference: None,
5167 start_date: None,
5168 }
5169 }
5170}
5171impl Default for CreateSetupIntentPaymentMethodOptionsPixMandateOptions {
5172 fn default() -> Self {
5173 Self::new()
5174 }
5175}
5176#[derive(Clone, Eq, PartialEq)]
5178#[non_exhaustive]
5179pub enum CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5180 Always,
5181 Never,
5182 Unknown(String),
5184}
5185impl CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5186 pub fn as_str(&self) -> &str {
5187 use CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
5188 match self {
5189 Always => "always",
5190 Never => "never",
5191 Unknown(v) => v,
5192 }
5193 }
5194}
5195
5196impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5197 type Err = std::convert::Infallible;
5198 fn from_str(s: &str) -> Result<Self, Self::Err> {
5199 use CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
5200 match s {
5201 "always" => Ok(Always),
5202 "never" => Ok(Never),
5203 v => {
5204 tracing::warn!(
5205 "Unknown value '{}' for enum '{}'",
5206 v,
5207 "CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof"
5208 );
5209 Ok(Unknown(v.to_owned()))
5210 }
5211 }
5212 }
5213}
5214impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5215 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5216 f.write_str(self.as_str())
5217 }
5218}
5219
5220#[cfg(not(feature = "redact-generated-debug"))]
5221impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5222 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5223 f.write_str(self.as_str())
5224 }
5225}
5226#[cfg(feature = "redact-generated-debug")]
5227impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5228 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5229 f.debug_struct(stringify!(
5230 CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
5231 ))
5232 .finish_non_exhaustive()
5233 }
5234}
5235impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
5236 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5237 where
5238 S: serde::Serializer,
5239 {
5240 serializer.serialize_str(self.as_str())
5241 }
5242}
5243#[cfg(feature = "deserialize")]
5244impl<'de> serde::Deserialize<'de>
5245 for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
5246{
5247 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5248 use std::str::FromStr;
5249 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5250 Ok(Self::from_str(&s).expect("infallible"))
5251 }
5252}
5253#[derive(Clone, Eq, PartialEq)]
5255#[non_exhaustive]
5256pub enum CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5257 Fixed,
5258 Maximum,
5259 Unknown(String),
5261}
5262impl CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5263 pub fn as_str(&self) -> &str {
5264 use CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType::*;
5265 match self {
5266 Fixed => "fixed",
5267 Maximum => "maximum",
5268 Unknown(v) => v,
5269 }
5270 }
5271}
5272
5273impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5274 type Err = std::convert::Infallible;
5275 fn from_str(s: &str) -> Result<Self, Self::Err> {
5276 use CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType::*;
5277 match s {
5278 "fixed" => Ok(Fixed),
5279 "maximum" => Ok(Maximum),
5280 v => {
5281 tracing::warn!(
5282 "Unknown value '{}' for enum '{}'",
5283 v,
5284 "CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType"
5285 );
5286 Ok(Unknown(v.to_owned()))
5287 }
5288 }
5289 }
5290}
5291impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5292 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5293 f.write_str(self.as_str())
5294 }
5295}
5296
5297#[cfg(not(feature = "redact-generated-debug"))]
5298impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5299 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5300 f.write_str(self.as_str())
5301 }
5302}
5303#[cfg(feature = "redact-generated-debug")]
5304impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5305 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5306 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType))
5307 .finish_non_exhaustive()
5308 }
5309}
5310impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
5311 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5312 where
5313 S: serde::Serializer,
5314 {
5315 serializer.serialize_str(self.as_str())
5316 }
5317}
5318#[cfg(feature = "deserialize")]
5319impl<'de> serde::Deserialize<'de>
5320 for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType
5321{
5322 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5323 use std::str::FromStr;
5324 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5325 Ok(Self::from_str(&s).expect("infallible"))
5326 }
5327}
5328#[derive(Clone, Eq, PartialEq)]
5330#[non_exhaustive]
5331pub enum CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5332 Halfyearly,
5333 Monthly,
5334 Quarterly,
5335 Weekly,
5336 Yearly,
5337 Unknown(String),
5339}
5340impl CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5341 pub fn as_str(&self) -> &str {
5342 use CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
5343 match self {
5344 Halfyearly => "halfyearly",
5345 Monthly => "monthly",
5346 Quarterly => "quarterly",
5347 Weekly => "weekly",
5348 Yearly => "yearly",
5349 Unknown(v) => v,
5350 }
5351 }
5352}
5353
5354impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5355 type Err = std::convert::Infallible;
5356 fn from_str(s: &str) -> Result<Self, Self::Err> {
5357 use CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
5358 match s {
5359 "halfyearly" => Ok(Halfyearly),
5360 "monthly" => Ok(Monthly),
5361 "quarterly" => Ok(Quarterly),
5362 "weekly" => Ok(Weekly),
5363 "yearly" => Ok(Yearly),
5364 v => {
5365 tracing::warn!(
5366 "Unknown value '{}' for enum '{}'",
5367 v,
5368 "CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule"
5369 );
5370 Ok(Unknown(v.to_owned()))
5371 }
5372 }
5373 }
5374}
5375impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5376 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5377 f.write_str(self.as_str())
5378 }
5379}
5380
5381#[cfg(not(feature = "redact-generated-debug"))]
5382impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5383 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5384 f.write_str(self.as_str())
5385 }
5386}
5387#[cfg(feature = "redact-generated-debug")]
5388impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5389 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5390 f.debug_struct(stringify!(
5391 CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule
5392 ))
5393 .finish_non_exhaustive()
5394 }
5395}
5396impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
5397 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5398 where
5399 S: serde::Serializer,
5400 {
5401 serializer.serialize_str(self.as_str())
5402 }
5403}
5404#[cfg(feature = "deserialize")]
5405impl<'de> serde::Deserialize<'de>
5406 for CreateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule
5407{
5408 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5409 use std::str::FromStr;
5410 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5411 Ok(Self::from_str(&s).expect("infallible"))
5412 }
5413}
5414#[derive(Clone, Eq, PartialEq)]
5416#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5417#[derive(serde::Serialize)]
5418pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
5419 #[serde(skip_serializing_if = "Option::is_none")]
5421 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
5422}
5423#[cfg(feature = "redact-generated-debug")]
5424impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsSepaDebit {
5425 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5426 f.debug_struct("CreateSetupIntentPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
5427 }
5428}
5429impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
5430 pub fn new() -> Self {
5431 Self { mandate_options: None }
5432 }
5433}
5434impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
5435 fn default() -> Self {
5436 Self::new()
5437 }
5438}
5439#[derive(Clone, Eq, PartialEq)]
5441#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5442#[derive(serde::Serialize)]
5443pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
5444 #[serde(skip_serializing_if = "Option::is_none")]
5449 pub reference_prefix: Option<String>,
5450}
5451#[cfg(feature = "redact-generated-debug")]
5452impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
5453 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5454 f.debug_struct("CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions")
5455 .finish_non_exhaustive()
5456 }
5457}
5458impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
5459 pub fn new() -> Self {
5460 Self { reference_prefix: None }
5461 }
5462}
5463impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
5464 fn default() -> Self {
5465 Self::new()
5466 }
5467}
5468#[derive(Clone, Eq, PartialEq)]
5470#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5471#[derive(serde::Serialize)]
5472pub struct CreateSetupIntentPaymentMethodOptionsUpi {
5473 #[serde(skip_serializing_if = "Option::is_none")]
5475 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUpiMandateOptions>,
5476 #[serde(skip_serializing_if = "Option::is_none")]
5477 pub setup_future_usage: Option<CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage>,
5478}
5479#[cfg(feature = "redact-generated-debug")]
5480impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpi {
5481 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5482 f.debug_struct("CreateSetupIntentPaymentMethodOptionsUpi").finish_non_exhaustive()
5483 }
5484}
5485impl CreateSetupIntentPaymentMethodOptionsUpi {
5486 pub fn new() -> Self {
5487 Self { mandate_options: None, setup_future_usage: None }
5488 }
5489}
5490impl Default for CreateSetupIntentPaymentMethodOptionsUpi {
5491 fn default() -> Self {
5492 Self::new()
5493 }
5494}
5495#[derive(Clone, Eq, PartialEq)]
5497#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5498#[derive(serde::Serialize)]
5499pub struct CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
5500 #[serde(skip_serializing_if = "Option::is_none")]
5502 pub amount: Option<i64>,
5503 #[serde(skip_serializing_if = "Option::is_none")]
5507 pub amount_type: Option<CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType>,
5508 #[serde(skip_serializing_if = "Option::is_none")]
5510 pub description: Option<String>,
5511 #[serde(skip_serializing_if = "Option::is_none")]
5513 pub end_date: Option<stripe_types::Timestamp>,
5514}
5515#[cfg(feature = "redact-generated-debug")]
5516impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
5517 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5518 f.debug_struct("CreateSetupIntentPaymentMethodOptionsUpiMandateOptions")
5519 .finish_non_exhaustive()
5520 }
5521}
5522impl CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
5523 pub fn new() -> Self {
5524 Self { amount: None, amount_type: None, description: None, end_date: None }
5525 }
5526}
5527impl Default for CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
5528 fn default() -> Self {
5529 Self::new()
5530 }
5531}
5532#[derive(Clone, Eq, PartialEq)]
5536#[non_exhaustive]
5537pub enum CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5538 Fixed,
5539 Maximum,
5540 Unknown(String),
5542}
5543impl CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5544 pub fn as_str(&self) -> &str {
5545 use CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
5546 match self {
5547 Fixed => "fixed",
5548 Maximum => "maximum",
5549 Unknown(v) => v,
5550 }
5551 }
5552}
5553
5554impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5555 type Err = std::convert::Infallible;
5556 fn from_str(s: &str) -> Result<Self, Self::Err> {
5557 use CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
5558 match s {
5559 "fixed" => Ok(Fixed),
5560 "maximum" => Ok(Maximum),
5561 v => {
5562 tracing::warn!(
5563 "Unknown value '{}' for enum '{}'",
5564 v,
5565 "CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType"
5566 );
5567 Ok(Unknown(v.to_owned()))
5568 }
5569 }
5570 }
5571}
5572impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5573 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5574 f.write_str(self.as_str())
5575 }
5576}
5577
5578#[cfg(not(feature = "redact-generated-debug"))]
5579impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5580 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5581 f.write_str(self.as_str())
5582 }
5583}
5584#[cfg(feature = "redact-generated-debug")]
5585impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5586 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5587 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType))
5588 .finish_non_exhaustive()
5589 }
5590}
5591impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
5592 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5593 where
5594 S: serde::Serializer,
5595 {
5596 serializer.serialize_str(self.as_str())
5597 }
5598}
5599#[cfg(feature = "deserialize")]
5600impl<'de> serde::Deserialize<'de>
5601 for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
5602{
5603 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5604 use std::str::FromStr;
5605 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5606 Ok(Self::from_str(&s).expect("infallible"))
5607 }
5608}
5609#[derive(Clone, Eq, PartialEq)]
5610#[non_exhaustive]
5611pub enum CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5612 None,
5613 OffSession,
5614 OnSession,
5615 Unknown(String),
5617}
5618impl CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5619 pub fn as_str(&self) -> &str {
5620 use CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
5621 match self {
5622 None => "none",
5623 OffSession => "off_session",
5624 OnSession => "on_session",
5625 Unknown(v) => v,
5626 }
5627 }
5628}
5629
5630impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5631 type Err = std::convert::Infallible;
5632 fn from_str(s: &str) -> Result<Self, Self::Err> {
5633 use CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
5634 match s {
5635 "none" => Ok(None),
5636 "off_session" => Ok(OffSession),
5637 "on_session" => Ok(OnSession),
5638 v => {
5639 tracing::warn!(
5640 "Unknown value '{}' for enum '{}'",
5641 v,
5642 "CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage"
5643 );
5644 Ok(Unknown(v.to_owned()))
5645 }
5646 }
5647 }
5648}
5649impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5650 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5651 f.write_str(self.as_str())
5652 }
5653}
5654
5655#[cfg(not(feature = "redact-generated-debug"))]
5656impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5657 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5658 f.write_str(self.as_str())
5659 }
5660}
5661#[cfg(feature = "redact-generated-debug")]
5662impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5663 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5664 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage))
5665 .finish_non_exhaustive()
5666 }
5667}
5668impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5669 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5670 where
5671 S: serde::Serializer,
5672 {
5673 serializer.serialize_str(self.as_str())
5674 }
5675}
5676#[cfg(feature = "deserialize")]
5677impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
5678 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5679 use std::str::FromStr;
5680 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5681 Ok(Self::from_str(&s).expect("infallible"))
5682 }
5683}
5684#[derive(Clone, Eq, PartialEq)]
5686#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5687#[derive(serde::Serialize)]
5688pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
5689 #[serde(skip_serializing_if = "Option::is_none")]
5691 pub financial_connections:
5692 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
5693 #[serde(skip_serializing_if = "Option::is_none")]
5695 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
5696 #[serde(skip_serializing_if = "Option::is_none")]
5698 pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
5699 #[serde(skip_serializing_if = "Option::is_none")]
5701 pub verification_method:
5702 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
5703}
5704#[cfg(feature = "redact-generated-debug")]
5705impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
5706 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5707 f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccount").finish_non_exhaustive()
5708 }
5709}
5710impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
5711 pub fn new() -> Self {
5712 Self {
5713 financial_connections: None,
5714 mandate_options: None,
5715 networks: None,
5716 verification_method: None,
5717 }
5718 }
5719}
5720impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
5721 fn default() -> Self {
5722 Self::new()
5723 }
5724}
5725#[derive(Clone, Eq, PartialEq)]
5727#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5728#[derive(serde::Serialize)]
5729pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
5730 #[serde(skip_serializing_if = "Option::is_none")]
5732 pub filters:
5733 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
5734 #[serde(skip_serializing_if = "Option::is_none")]
5738 pub permissions: Option<
5739 Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
5740 >,
5741 #[serde(skip_serializing_if = "Option::is_none")]
5743 pub prefetch:
5744 Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
5745 #[serde(skip_serializing_if = "Option::is_none")]
5748 pub return_url: Option<String>,
5749}
5750#[cfg(feature = "redact-generated-debug")]
5751impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
5752 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5753 f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections")
5754 .finish_non_exhaustive()
5755 }
5756}
5757impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
5758 pub fn new() -> Self {
5759 Self { filters: None, permissions: None, prefetch: None, return_url: None }
5760 }
5761}
5762impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
5763 fn default() -> Self {
5764 Self::new()
5765 }
5766}
5767#[derive(Clone, Eq, PartialEq)]
5769#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5770#[derive(serde::Serialize)]
5771pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
5772 #[serde(skip_serializing_if = "Option::is_none")]
5775pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
5776
5777}
5778#[cfg(feature = "redact-generated-debug")]
5779impl std::fmt::Debug
5780 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
5781{
5782 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5783 f.debug_struct(
5784 "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters",
5785 )
5786 .finish_non_exhaustive()
5787 }
5788}
5789impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
5790 pub fn new() -> Self {
5791 Self { account_subcategories: None }
5792 }
5793}
5794impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
5795 fn default() -> Self {
5796 Self::new()
5797 }
5798}
5799#[derive(Clone, Eq, PartialEq)]
5802#[non_exhaustive]
5803pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
5804{
5805 Checking,
5806 Savings,
5807 Unknown(String),
5809}
5810impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5811 pub fn as_str(&self) -> &str {
5812 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
5813 match self {
5814Checking => "checking",
5815Savings => "savings",
5816Unknown(v) => v,
5817
5818 }
5819 }
5820}
5821
5822impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5823 type Err = std::convert::Infallible;
5824 fn from_str(s: &str) -> Result<Self, Self::Err> {
5825 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
5826 match s {
5827 "checking" => Ok(Checking),
5828"savings" => Ok(Savings),
5829v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
5830
5831 }
5832 }
5833}
5834impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5835 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5836 f.write_str(self.as_str())
5837 }
5838}
5839
5840#[cfg(not(feature = "redact-generated-debug"))]
5841impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5842 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5843 f.write_str(self.as_str())
5844 }
5845}
5846#[cfg(feature = "redact-generated-debug")]
5847impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5848 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5849 f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories)).finish_non_exhaustive()
5850 }
5851}
5852impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5853 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
5854 serializer.serialize_str(self.as_str())
5855 }
5856}
5857#[cfg(feature = "deserialize")]
5858impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
5859 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5860 use std::str::FromStr;
5861 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5862 Ok(Self::from_str(&s).expect("infallible"))
5863 }
5864}
5865#[derive(Clone, Eq, PartialEq)]
5869#[non_exhaustive]
5870pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
5871 Balances,
5872 Ownership,
5873 PaymentMethod,
5874 Transactions,
5875 Unknown(String),
5877}
5878impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
5879 pub fn as_str(&self) -> &str {
5880 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
5881 match self {
5882 Balances => "balances",
5883 Ownership => "ownership",
5884 PaymentMethod => "payment_method",
5885 Transactions => "transactions",
5886 Unknown(v) => v,
5887 }
5888 }
5889}
5890
5891impl std::str::FromStr
5892 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5893{
5894 type Err = std::convert::Infallible;
5895 fn from_str(s: &str) -> Result<Self, Self::Err> {
5896 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
5897 match s {
5898 "balances" => Ok(Balances),
5899 "ownership" => Ok(Ownership),
5900 "payment_method" => Ok(PaymentMethod),
5901 "transactions" => Ok(Transactions),
5902 v => {
5903 tracing::warn!(
5904 "Unknown value '{}' for enum '{}'",
5905 v,
5906 "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
5907 );
5908 Ok(Unknown(v.to_owned()))
5909 }
5910 }
5911 }
5912}
5913impl std::fmt::Display
5914 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5915{
5916 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5917 f.write_str(self.as_str())
5918 }
5919}
5920
5921#[cfg(not(feature = "redact-generated-debug"))]
5922impl std::fmt::Debug
5923 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5924{
5925 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5926 f.write_str(self.as_str())
5927 }
5928}
5929#[cfg(feature = "redact-generated-debug")]
5930impl std::fmt::Debug
5931 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5932{
5933 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5934 f.debug_struct(stringify!(
5935 CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5936 ))
5937 .finish_non_exhaustive()
5938 }
5939}
5940impl serde::Serialize
5941 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5942{
5943 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5944 where
5945 S: serde::Serializer,
5946 {
5947 serializer.serialize_str(self.as_str())
5948 }
5949}
5950#[cfg(feature = "deserialize")]
5951impl<'de> serde::Deserialize<'de>
5952 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
5953{
5954 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5955 use std::str::FromStr;
5956 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5957 Ok(Self::from_str(&s).expect("infallible"))
5958 }
5959}
5960#[derive(Clone, Eq, PartialEq)]
5962#[non_exhaustive]
5963pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
5964 Balances,
5965 Ownership,
5966 Transactions,
5967 Unknown(String),
5969}
5970impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
5971 pub fn as_str(&self) -> &str {
5972 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
5973 match self {
5974 Balances => "balances",
5975 Ownership => "ownership",
5976 Transactions => "transactions",
5977 Unknown(v) => v,
5978 }
5979 }
5980}
5981
5982impl std::str::FromStr
5983 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
5984{
5985 type Err = std::convert::Infallible;
5986 fn from_str(s: &str) -> Result<Self, Self::Err> {
5987 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
5988 match s {
5989 "balances" => Ok(Balances),
5990 "ownership" => Ok(Ownership),
5991 "transactions" => Ok(Transactions),
5992 v => {
5993 tracing::warn!(
5994 "Unknown value '{}' for enum '{}'",
5995 v,
5996 "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
5997 );
5998 Ok(Unknown(v.to_owned()))
5999 }
6000 }
6001 }
6002}
6003impl std::fmt::Display
6004 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
6005{
6006 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6007 f.write_str(self.as_str())
6008 }
6009}
6010
6011#[cfg(not(feature = "redact-generated-debug"))]
6012impl std::fmt::Debug
6013 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
6014{
6015 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6016 f.write_str(self.as_str())
6017 }
6018}
6019#[cfg(feature = "redact-generated-debug")]
6020impl std::fmt::Debug
6021 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
6022{
6023 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6024 f.debug_struct(stringify!(
6025 CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
6026 ))
6027 .finish_non_exhaustive()
6028 }
6029}
6030impl serde::Serialize
6031 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
6032{
6033 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6034 where
6035 S: serde::Serializer,
6036 {
6037 serializer.serialize_str(self.as_str())
6038 }
6039}
6040#[cfg(feature = "deserialize")]
6041impl<'de> serde::Deserialize<'de>
6042 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
6043{
6044 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6045 use std::str::FromStr;
6046 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6047 Ok(Self::from_str(&s).expect("infallible"))
6048 }
6049}
6050#[derive(Clone, Eq, PartialEq)]
6052#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6053#[derive(serde::Serialize)]
6054pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
6055 #[serde(skip_serializing_if = "Option::is_none")]
6057 pub collection_method:
6058 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
6059}
6060#[cfg(feature = "redact-generated-debug")]
6061impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
6062 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6063 f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions")
6064 .finish_non_exhaustive()
6065 }
6066}
6067impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
6068 pub fn new() -> Self {
6069 Self { collection_method: None }
6070 }
6071}
6072impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
6073 fn default() -> Self {
6074 Self::new()
6075 }
6076}
6077#[derive(Clone, Eq, PartialEq)]
6079#[non_exhaustive]
6080pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
6081 Paper,
6082 Unknown(String),
6084}
6085impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
6086 pub fn as_str(&self) -> &str {
6087 use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
6088 match self {
6089 Paper => "paper",
6090 Unknown(v) => v,
6091 }
6092 }
6093}
6094
6095impl std::str::FromStr
6096 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6097{
6098 type Err = std::convert::Infallible;
6099 fn from_str(s: &str) -> Result<Self, Self::Err> {
6100 use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
6101 match s {
6102 "paper" => Ok(Paper),
6103 v => {
6104 tracing::warn!(
6105 "Unknown value '{}' for enum '{}'",
6106 v,
6107 "CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
6108 );
6109 Ok(Unknown(v.to_owned()))
6110 }
6111 }
6112 }
6113}
6114impl std::fmt::Display
6115 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6116{
6117 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6118 f.write_str(self.as_str())
6119 }
6120}
6121
6122#[cfg(not(feature = "redact-generated-debug"))]
6123impl std::fmt::Debug
6124 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6125{
6126 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6127 f.write_str(self.as_str())
6128 }
6129}
6130#[cfg(feature = "redact-generated-debug")]
6131impl std::fmt::Debug
6132 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6133{
6134 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6135 f.debug_struct(stringify!(
6136 CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6137 ))
6138 .finish_non_exhaustive()
6139 }
6140}
6141impl serde::Serialize
6142 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6143{
6144 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6145 where
6146 S: serde::Serializer,
6147 {
6148 serializer.serialize_str(self.as_str())
6149 }
6150}
6151#[cfg(feature = "deserialize")]
6152impl<'de> serde::Deserialize<'de>
6153 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
6154{
6155 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6156 use std::str::FromStr;
6157 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6158 Ok(Self::from_str(&s).expect("infallible"))
6159 }
6160}
6161#[derive(Clone, Eq, PartialEq)]
6163#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6164#[derive(serde::Serialize)]
6165pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
6166 #[serde(skip_serializing_if = "Option::is_none")]
6168 pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
6169}
6170#[cfg(feature = "redact-generated-debug")]
6171impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
6172 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6173 f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks")
6174 .finish_non_exhaustive()
6175 }
6176}
6177impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
6178 pub fn new() -> Self {
6179 Self { requested: None }
6180 }
6181}
6182impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
6183 fn default() -> Self {
6184 Self::new()
6185 }
6186}
6187#[derive(Clone, Eq, PartialEq)]
6189#[non_exhaustive]
6190pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6191 Ach,
6192 UsDomesticWire,
6193 Unknown(String),
6195}
6196impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6197 pub fn as_str(&self) -> &str {
6198 use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
6199 match self {
6200 Ach => "ach",
6201 UsDomesticWire => "us_domestic_wire",
6202 Unknown(v) => v,
6203 }
6204 }
6205}
6206
6207impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6208 type Err = std::convert::Infallible;
6209 fn from_str(s: &str) -> Result<Self, Self::Err> {
6210 use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
6211 match s {
6212 "ach" => Ok(Ach),
6213 "us_domestic_wire" => Ok(UsDomesticWire),
6214 v => {
6215 tracing::warn!(
6216 "Unknown value '{}' for enum '{}'",
6217 v,
6218 "CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
6219 );
6220 Ok(Unknown(v.to_owned()))
6221 }
6222 }
6223 }
6224}
6225impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6226 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6227 f.write_str(self.as_str())
6228 }
6229}
6230
6231#[cfg(not(feature = "redact-generated-debug"))]
6232impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6233 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6234 f.write_str(self.as_str())
6235 }
6236}
6237#[cfg(feature = "redact-generated-debug")]
6238impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6239 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6240 f.debug_struct(stringify!(
6241 CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
6242 ))
6243 .finish_non_exhaustive()
6244 }
6245}
6246impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
6247 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6248 where
6249 S: serde::Serializer,
6250 {
6251 serializer.serialize_str(self.as_str())
6252 }
6253}
6254#[cfg(feature = "deserialize")]
6255impl<'de> serde::Deserialize<'de>
6256 for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
6257{
6258 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6259 use std::str::FromStr;
6260 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6261 Ok(Self::from_str(&s).expect("infallible"))
6262 }
6263}
6264#[derive(Clone, Eq, PartialEq)]
6266#[non_exhaustive]
6267pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6268 Automatic,
6269 Instant,
6270 Microdeposits,
6271 Unknown(String),
6273}
6274impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6275 pub fn as_str(&self) -> &str {
6276 use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
6277 match self {
6278 Automatic => "automatic",
6279 Instant => "instant",
6280 Microdeposits => "microdeposits",
6281 Unknown(v) => v,
6282 }
6283 }
6284}
6285
6286impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6287 type Err = std::convert::Infallible;
6288 fn from_str(s: &str) -> Result<Self, Self::Err> {
6289 use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
6290 match s {
6291 "automatic" => Ok(Automatic),
6292 "instant" => Ok(Instant),
6293 "microdeposits" => Ok(Microdeposits),
6294 v => {
6295 tracing::warn!(
6296 "Unknown value '{}' for enum '{}'",
6297 v,
6298 "CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
6299 );
6300 Ok(Unknown(v.to_owned()))
6301 }
6302 }
6303 }
6304}
6305impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6306 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6307 f.write_str(self.as_str())
6308 }
6309}
6310
6311#[cfg(not(feature = "redact-generated-debug"))]
6312impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6313 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6314 f.write_str(self.as_str())
6315 }
6316}
6317#[cfg(feature = "redact-generated-debug")]
6318impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6319 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6320 f.debug_struct(stringify!(
6321 CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
6322 ))
6323 .finish_non_exhaustive()
6324 }
6325}
6326impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
6327 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6328 where
6329 S: serde::Serializer,
6330 {
6331 serializer.serialize_str(self.as_str())
6332 }
6333}
6334#[cfg(feature = "deserialize")]
6335impl<'de> serde::Deserialize<'de>
6336 for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
6337{
6338 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6339 use std::str::FromStr;
6340 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6341 Ok(Self::from_str(&s).expect("infallible"))
6342 }
6343}
6344#[derive(Clone, Eq, PartialEq)]
6348#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6349#[derive(serde::Serialize)]
6350pub struct CreateSetupIntentSingleUse {
6351 pub amount: i64,
6356 pub currency: stripe_types::Currency,
6359}
6360#[cfg(feature = "redact-generated-debug")]
6361impl std::fmt::Debug for CreateSetupIntentSingleUse {
6362 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6363 f.debug_struct("CreateSetupIntentSingleUse").finish_non_exhaustive()
6364 }
6365}
6366impl CreateSetupIntentSingleUse {
6367 pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
6368 Self { amount: amount.into(), currency: currency.into() }
6369 }
6370}
6371#[derive(Clone, Eq, PartialEq)]
6374#[non_exhaustive]
6375pub enum CreateSetupIntentUsage {
6376 OffSession,
6377 OnSession,
6378 Unknown(String),
6380}
6381impl CreateSetupIntentUsage {
6382 pub fn as_str(&self) -> &str {
6383 use CreateSetupIntentUsage::*;
6384 match self {
6385 OffSession => "off_session",
6386 OnSession => "on_session",
6387 Unknown(v) => v,
6388 }
6389 }
6390}
6391
6392impl std::str::FromStr for CreateSetupIntentUsage {
6393 type Err = std::convert::Infallible;
6394 fn from_str(s: &str) -> Result<Self, Self::Err> {
6395 use CreateSetupIntentUsage::*;
6396 match s {
6397 "off_session" => Ok(OffSession),
6398 "on_session" => Ok(OnSession),
6399 v => {
6400 tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentUsage");
6401 Ok(Unknown(v.to_owned()))
6402 }
6403 }
6404 }
6405}
6406impl std::fmt::Display for CreateSetupIntentUsage {
6407 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6408 f.write_str(self.as_str())
6409 }
6410}
6411
6412#[cfg(not(feature = "redact-generated-debug"))]
6413impl std::fmt::Debug for CreateSetupIntentUsage {
6414 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6415 f.write_str(self.as_str())
6416 }
6417}
6418#[cfg(feature = "redact-generated-debug")]
6419impl std::fmt::Debug for CreateSetupIntentUsage {
6420 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6421 f.debug_struct(stringify!(CreateSetupIntentUsage)).finish_non_exhaustive()
6422 }
6423}
6424impl serde::Serialize for CreateSetupIntentUsage {
6425 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6426 where
6427 S: serde::Serializer,
6428 {
6429 serializer.serialize_str(self.as_str())
6430 }
6431}
6432#[cfg(feature = "deserialize")]
6433impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
6434 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6435 use std::str::FromStr;
6436 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6437 Ok(Self::from_str(&s).expect("infallible"))
6438 }
6439}
6440#[derive(Clone)]
6445#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6446#[derive(serde::Serialize)]
6447pub struct CreateSetupIntent {
6448 inner: CreateSetupIntentBuilder,
6449}
6450#[cfg(feature = "redact-generated-debug")]
6451impl std::fmt::Debug for CreateSetupIntent {
6452 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6453 f.debug_struct("CreateSetupIntent").finish_non_exhaustive()
6454 }
6455}
6456impl CreateSetupIntent {
6457 pub fn new() -> Self {
6459 Self { inner: CreateSetupIntentBuilder::new() }
6460 }
6461 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
6466 self.inner.attach_to_self = Some(attach_to_self.into());
6467 self
6468 }
6469 pub fn automatic_payment_methods(
6471 mut self,
6472 automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
6473 ) -> Self {
6474 self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
6475 self
6476 }
6477 pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
6481 self.inner.confirm = Some(confirm.into());
6482 self
6483 }
6484 pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
6488 self.inner.confirmation_token = Some(confirmation_token.into());
6489 self
6490 }
6491 pub fn customer(mut self, customer: impl Into<String>) -> Self {
6496 self.inner.customer = Some(customer.into());
6497 self
6498 }
6499 pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
6504 self.inner.customer_account = Some(customer_account.into());
6505 self
6506 }
6507 pub fn description(mut self, description: impl Into<String>) -> Self {
6509 self.inner.description = Some(description.into());
6510 self
6511 }
6512 pub fn excluded_payment_method_types(
6514 mut self,
6515 excluded_payment_method_types: impl Into<
6516 Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
6517 >,
6518 ) -> Self {
6519 self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
6520 self
6521 }
6522 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
6524 self.inner.expand = Some(expand.into());
6525 self
6526 }
6527 pub fn flow_directions(
6533 mut self,
6534 flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
6535 ) -> Self {
6536 self.inner.flow_directions = Some(flow_directions.into());
6537 self
6538 }
6539 pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
6542 self.inner.mandate_data = Some(mandate_data.into());
6543 self
6544 }
6545 pub fn metadata(
6550 mut self,
6551 metadata: impl Into<std::collections::HashMap<String, String>>,
6552 ) -> Self {
6553 self.inner.metadata = Some(metadata.into());
6554 self
6555 }
6556 pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
6558 self.inner.on_behalf_of = Some(on_behalf_of.into());
6559 self
6560 }
6561 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
6563 self.inner.payment_method = Some(payment_method.into());
6564 self
6565 }
6566 pub fn payment_method_configuration(
6568 mut self,
6569 payment_method_configuration: impl Into<String>,
6570 ) -> Self {
6571 self.inner.payment_method_configuration = Some(payment_method_configuration.into());
6572 self
6573 }
6574 pub fn payment_method_data(
6577 mut self,
6578 payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
6579 ) -> Self {
6580 self.inner.payment_method_data = Some(payment_method_data.into());
6581 self
6582 }
6583 pub fn payment_method_options(
6585 mut self,
6586 payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
6587 ) -> Self {
6588 self.inner.payment_method_options = Some(payment_method_options.into());
6589 self
6590 }
6591 pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
6595 self.inner.payment_method_types = Some(payment_method_types.into());
6596 self
6597 }
6598 pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
6602 self.inner.return_url = Some(return_url.into());
6603 self
6604 }
6605 pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
6609 self.inner.single_use = Some(single_use.into());
6610 self
6611 }
6612 pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
6615 self.inner.usage = Some(usage.into());
6616 self
6617 }
6618 pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
6620 self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
6621 self
6622 }
6623}
6624impl Default for CreateSetupIntent {
6625 fn default() -> Self {
6626 Self::new()
6627 }
6628}
6629impl CreateSetupIntent {
6630 pub async fn send<C: StripeClient>(
6632 &self,
6633 client: &C,
6634 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
6635 self.customize().send(client).await
6636 }
6637
6638 pub fn send_blocking<C: StripeBlockingClient>(
6640 &self,
6641 client: &C,
6642 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
6643 self.customize().send_blocking(client)
6644 }
6645}
6646
6647impl StripeRequest for CreateSetupIntent {
6648 type Output = stripe_shared::SetupIntent;
6649
6650 fn build(&self) -> RequestBuilder {
6651 RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
6652 }
6653}
6654#[derive(Clone)]
6655#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6656#[derive(serde::Serialize)]
6657struct UpdateSetupIntentBuilder {
6658 #[serde(skip_serializing_if = "Option::is_none")]
6659 attach_to_self: Option<bool>,
6660 #[serde(skip_serializing_if = "Option::is_none")]
6661 customer: Option<String>,
6662 #[serde(skip_serializing_if = "Option::is_none")]
6663 customer_account: Option<String>,
6664 #[serde(skip_serializing_if = "Option::is_none")]
6665 description: Option<String>,
6666 #[serde(skip_serializing_if = "Option::is_none")]
6667 excluded_payment_method_types:
6668 Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
6669 #[serde(skip_serializing_if = "Option::is_none")]
6670 expand: Option<Vec<String>>,
6671 #[serde(skip_serializing_if = "Option::is_none")]
6672 flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
6673 #[serde(skip_serializing_if = "Option::is_none")]
6674 metadata: Option<std::collections::HashMap<String, String>>,
6675 #[serde(skip_serializing_if = "Option::is_none")]
6676 payment_method: Option<String>,
6677 #[serde(skip_serializing_if = "Option::is_none")]
6678 payment_method_configuration: Option<String>,
6679 #[serde(skip_serializing_if = "Option::is_none")]
6680 payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
6681 #[serde(skip_serializing_if = "Option::is_none")]
6682 payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
6683 #[serde(skip_serializing_if = "Option::is_none")]
6684 payment_method_types: Option<Vec<String>>,
6685}
6686#[cfg(feature = "redact-generated-debug")]
6687impl std::fmt::Debug for UpdateSetupIntentBuilder {
6688 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6689 f.debug_struct("UpdateSetupIntentBuilder").finish_non_exhaustive()
6690 }
6691}
6692impl UpdateSetupIntentBuilder {
6693 fn new() -> Self {
6694 Self {
6695 attach_to_self: None,
6696 customer: None,
6697 customer_account: None,
6698 description: None,
6699 excluded_payment_method_types: None,
6700 expand: None,
6701 flow_directions: None,
6702 metadata: None,
6703 payment_method: None,
6704 payment_method_configuration: None,
6705 payment_method_data: None,
6706 payment_method_options: None,
6707 payment_method_types: None,
6708 }
6709 }
6710}
6711#[derive(Clone)]
6714#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6715#[derive(serde::Serialize)]
6716pub struct UpdateSetupIntentPaymentMethodData {
6717 #[serde(skip_serializing_if = "Option::is_none")]
6719 pub acss_debit: Option<PaymentMethodParam>,
6720 #[serde(skip_serializing_if = "Option::is_none")]
6722 #[serde(with = "stripe_types::with_serde_json_opt")]
6723 pub affirm: Option<miniserde::json::Value>,
6724 #[serde(skip_serializing_if = "Option::is_none")]
6726 #[serde(with = "stripe_types::with_serde_json_opt")]
6727 pub afterpay_clearpay: Option<miniserde::json::Value>,
6728 #[serde(skip_serializing_if = "Option::is_none")]
6730 #[serde(with = "stripe_types::with_serde_json_opt")]
6731 pub alipay: Option<miniserde::json::Value>,
6732 #[serde(skip_serializing_if = "Option::is_none")]
6736 pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
6737 #[serde(skip_serializing_if = "Option::is_none")]
6739 #[serde(with = "stripe_types::with_serde_json_opt")]
6740 pub alma: Option<miniserde::json::Value>,
6741 #[serde(skip_serializing_if = "Option::is_none")]
6743 #[serde(with = "stripe_types::with_serde_json_opt")]
6744 pub amazon_pay: Option<miniserde::json::Value>,
6745 #[serde(skip_serializing_if = "Option::is_none")]
6747 pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
6748 #[serde(skip_serializing_if = "Option::is_none")]
6750 pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
6751 #[serde(skip_serializing_if = "Option::is_none")]
6753 #[serde(with = "stripe_types::with_serde_json_opt")]
6754 pub bancontact: Option<miniserde::json::Value>,
6755 #[serde(skip_serializing_if = "Option::is_none")]
6757 #[serde(with = "stripe_types::with_serde_json_opt")]
6758 pub billie: Option<miniserde::json::Value>,
6759 #[serde(skip_serializing_if = "Option::is_none")]
6761 pub billing_details: Option<BillingDetailsInnerParams>,
6762 #[serde(skip_serializing_if = "Option::is_none")]
6764 #[serde(with = "stripe_types::with_serde_json_opt")]
6765 pub blik: Option<miniserde::json::Value>,
6766 #[serde(skip_serializing_if = "Option::is_none")]
6768 pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
6769 #[serde(skip_serializing_if = "Option::is_none")]
6771 #[serde(with = "stripe_types::with_serde_json_opt")]
6772 pub cashapp: Option<miniserde::json::Value>,
6773 #[serde(skip_serializing_if = "Option::is_none")]
6775 #[serde(with = "stripe_types::with_serde_json_opt")]
6776 pub crypto: Option<miniserde::json::Value>,
6777 #[serde(skip_serializing_if = "Option::is_none")]
6779 #[serde(with = "stripe_types::with_serde_json_opt")]
6780 pub customer_balance: Option<miniserde::json::Value>,
6781 #[serde(skip_serializing_if = "Option::is_none")]
6783 pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
6784 #[serde(skip_serializing_if = "Option::is_none")]
6786 pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
6787 #[serde(skip_serializing_if = "Option::is_none")]
6789 #[serde(with = "stripe_types::with_serde_json_opt")]
6790 pub giropay: Option<miniserde::json::Value>,
6791 #[serde(skip_serializing_if = "Option::is_none")]
6793 #[serde(with = "stripe_types::with_serde_json_opt")]
6794 pub grabpay: Option<miniserde::json::Value>,
6795 #[serde(skip_serializing_if = "Option::is_none")]
6797 pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
6798 #[serde(skip_serializing_if = "Option::is_none")]
6800 #[serde(with = "stripe_types::with_serde_json_opt")]
6801 pub interac_present: Option<miniserde::json::Value>,
6802 #[serde(skip_serializing_if = "Option::is_none")]
6804 #[serde(with = "stripe_types::with_serde_json_opt")]
6805 pub kakao_pay: Option<miniserde::json::Value>,
6806 #[serde(skip_serializing_if = "Option::is_none")]
6808 pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
6809 #[serde(skip_serializing_if = "Option::is_none")]
6811 #[serde(with = "stripe_types::with_serde_json_opt")]
6812 pub konbini: Option<miniserde::json::Value>,
6813 #[serde(skip_serializing_if = "Option::is_none")]
6815 #[serde(with = "stripe_types::with_serde_json_opt")]
6816 pub kr_card: Option<miniserde::json::Value>,
6817 #[serde(skip_serializing_if = "Option::is_none")]
6819 #[serde(with = "stripe_types::with_serde_json_opt")]
6820 pub link: Option<miniserde::json::Value>,
6821 #[serde(skip_serializing_if = "Option::is_none")]
6823 #[serde(with = "stripe_types::with_serde_json_opt")]
6824 pub mb_way: Option<miniserde::json::Value>,
6825 #[serde(skip_serializing_if = "Option::is_none")]
6830 pub metadata: Option<std::collections::HashMap<String, String>>,
6831 #[serde(skip_serializing_if = "Option::is_none")]
6833 #[serde(with = "stripe_types::with_serde_json_opt")]
6834 pub mobilepay: Option<miniserde::json::Value>,
6835 #[serde(skip_serializing_if = "Option::is_none")]
6837 #[serde(with = "stripe_types::with_serde_json_opt")]
6838 pub multibanco: Option<miniserde::json::Value>,
6839 #[serde(skip_serializing_if = "Option::is_none")]
6841 pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
6842 #[serde(skip_serializing_if = "Option::is_none")]
6844 pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
6845 #[serde(skip_serializing_if = "Option::is_none")]
6847 #[serde(with = "stripe_types::with_serde_json_opt")]
6848 pub oxxo: Option<miniserde::json::Value>,
6849 #[serde(skip_serializing_if = "Option::is_none")]
6851 pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
6852 #[serde(skip_serializing_if = "Option::is_none")]
6854 #[serde(with = "stripe_types::with_serde_json_opt")]
6855 pub pay_by_bank: Option<miniserde::json::Value>,
6856 #[serde(skip_serializing_if = "Option::is_none")]
6858 #[serde(with = "stripe_types::with_serde_json_opt")]
6859 pub payco: Option<miniserde::json::Value>,
6860 #[serde(skip_serializing_if = "Option::is_none")]
6862 #[serde(with = "stripe_types::with_serde_json_opt")]
6863 pub paynow: Option<miniserde::json::Value>,
6864 #[serde(skip_serializing_if = "Option::is_none")]
6866 #[serde(with = "stripe_types::with_serde_json_opt")]
6867 pub paypal: Option<miniserde::json::Value>,
6868 #[serde(skip_serializing_if = "Option::is_none")]
6870 pub payto: Option<UpdateSetupIntentPaymentMethodDataPayto>,
6871 #[serde(skip_serializing_if = "Option::is_none")]
6873 #[serde(with = "stripe_types::with_serde_json_opt")]
6874 pub pix: Option<miniserde::json::Value>,
6875 #[serde(skip_serializing_if = "Option::is_none")]
6877 #[serde(with = "stripe_types::with_serde_json_opt")]
6878 pub promptpay: Option<miniserde::json::Value>,
6879 #[serde(skip_serializing_if = "Option::is_none")]
6882 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
6883 #[serde(skip_serializing_if = "Option::is_none")]
6885 #[serde(with = "stripe_types::with_serde_json_opt")]
6886 pub revolut_pay: Option<miniserde::json::Value>,
6887 #[serde(skip_serializing_if = "Option::is_none")]
6889 #[serde(with = "stripe_types::with_serde_json_opt")]
6890 pub samsung_pay: Option<miniserde::json::Value>,
6891 #[serde(skip_serializing_if = "Option::is_none")]
6893 #[serde(with = "stripe_types::with_serde_json_opt")]
6894 pub satispay: Option<miniserde::json::Value>,
6895 #[serde(skip_serializing_if = "Option::is_none")]
6897 pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
6898 #[serde(skip_serializing_if = "Option::is_none")]
6900 pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
6901 #[serde(skip_serializing_if = "Option::is_none")]
6903 #[serde(with = "stripe_types::with_serde_json_opt")]
6904 pub sunbit: Option<miniserde::json::Value>,
6905 #[serde(skip_serializing_if = "Option::is_none")]
6907 #[serde(with = "stripe_types::with_serde_json_opt")]
6908 pub swish: Option<miniserde::json::Value>,
6909 #[serde(skip_serializing_if = "Option::is_none")]
6911 #[serde(with = "stripe_types::with_serde_json_opt")]
6912 pub twint: Option<miniserde::json::Value>,
6913 #[serde(rename = "type")]
6917 pub type_: UpdateSetupIntentPaymentMethodDataType,
6918 #[serde(skip_serializing_if = "Option::is_none")]
6920 pub upi: Option<UpdateSetupIntentPaymentMethodDataUpi>,
6921 #[serde(skip_serializing_if = "Option::is_none")]
6923 pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
6924 #[serde(skip_serializing_if = "Option::is_none")]
6926 #[serde(with = "stripe_types::with_serde_json_opt")]
6927 pub wechat_pay: Option<miniserde::json::Value>,
6928 #[serde(skip_serializing_if = "Option::is_none")]
6930 #[serde(with = "stripe_types::with_serde_json_opt")]
6931 pub zip: Option<miniserde::json::Value>,
6932}
6933#[cfg(feature = "redact-generated-debug")]
6934impl std::fmt::Debug for UpdateSetupIntentPaymentMethodData {
6935 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6936 f.debug_struct("UpdateSetupIntentPaymentMethodData").finish_non_exhaustive()
6937 }
6938}
6939impl UpdateSetupIntentPaymentMethodData {
6940 pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
6941 Self {
6942 acss_debit: None,
6943 affirm: None,
6944 afterpay_clearpay: None,
6945 alipay: None,
6946 allow_redisplay: None,
6947 alma: None,
6948 amazon_pay: None,
6949 au_becs_debit: None,
6950 bacs_debit: None,
6951 bancontact: None,
6952 billie: None,
6953 billing_details: None,
6954 blik: None,
6955 boleto: None,
6956 cashapp: None,
6957 crypto: None,
6958 customer_balance: None,
6959 eps: None,
6960 fpx: None,
6961 giropay: None,
6962 grabpay: None,
6963 ideal: None,
6964 interac_present: None,
6965 kakao_pay: None,
6966 klarna: None,
6967 konbini: None,
6968 kr_card: None,
6969 link: None,
6970 mb_way: None,
6971 metadata: None,
6972 mobilepay: None,
6973 multibanco: None,
6974 naver_pay: None,
6975 nz_bank_account: None,
6976 oxxo: None,
6977 p24: None,
6978 pay_by_bank: None,
6979 payco: None,
6980 paynow: None,
6981 paypal: None,
6982 payto: None,
6983 pix: None,
6984 promptpay: None,
6985 radar_options: None,
6986 revolut_pay: None,
6987 samsung_pay: None,
6988 satispay: None,
6989 sepa_debit: None,
6990 sofort: None,
6991 sunbit: None,
6992 swish: None,
6993 twint: None,
6994 type_: type_.into(),
6995 upi: None,
6996 us_bank_account: None,
6997 wechat_pay: None,
6998 zip: None,
6999 }
7000 }
7001}
7002#[derive(Clone, Eq, PartialEq)]
7006#[non_exhaustive]
7007pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7008 Always,
7009 Limited,
7010 Unspecified,
7011 Unknown(String),
7013}
7014impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7015 pub fn as_str(&self) -> &str {
7016 use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
7017 match self {
7018 Always => "always",
7019 Limited => "limited",
7020 Unspecified => "unspecified",
7021 Unknown(v) => v,
7022 }
7023 }
7024}
7025
7026impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7027 type Err = std::convert::Infallible;
7028 fn from_str(s: &str) -> Result<Self, Self::Err> {
7029 use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
7030 match s {
7031 "always" => Ok(Always),
7032 "limited" => Ok(Limited),
7033 "unspecified" => Ok(Unspecified),
7034 v => {
7035 tracing::warn!(
7036 "Unknown value '{}' for enum '{}'",
7037 v,
7038 "UpdateSetupIntentPaymentMethodDataAllowRedisplay"
7039 );
7040 Ok(Unknown(v.to_owned()))
7041 }
7042 }
7043 }
7044}
7045impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7046 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7047 f.write_str(self.as_str())
7048 }
7049}
7050
7051#[cfg(not(feature = "redact-generated-debug"))]
7052impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7053 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7054 f.write_str(self.as_str())
7055 }
7056}
7057#[cfg(feature = "redact-generated-debug")]
7058impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7059 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7060 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataAllowRedisplay))
7061 .finish_non_exhaustive()
7062 }
7063}
7064impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7065 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7066 where
7067 S: serde::Serializer,
7068 {
7069 serializer.serialize_str(self.as_str())
7070 }
7071}
7072#[cfg(feature = "deserialize")]
7073impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
7074 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7075 use std::str::FromStr;
7076 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7077 Ok(Self::from_str(&s).expect("infallible"))
7078 }
7079}
7080#[derive(Clone, Eq, PartialEq)]
7082#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7083#[derive(serde::Serialize)]
7084pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
7085 pub account_number: String,
7087 pub bsb_number: String,
7089}
7090#[cfg(feature = "redact-generated-debug")]
7091impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAuBecsDebit {
7092 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7093 f.debug_struct("UpdateSetupIntentPaymentMethodDataAuBecsDebit").finish_non_exhaustive()
7094 }
7095}
7096impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
7097 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
7098 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
7099 }
7100}
7101#[derive(Clone, Eq, PartialEq)]
7103#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7104#[derive(serde::Serialize)]
7105pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
7106 #[serde(skip_serializing_if = "Option::is_none")]
7108 pub account_number: Option<String>,
7109 #[serde(skip_serializing_if = "Option::is_none")]
7111 pub sort_code: Option<String>,
7112}
7113#[cfg(feature = "redact-generated-debug")]
7114impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataBacsDebit {
7115 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7116 f.debug_struct("UpdateSetupIntentPaymentMethodDataBacsDebit").finish_non_exhaustive()
7117 }
7118}
7119impl UpdateSetupIntentPaymentMethodDataBacsDebit {
7120 pub fn new() -> Self {
7121 Self { account_number: None, sort_code: None }
7122 }
7123}
7124impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
7125 fn default() -> Self {
7126 Self::new()
7127 }
7128}
7129#[derive(Clone, Eq, PartialEq)]
7131#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7132#[derive(serde::Serialize)]
7133pub struct UpdateSetupIntentPaymentMethodDataBoleto {
7134 pub tax_id: String,
7136}
7137#[cfg(feature = "redact-generated-debug")]
7138impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataBoleto {
7139 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7140 f.debug_struct("UpdateSetupIntentPaymentMethodDataBoleto").finish_non_exhaustive()
7141 }
7142}
7143impl UpdateSetupIntentPaymentMethodDataBoleto {
7144 pub fn new(tax_id: impl Into<String>) -> Self {
7145 Self { tax_id: tax_id.into() }
7146 }
7147}
7148#[derive(Clone, Eq, PartialEq)]
7150#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7151#[derive(serde::Serialize)]
7152pub struct UpdateSetupIntentPaymentMethodDataEps {
7153 #[serde(skip_serializing_if = "Option::is_none")]
7155 pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
7156}
7157#[cfg(feature = "redact-generated-debug")]
7158impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEps {
7159 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7160 f.debug_struct("UpdateSetupIntentPaymentMethodDataEps").finish_non_exhaustive()
7161 }
7162}
7163impl UpdateSetupIntentPaymentMethodDataEps {
7164 pub fn new() -> Self {
7165 Self { bank: None }
7166 }
7167}
7168impl Default for UpdateSetupIntentPaymentMethodDataEps {
7169 fn default() -> Self {
7170 Self::new()
7171 }
7172}
7173#[derive(Clone, Eq, PartialEq)]
7175#[non_exhaustive]
7176pub enum UpdateSetupIntentPaymentMethodDataEpsBank {
7177 ArzteUndApothekerBank,
7178 AustrianAnadiBankAg,
7179 BankAustria,
7180 BankhausCarlSpangler,
7181 BankhausSchelhammerUndSchatteraAg,
7182 BawagPskAg,
7183 BksBankAg,
7184 BrullKallmusBankAg,
7185 BtvVierLanderBank,
7186 CapitalBankGraweGruppeAg,
7187 DeutscheBankAg,
7188 Dolomitenbank,
7189 EasybankAg,
7190 ErsteBankUndSparkassen,
7191 HypoAlpeadriabankInternationalAg,
7192 HypoBankBurgenlandAktiengesellschaft,
7193 HypoNoeLbFurNiederosterreichUWien,
7194 HypoOberosterreichSalzburgSteiermark,
7195 HypoTirolBankAg,
7196 HypoVorarlbergBankAg,
7197 MarchfelderBank,
7198 OberbankAg,
7199 RaiffeisenBankengruppeOsterreich,
7200 SchoellerbankAg,
7201 SpardaBankWien,
7202 VolksbankGruppe,
7203 VolkskreditbankAg,
7204 VrBankBraunau,
7205 Unknown(String),
7207}
7208impl UpdateSetupIntentPaymentMethodDataEpsBank {
7209 pub fn as_str(&self) -> &str {
7210 use UpdateSetupIntentPaymentMethodDataEpsBank::*;
7211 match self {
7212 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
7213 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
7214 BankAustria => "bank_austria",
7215 BankhausCarlSpangler => "bankhaus_carl_spangler",
7216 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
7217 BawagPskAg => "bawag_psk_ag",
7218 BksBankAg => "bks_bank_ag",
7219 BrullKallmusBankAg => "brull_kallmus_bank_ag",
7220 BtvVierLanderBank => "btv_vier_lander_bank",
7221 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
7222 DeutscheBankAg => "deutsche_bank_ag",
7223 Dolomitenbank => "dolomitenbank",
7224 EasybankAg => "easybank_ag",
7225 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
7226 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
7227 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
7228 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
7229 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
7230 HypoTirolBankAg => "hypo_tirol_bank_ag",
7231 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
7232 MarchfelderBank => "marchfelder_bank",
7233 OberbankAg => "oberbank_ag",
7234 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
7235 SchoellerbankAg => "schoellerbank_ag",
7236 SpardaBankWien => "sparda_bank_wien",
7237 VolksbankGruppe => "volksbank_gruppe",
7238 VolkskreditbankAg => "volkskreditbank_ag",
7239 VrBankBraunau => "vr_bank_braunau",
7240 Unknown(v) => v,
7241 }
7242 }
7243}
7244
7245impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
7246 type Err = std::convert::Infallible;
7247 fn from_str(s: &str) -> Result<Self, Self::Err> {
7248 use UpdateSetupIntentPaymentMethodDataEpsBank::*;
7249 match s {
7250 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
7251 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
7252 "bank_austria" => Ok(BankAustria),
7253 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
7254 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
7255 "bawag_psk_ag" => Ok(BawagPskAg),
7256 "bks_bank_ag" => Ok(BksBankAg),
7257 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
7258 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
7259 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
7260 "deutsche_bank_ag" => Ok(DeutscheBankAg),
7261 "dolomitenbank" => Ok(Dolomitenbank),
7262 "easybank_ag" => Ok(EasybankAg),
7263 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
7264 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
7265 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
7266 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
7267 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
7268 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
7269 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
7270 "marchfelder_bank" => Ok(MarchfelderBank),
7271 "oberbank_ag" => Ok(OberbankAg),
7272 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
7273 "schoellerbank_ag" => Ok(SchoellerbankAg),
7274 "sparda_bank_wien" => Ok(SpardaBankWien),
7275 "volksbank_gruppe" => Ok(VolksbankGruppe),
7276 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
7277 "vr_bank_braunau" => Ok(VrBankBraunau),
7278 v => {
7279 tracing::warn!(
7280 "Unknown value '{}' for enum '{}'",
7281 v,
7282 "UpdateSetupIntentPaymentMethodDataEpsBank"
7283 );
7284 Ok(Unknown(v.to_owned()))
7285 }
7286 }
7287 }
7288}
7289impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
7290 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7291 f.write_str(self.as_str())
7292 }
7293}
7294
7295#[cfg(not(feature = "redact-generated-debug"))]
7296impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
7297 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7298 f.write_str(self.as_str())
7299 }
7300}
7301#[cfg(feature = "redact-generated-debug")]
7302impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
7303 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7304 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataEpsBank))
7305 .finish_non_exhaustive()
7306 }
7307}
7308impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank {
7309 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7310 where
7311 S: serde::Serializer,
7312 {
7313 serializer.serialize_str(self.as_str())
7314 }
7315}
7316#[cfg(feature = "deserialize")]
7317impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataEpsBank {
7318 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7319 use std::str::FromStr;
7320 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7321 Ok(Self::from_str(&s).expect("infallible"))
7322 }
7323}
7324#[derive(Clone, Eq, PartialEq)]
7326#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7327#[derive(serde::Serialize)]
7328pub struct UpdateSetupIntentPaymentMethodDataFpx {
7329 #[serde(skip_serializing_if = "Option::is_none")]
7331 pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
7332 pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
7334}
7335#[cfg(feature = "redact-generated-debug")]
7336impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpx {
7337 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7338 f.debug_struct("UpdateSetupIntentPaymentMethodDataFpx").finish_non_exhaustive()
7339 }
7340}
7341impl UpdateSetupIntentPaymentMethodDataFpx {
7342 pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
7343 Self { account_holder_type: None, bank: bank.into() }
7344 }
7345}
7346#[derive(Clone, Eq, PartialEq)]
7348#[non_exhaustive]
7349pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7350 Company,
7351 Individual,
7352 Unknown(String),
7354}
7355impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7356 pub fn as_str(&self) -> &str {
7357 use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
7358 match self {
7359 Company => "company",
7360 Individual => "individual",
7361 Unknown(v) => v,
7362 }
7363 }
7364}
7365
7366impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7367 type Err = std::convert::Infallible;
7368 fn from_str(s: &str) -> Result<Self, Self::Err> {
7369 use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
7370 match s {
7371 "company" => Ok(Company),
7372 "individual" => Ok(Individual),
7373 v => {
7374 tracing::warn!(
7375 "Unknown value '{}' for enum '{}'",
7376 v,
7377 "UpdateSetupIntentPaymentMethodDataFpxAccountHolderType"
7378 );
7379 Ok(Unknown(v.to_owned()))
7380 }
7381 }
7382 }
7383}
7384impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7385 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7386 f.write_str(self.as_str())
7387 }
7388}
7389
7390#[cfg(not(feature = "redact-generated-debug"))]
7391impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7392 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7393 f.write_str(self.as_str())
7394 }
7395}
7396#[cfg(feature = "redact-generated-debug")]
7397impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7398 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7399 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataFpxAccountHolderType))
7400 .finish_non_exhaustive()
7401 }
7402}
7403impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7404 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7405 where
7406 S: serde::Serializer,
7407 {
7408 serializer.serialize_str(self.as_str())
7409 }
7410}
7411#[cfg(feature = "deserialize")]
7412impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
7413 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7414 use std::str::FromStr;
7415 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7416 Ok(Self::from_str(&s).expect("infallible"))
7417 }
7418}
7419#[derive(Clone, Eq, PartialEq)]
7421#[non_exhaustive]
7422pub enum UpdateSetupIntentPaymentMethodDataFpxBank {
7423 AffinBank,
7424 Agrobank,
7425 AllianceBank,
7426 Ambank,
7427 BankIslam,
7428 BankMuamalat,
7429 BankOfChina,
7430 BankRakyat,
7431 Bsn,
7432 Cimb,
7433 DeutscheBank,
7434 HongLeongBank,
7435 Hsbc,
7436 Kfh,
7437 Maybank2e,
7438 Maybank2u,
7439 Ocbc,
7440 PbEnterprise,
7441 PublicBank,
7442 Rhb,
7443 StandardChartered,
7444 Uob,
7445 Unknown(String),
7447}
7448impl UpdateSetupIntentPaymentMethodDataFpxBank {
7449 pub fn as_str(&self) -> &str {
7450 use UpdateSetupIntentPaymentMethodDataFpxBank::*;
7451 match self {
7452 AffinBank => "affin_bank",
7453 Agrobank => "agrobank",
7454 AllianceBank => "alliance_bank",
7455 Ambank => "ambank",
7456 BankIslam => "bank_islam",
7457 BankMuamalat => "bank_muamalat",
7458 BankOfChina => "bank_of_china",
7459 BankRakyat => "bank_rakyat",
7460 Bsn => "bsn",
7461 Cimb => "cimb",
7462 DeutscheBank => "deutsche_bank",
7463 HongLeongBank => "hong_leong_bank",
7464 Hsbc => "hsbc",
7465 Kfh => "kfh",
7466 Maybank2e => "maybank2e",
7467 Maybank2u => "maybank2u",
7468 Ocbc => "ocbc",
7469 PbEnterprise => "pb_enterprise",
7470 PublicBank => "public_bank",
7471 Rhb => "rhb",
7472 StandardChartered => "standard_chartered",
7473 Uob => "uob",
7474 Unknown(v) => v,
7475 }
7476 }
7477}
7478
7479impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
7480 type Err = std::convert::Infallible;
7481 fn from_str(s: &str) -> Result<Self, Self::Err> {
7482 use UpdateSetupIntentPaymentMethodDataFpxBank::*;
7483 match s {
7484 "affin_bank" => Ok(AffinBank),
7485 "agrobank" => Ok(Agrobank),
7486 "alliance_bank" => Ok(AllianceBank),
7487 "ambank" => Ok(Ambank),
7488 "bank_islam" => Ok(BankIslam),
7489 "bank_muamalat" => Ok(BankMuamalat),
7490 "bank_of_china" => Ok(BankOfChina),
7491 "bank_rakyat" => Ok(BankRakyat),
7492 "bsn" => Ok(Bsn),
7493 "cimb" => Ok(Cimb),
7494 "deutsche_bank" => Ok(DeutscheBank),
7495 "hong_leong_bank" => Ok(HongLeongBank),
7496 "hsbc" => Ok(Hsbc),
7497 "kfh" => Ok(Kfh),
7498 "maybank2e" => Ok(Maybank2e),
7499 "maybank2u" => Ok(Maybank2u),
7500 "ocbc" => Ok(Ocbc),
7501 "pb_enterprise" => Ok(PbEnterprise),
7502 "public_bank" => Ok(PublicBank),
7503 "rhb" => Ok(Rhb),
7504 "standard_chartered" => Ok(StandardChartered),
7505 "uob" => Ok(Uob),
7506 v => {
7507 tracing::warn!(
7508 "Unknown value '{}' for enum '{}'",
7509 v,
7510 "UpdateSetupIntentPaymentMethodDataFpxBank"
7511 );
7512 Ok(Unknown(v.to_owned()))
7513 }
7514 }
7515 }
7516}
7517impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
7518 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7519 f.write_str(self.as_str())
7520 }
7521}
7522
7523#[cfg(not(feature = "redact-generated-debug"))]
7524impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
7525 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7526 f.write_str(self.as_str())
7527 }
7528}
7529#[cfg(feature = "redact-generated-debug")]
7530impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
7531 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7532 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataFpxBank))
7533 .finish_non_exhaustive()
7534 }
7535}
7536impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
7537 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7538 where
7539 S: serde::Serializer,
7540 {
7541 serializer.serialize_str(self.as_str())
7542 }
7543}
7544#[cfg(feature = "deserialize")]
7545impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
7546 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7547 use std::str::FromStr;
7548 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7549 Ok(Self::from_str(&s).expect("infallible"))
7550 }
7551}
7552#[derive(Clone, Eq, PartialEq)]
7554#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7555#[derive(serde::Serialize)]
7556pub struct UpdateSetupIntentPaymentMethodDataIdeal {
7557 #[serde(skip_serializing_if = "Option::is_none")]
7561 pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
7562}
7563#[cfg(feature = "redact-generated-debug")]
7564impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdeal {
7565 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7566 f.debug_struct("UpdateSetupIntentPaymentMethodDataIdeal").finish_non_exhaustive()
7567 }
7568}
7569impl UpdateSetupIntentPaymentMethodDataIdeal {
7570 pub fn new() -> Self {
7571 Self { bank: None }
7572 }
7573}
7574impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
7575 fn default() -> Self {
7576 Self::new()
7577 }
7578}
7579#[derive(Clone, Eq, PartialEq)]
7583#[non_exhaustive]
7584pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
7585 AbnAmro,
7586 Adyen,
7587 AsnBank,
7588 Bunq,
7589 Buut,
7590 Finom,
7591 Handelsbanken,
7592 Ing,
7593 Knab,
7594 Mollie,
7595 Moneyou,
7596 N26,
7597 Nn,
7598 Rabobank,
7599 Regiobank,
7600 Revolut,
7601 SnsBank,
7602 TriodosBank,
7603 VanLanschot,
7604 Yoursafe,
7605 Unknown(String),
7607}
7608impl UpdateSetupIntentPaymentMethodDataIdealBank {
7609 pub fn as_str(&self) -> &str {
7610 use UpdateSetupIntentPaymentMethodDataIdealBank::*;
7611 match self {
7612 AbnAmro => "abn_amro",
7613 Adyen => "adyen",
7614 AsnBank => "asn_bank",
7615 Bunq => "bunq",
7616 Buut => "buut",
7617 Finom => "finom",
7618 Handelsbanken => "handelsbanken",
7619 Ing => "ing",
7620 Knab => "knab",
7621 Mollie => "mollie",
7622 Moneyou => "moneyou",
7623 N26 => "n26",
7624 Nn => "nn",
7625 Rabobank => "rabobank",
7626 Regiobank => "regiobank",
7627 Revolut => "revolut",
7628 SnsBank => "sns_bank",
7629 TriodosBank => "triodos_bank",
7630 VanLanschot => "van_lanschot",
7631 Yoursafe => "yoursafe",
7632 Unknown(v) => v,
7633 }
7634 }
7635}
7636
7637impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
7638 type Err = std::convert::Infallible;
7639 fn from_str(s: &str) -> Result<Self, Self::Err> {
7640 use UpdateSetupIntentPaymentMethodDataIdealBank::*;
7641 match s {
7642 "abn_amro" => Ok(AbnAmro),
7643 "adyen" => Ok(Adyen),
7644 "asn_bank" => Ok(AsnBank),
7645 "bunq" => Ok(Bunq),
7646 "buut" => Ok(Buut),
7647 "finom" => Ok(Finom),
7648 "handelsbanken" => Ok(Handelsbanken),
7649 "ing" => Ok(Ing),
7650 "knab" => Ok(Knab),
7651 "mollie" => Ok(Mollie),
7652 "moneyou" => Ok(Moneyou),
7653 "n26" => Ok(N26),
7654 "nn" => Ok(Nn),
7655 "rabobank" => Ok(Rabobank),
7656 "regiobank" => Ok(Regiobank),
7657 "revolut" => Ok(Revolut),
7658 "sns_bank" => Ok(SnsBank),
7659 "triodos_bank" => Ok(TriodosBank),
7660 "van_lanschot" => Ok(VanLanschot),
7661 "yoursafe" => Ok(Yoursafe),
7662 v => {
7663 tracing::warn!(
7664 "Unknown value '{}' for enum '{}'",
7665 v,
7666 "UpdateSetupIntentPaymentMethodDataIdealBank"
7667 );
7668 Ok(Unknown(v.to_owned()))
7669 }
7670 }
7671 }
7672}
7673impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
7674 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7675 f.write_str(self.as_str())
7676 }
7677}
7678
7679#[cfg(not(feature = "redact-generated-debug"))]
7680impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
7681 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7682 f.write_str(self.as_str())
7683 }
7684}
7685#[cfg(feature = "redact-generated-debug")]
7686impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
7687 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7688 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataIdealBank))
7689 .finish_non_exhaustive()
7690 }
7691}
7692impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
7693 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7694 where
7695 S: serde::Serializer,
7696 {
7697 serializer.serialize_str(self.as_str())
7698 }
7699}
7700#[cfg(feature = "deserialize")]
7701impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
7702 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7703 use std::str::FromStr;
7704 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7705 Ok(Self::from_str(&s).expect("infallible"))
7706 }
7707}
7708#[derive(Copy, Clone, Eq, PartialEq)]
7710#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7711#[derive(serde::Serialize)]
7712pub struct UpdateSetupIntentPaymentMethodDataKlarna {
7713 #[serde(skip_serializing_if = "Option::is_none")]
7715 pub dob: Option<DateOfBirth>,
7716}
7717#[cfg(feature = "redact-generated-debug")]
7718impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataKlarna {
7719 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7720 f.debug_struct("UpdateSetupIntentPaymentMethodDataKlarna").finish_non_exhaustive()
7721 }
7722}
7723impl UpdateSetupIntentPaymentMethodDataKlarna {
7724 pub fn new() -> Self {
7725 Self { dob: None }
7726 }
7727}
7728impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
7729 fn default() -> Self {
7730 Self::new()
7731 }
7732}
7733#[derive(Clone, Eq, PartialEq)]
7735#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7736#[derive(serde::Serialize)]
7737pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
7738 #[serde(skip_serializing_if = "Option::is_none")]
7741 pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
7742}
7743#[cfg(feature = "redact-generated-debug")]
7744impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPay {
7745 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7746 f.debug_struct("UpdateSetupIntentPaymentMethodDataNaverPay").finish_non_exhaustive()
7747 }
7748}
7749impl UpdateSetupIntentPaymentMethodDataNaverPay {
7750 pub fn new() -> Self {
7751 Self { funding: None }
7752 }
7753}
7754impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
7755 fn default() -> Self {
7756 Self::new()
7757 }
7758}
7759#[derive(Clone, Eq, PartialEq)]
7762#[non_exhaustive]
7763pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7764 Card,
7765 Points,
7766 Unknown(String),
7768}
7769impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7770 pub fn as_str(&self) -> &str {
7771 use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
7772 match self {
7773 Card => "card",
7774 Points => "points",
7775 Unknown(v) => v,
7776 }
7777 }
7778}
7779
7780impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7781 type Err = std::convert::Infallible;
7782 fn from_str(s: &str) -> Result<Self, Self::Err> {
7783 use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
7784 match s {
7785 "card" => Ok(Card),
7786 "points" => Ok(Points),
7787 v => {
7788 tracing::warn!(
7789 "Unknown value '{}' for enum '{}'",
7790 v,
7791 "UpdateSetupIntentPaymentMethodDataNaverPayFunding"
7792 );
7793 Ok(Unknown(v.to_owned()))
7794 }
7795 }
7796 }
7797}
7798impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7799 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7800 f.write_str(self.as_str())
7801 }
7802}
7803
7804#[cfg(not(feature = "redact-generated-debug"))]
7805impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7806 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7807 f.write_str(self.as_str())
7808 }
7809}
7810#[cfg(feature = "redact-generated-debug")]
7811impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7812 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7813 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataNaverPayFunding))
7814 .finish_non_exhaustive()
7815 }
7816}
7817impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7818 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7819 where
7820 S: serde::Serializer,
7821 {
7822 serializer.serialize_str(self.as_str())
7823 }
7824}
7825#[cfg(feature = "deserialize")]
7826impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
7827 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7828 use std::str::FromStr;
7829 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7830 Ok(Self::from_str(&s).expect("infallible"))
7831 }
7832}
7833#[derive(Clone, Eq, PartialEq)]
7835#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7836#[derive(serde::Serialize)]
7837pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
7838 #[serde(skip_serializing_if = "Option::is_none")]
7841 pub account_holder_name: Option<String>,
7842 pub account_number: String,
7844 pub bank_code: String,
7846 pub branch_code: String,
7848 #[serde(skip_serializing_if = "Option::is_none")]
7849 pub reference: Option<String>,
7850 pub suffix: String,
7852}
7853#[cfg(feature = "redact-generated-debug")]
7854impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNzBankAccount {
7855 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7856 f.debug_struct("UpdateSetupIntentPaymentMethodDataNzBankAccount").finish_non_exhaustive()
7857 }
7858}
7859impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
7860 pub fn new(
7861 account_number: impl Into<String>,
7862 bank_code: impl Into<String>,
7863 branch_code: impl Into<String>,
7864 suffix: impl Into<String>,
7865 ) -> Self {
7866 Self {
7867 account_holder_name: None,
7868 account_number: account_number.into(),
7869 bank_code: bank_code.into(),
7870 branch_code: branch_code.into(),
7871 reference: None,
7872 suffix: suffix.into(),
7873 }
7874 }
7875}
7876#[derive(Clone, Eq, PartialEq)]
7878#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7879#[derive(serde::Serialize)]
7880pub struct UpdateSetupIntentPaymentMethodDataP24 {
7881 #[serde(skip_serializing_if = "Option::is_none")]
7883 pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
7884}
7885#[cfg(feature = "redact-generated-debug")]
7886impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24 {
7887 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7888 f.debug_struct("UpdateSetupIntentPaymentMethodDataP24").finish_non_exhaustive()
7889 }
7890}
7891impl UpdateSetupIntentPaymentMethodDataP24 {
7892 pub fn new() -> Self {
7893 Self { bank: None }
7894 }
7895}
7896impl Default for UpdateSetupIntentPaymentMethodDataP24 {
7897 fn default() -> Self {
7898 Self::new()
7899 }
7900}
7901#[derive(Clone, Eq, PartialEq)]
7903#[non_exhaustive]
7904pub enum UpdateSetupIntentPaymentMethodDataP24Bank {
7905 AliorBank,
7906 BankMillennium,
7907 BankNowyBfgSa,
7908 BankPekaoSa,
7909 BankiSpbdzielcze,
7910 Blik,
7911 BnpParibas,
7912 Boz,
7913 CitiHandlowy,
7914 CreditAgricole,
7915 Envelobank,
7916 EtransferPocztowy24,
7917 GetinBank,
7918 Ideabank,
7919 Ing,
7920 Inteligo,
7921 MbankMtransfer,
7922 NestPrzelew,
7923 NoblePay,
7924 PbacZIpko,
7925 PlusBank,
7926 SantanderPrzelew24,
7927 TmobileUsbugiBankowe,
7928 ToyotaBank,
7929 Velobank,
7930 VolkswagenBank,
7931 Unknown(String),
7933}
7934impl UpdateSetupIntentPaymentMethodDataP24Bank {
7935 pub fn as_str(&self) -> &str {
7936 use UpdateSetupIntentPaymentMethodDataP24Bank::*;
7937 match self {
7938 AliorBank => "alior_bank",
7939 BankMillennium => "bank_millennium",
7940 BankNowyBfgSa => "bank_nowy_bfg_sa",
7941 BankPekaoSa => "bank_pekao_sa",
7942 BankiSpbdzielcze => "banki_spbdzielcze",
7943 Blik => "blik",
7944 BnpParibas => "bnp_paribas",
7945 Boz => "boz",
7946 CitiHandlowy => "citi_handlowy",
7947 CreditAgricole => "credit_agricole",
7948 Envelobank => "envelobank",
7949 EtransferPocztowy24 => "etransfer_pocztowy24",
7950 GetinBank => "getin_bank",
7951 Ideabank => "ideabank",
7952 Ing => "ing",
7953 Inteligo => "inteligo",
7954 MbankMtransfer => "mbank_mtransfer",
7955 NestPrzelew => "nest_przelew",
7956 NoblePay => "noble_pay",
7957 PbacZIpko => "pbac_z_ipko",
7958 PlusBank => "plus_bank",
7959 SantanderPrzelew24 => "santander_przelew24",
7960 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
7961 ToyotaBank => "toyota_bank",
7962 Velobank => "velobank",
7963 VolkswagenBank => "volkswagen_bank",
7964 Unknown(v) => v,
7965 }
7966 }
7967}
7968
7969impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
7970 type Err = std::convert::Infallible;
7971 fn from_str(s: &str) -> Result<Self, Self::Err> {
7972 use UpdateSetupIntentPaymentMethodDataP24Bank::*;
7973 match s {
7974 "alior_bank" => Ok(AliorBank),
7975 "bank_millennium" => Ok(BankMillennium),
7976 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
7977 "bank_pekao_sa" => Ok(BankPekaoSa),
7978 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
7979 "blik" => Ok(Blik),
7980 "bnp_paribas" => Ok(BnpParibas),
7981 "boz" => Ok(Boz),
7982 "citi_handlowy" => Ok(CitiHandlowy),
7983 "credit_agricole" => Ok(CreditAgricole),
7984 "envelobank" => Ok(Envelobank),
7985 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
7986 "getin_bank" => Ok(GetinBank),
7987 "ideabank" => Ok(Ideabank),
7988 "ing" => Ok(Ing),
7989 "inteligo" => Ok(Inteligo),
7990 "mbank_mtransfer" => Ok(MbankMtransfer),
7991 "nest_przelew" => Ok(NestPrzelew),
7992 "noble_pay" => Ok(NoblePay),
7993 "pbac_z_ipko" => Ok(PbacZIpko),
7994 "plus_bank" => Ok(PlusBank),
7995 "santander_przelew24" => Ok(SantanderPrzelew24),
7996 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
7997 "toyota_bank" => Ok(ToyotaBank),
7998 "velobank" => Ok(Velobank),
7999 "volkswagen_bank" => Ok(VolkswagenBank),
8000 v => {
8001 tracing::warn!(
8002 "Unknown value '{}' for enum '{}'",
8003 v,
8004 "UpdateSetupIntentPaymentMethodDataP24Bank"
8005 );
8006 Ok(Unknown(v.to_owned()))
8007 }
8008 }
8009 }
8010}
8011impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
8012 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8013 f.write_str(self.as_str())
8014 }
8015}
8016
8017#[cfg(not(feature = "redact-generated-debug"))]
8018impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
8019 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8020 f.write_str(self.as_str())
8021 }
8022}
8023#[cfg(feature = "redact-generated-debug")]
8024impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
8025 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8026 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataP24Bank))
8027 .finish_non_exhaustive()
8028 }
8029}
8030impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
8031 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8032 where
8033 S: serde::Serializer,
8034 {
8035 serializer.serialize_str(self.as_str())
8036 }
8037}
8038#[cfg(feature = "deserialize")]
8039impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
8040 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8041 use std::str::FromStr;
8042 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8043 Ok(Self::from_str(&s).expect("infallible"))
8044 }
8045}
8046#[derive(Clone, Eq, PartialEq)]
8048#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8049#[derive(serde::Serialize)]
8050pub struct UpdateSetupIntentPaymentMethodDataPayto {
8051 #[serde(skip_serializing_if = "Option::is_none")]
8053 pub account_number: Option<String>,
8054 #[serde(skip_serializing_if = "Option::is_none")]
8056 pub bsb_number: Option<String>,
8057 #[serde(skip_serializing_if = "Option::is_none")]
8059 pub pay_id: Option<String>,
8060}
8061#[cfg(feature = "redact-generated-debug")]
8062impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataPayto {
8063 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8064 f.debug_struct("UpdateSetupIntentPaymentMethodDataPayto").finish_non_exhaustive()
8065 }
8066}
8067impl UpdateSetupIntentPaymentMethodDataPayto {
8068 pub fn new() -> Self {
8069 Self { account_number: None, bsb_number: None, pay_id: None }
8070 }
8071}
8072impl Default for UpdateSetupIntentPaymentMethodDataPayto {
8073 fn default() -> Self {
8074 Self::new()
8075 }
8076}
8077#[derive(Clone, Eq, PartialEq)]
8079#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8080#[derive(serde::Serialize)]
8081pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
8082 pub iban: String,
8084}
8085#[cfg(feature = "redact-generated-debug")]
8086impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSepaDebit {
8087 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8088 f.debug_struct("UpdateSetupIntentPaymentMethodDataSepaDebit").finish_non_exhaustive()
8089 }
8090}
8091impl UpdateSetupIntentPaymentMethodDataSepaDebit {
8092 pub fn new(iban: impl Into<String>) -> Self {
8093 Self { iban: iban.into() }
8094 }
8095}
8096#[derive(Clone, Eq, PartialEq)]
8098#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8099#[derive(serde::Serialize)]
8100pub struct UpdateSetupIntentPaymentMethodDataSofort {
8101 pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
8103}
8104#[cfg(feature = "redact-generated-debug")]
8105impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofort {
8106 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8107 f.debug_struct("UpdateSetupIntentPaymentMethodDataSofort").finish_non_exhaustive()
8108 }
8109}
8110impl UpdateSetupIntentPaymentMethodDataSofort {
8111 pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
8112 Self { country: country.into() }
8113 }
8114}
8115#[derive(Clone, Eq, PartialEq)]
8117#[non_exhaustive]
8118pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
8119 At,
8120 Be,
8121 De,
8122 Es,
8123 It,
8124 Nl,
8125 Unknown(String),
8127}
8128impl UpdateSetupIntentPaymentMethodDataSofortCountry {
8129 pub fn as_str(&self) -> &str {
8130 use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
8131 match self {
8132 At => "AT",
8133 Be => "BE",
8134 De => "DE",
8135 Es => "ES",
8136 It => "IT",
8137 Nl => "NL",
8138 Unknown(v) => v,
8139 }
8140 }
8141}
8142
8143impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
8144 type Err = std::convert::Infallible;
8145 fn from_str(s: &str) -> Result<Self, Self::Err> {
8146 use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
8147 match s {
8148 "AT" => Ok(At),
8149 "BE" => Ok(Be),
8150 "DE" => Ok(De),
8151 "ES" => Ok(Es),
8152 "IT" => Ok(It),
8153 "NL" => Ok(Nl),
8154 v => {
8155 tracing::warn!(
8156 "Unknown value '{}' for enum '{}'",
8157 v,
8158 "UpdateSetupIntentPaymentMethodDataSofortCountry"
8159 );
8160 Ok(Unknown(v.to_owned()))
8161 }
8162 }
8163 }
8164}
8165impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
8166 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8167 f.write_str(self.as_str())
8168 }
8169}
8170
8171#[cfg(not(feature = "redact-generated-debug"))]
8172impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
8173 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8174 f.write_str(self.as_str())
8175 }
8176}
8177#[cfg(feature = "redact-generated-debug")]
8178impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
8179 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8180 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataSofortCountry))
8181 .finish_non_exhaustive()
8182 }
8183}
8184impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
8185 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8186 where
8187 S: serde::Serializer,
8188 {
8189 serializer.serialize_str(self.as_str())
8190 }
8191}
8192#[cfg(feature = "deserialize")]
8193impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
8194 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8195 use std::str::FromStr;
8196 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8197 Ok(Self::from_str(&s).expect("infallible"))
8198 }
8199}
8200#[derive(Clone, Eq, PartialEq)]
8204#[non_exhaustive]
8205pub enum UpdateSetupIntentPaymentMethodDataType {
8206 AcssDebit,
8207 Affirm,
8208 AfterpayClearpay,
8209 Alipay,
8210 Alma,
8211 AmazonPay,
8212 AuBecsDebit,
8213 BacsDebit,
8214 Bancontact,
8215 Billie,
8216 Blik,
8217 Boleto,
8218 Cashapp,
8219 Crypto,
8220 CustomerBalance,
8221 Eps,
8222 Fpx,
8223 Giropay,
8224 Grabpay,
8225 Ideal,
8226 KakaoPay,
8227 Klarna,
8228 Konbini,
8229 KrCard,
8230 Link,
8231 MbWay,
8232 Mobilepay,
8233 Multibanco,
8234 NaverPay,
8235 NzBankAccount,
8236 Oxxo,
8237 P24,
8238 PayByBank,
8239 Payco,
8240 Paynow,
8241 Paypal,
8242 Payto,
8243 Pix,
8244 Promptpay,
8245 RevolutPay,
8246 SamsungPay,
8247 Satispay,
8248 SepaDebit,
8249 Sofort,
8250 Sunbit,
8251 Swish,
8252 Twint,
8253 Upi,
8254 UsBankAccount,
8255 WechatPay,
8256 Zip,
8257 Unknown(String),
8259}
8260impl UpdateSetupIntentPaymentMethodDataType {
8261 pub fn as_str(&self) -> &str {
8262 use UpdateSetupIntentPaymentMethodDataType::*;
8263 match self {
8264 AcssDebit => "acss_debit",
8265 Affirm => "affirm",
8266 AfterpayClearpay => "afterpay_clearpay",
8267 Alipay => "alipay",
8268 Alma => "alma",
8269 AmazonPay => "amazon_pay",
8270 AuBecsDebit => "au_becs_debit",
8271 BacsDebit => "bacs_debit",
8272 Bancontact => "bancontact",
8273 Billie => "billie",
8274 Blik => "blik",
8275 Boleto => "boleto",
8276 Cashapp => "cashapp",
8277 Crypto => "crypto",
8278 CustomerBalance => "customer_balance",
8279 Eps => "eps",
8280 Fpx => "fpx",
8281 Giropay => "giropay",
8282 Grabpay => "grabpay",
8283 Ideal => "ideal",
8284 KakaoPay => "kakao_pay",
8285 Klarna => "klarna",
8286 Konbini => "konbini",
8287 KrCard => "kr_card",
8288 Link => "link",
8289 MbWay => "mb_way",
8290 Mobilepay => "mobilepay",
8291 Multibanco => "multibanco",
8292 NaverPay => "naver_pay",
8293 NzBankAccount => "nz_bank_account",
8294 Oxxo => "oxxo",
8295 P24 => "p24",
8296 PayByBank => "pay_by_bank",
8297 Payco => "payco",
8298 Paynow => "paynow",
8299 Paypal => "paypal",
8300 Payto => "payto",
8301 Pix => "pix",
8302 Promptpay => "promptpay",
8303 RevolutPay => "revolut_pay",
8304 SamsungPay => "samsung_pay",
8305 Satispay => "satispay",
8306 SepaDebit => "sepa_debit",
8307 Sofort => "sofort",
8308 Sunbit => "sunbit",
8309 Swish => "swish",
8310 Twint => "twint",
8311 Upi => "upi",
8312 UsBankAccount => "us_bank_account",
8313 WechatPay => "wechat_pay",
8314 Zip => "zip",
8315 Unknown(v) => v,
8316 }
8317 }
8318}
8319
8320impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
8321 type Err = std::convert::Infallible;
8322 fn from_str(s: &str) -> Result<Self, Self::Err> {
8323 use UpdateSetupIntentPaymentMethodDataType::*;
8324 match s {
8325 "acss_debit" => Ok(AcssDebit),
8326 "affirm" => Ok(Affirm),
8327 "afterpay_clearpay" => Ok(AfterpayClearpay),
8328 "alipay" => Ok(Alipay),
8329 "alma" => Ok(Alma),
8330 "amazon_pay" => Ok(AmazonPay),
8331 "au_becs_debit" => Ok(AuBecsDebit),
8332 "bacs_debit" => Ok(BacsDebit),
8333 "bancontact" => Ok(Bancontact),
8334 "billie" => Ok(Billie),
8335 "blik" => Ok(Blik),
8336 "boleto" => Ok(Boleto),
8337 "cashapp" => Ok(Cashapp),
8338 "crypto" => Ok(Crypto),
8339 "customer_balance" => Ok(CustomerBalance),
8340 "eps" => Ok(Eps),
8341 "fpx" => Ok(Fpx),
8342 "giropay" => Ok(Giropay),
8343 "grabpay" => Ok(Grabpay),
8344 "ideal" => Ok(Ideal),
8345 "kakao_pay" => Ok(KakaoPay),
8346 "klarna" => Ok(Klarna),
8347 "konbini" => Ok(Konbini),
8348 "kr_card" => Ok(KrCard),
8349 "link" => Ok(Link),
8350 "mb_way" => Ok(MbWay),
8351 "mobilepay" => Ok(Mobilepay),
8352 "multibanco" => Ok(Multibanco),
8353 "naver_pay" => Ok(NaverPay),
8354 "nz_bank_account" => Ok(NzBankAccount),
8355 "oxxo" => Ok(Oxxo),
8356 "p24" => Ok(P24),
8357 "pay_by_bank" => Ok(PayByBank),
8358 "payco" => Ok(Payco),
8359 "paynow" => Ok(Paynow),
8360 "paypal" => Ok(Paypal),
8361 "payto" => Ok(Payto),
8362 "pix" => Ok(Pix),
8363 "promptpay" => Ok(Promptpay),
8364 "revolut_pay" => Ok(RevolutPay),
8365 "samsung_pay" => Ok(SamsungPay),
8366 "satispay" => Ok(Satispay),
8367 "sepa_debit" => Ok(SepaDebit),
8368 "sofort" => Ok(Sofort),
8369 "sunbit" => Ok(Sunbit),
8370 "swish" => Ok(Swish),
8371 "twint" => Ok(Twint),
8372 "upi" => Ok(Upi),
8373 "us_bank_account" => Ok(UsBankAccount),
8374 "wechat_pay" => Ok(WechatPay),
8375 "zip" => Ok(Zip),
8376 v => {
8377 tracing::warn!(
8378 "Unknown value '{}' for enum '{}'",
8379 v,
8380 "UpdateSetupIntentPaymentMethodDataType"
8381 );
8382 Ok(Unknown(v.to_owned()))
8383 }
8384 }
8385 }
8386}
8387impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
8388 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8389 f.write_str(self.as_str())
8390 }
8391}
8392
8393#[cfg(not(feature = "redact-generated-debug"))]
8394impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
8395 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8396 f.write_str(self.as_str())
8397 }
8398}
8399#[cfg(feature = "redact-generated-debug")]
8400impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
8401 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8402 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataType)).finish_non_exhaustive()
8403 }
8404}
8405impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
8406 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8407 where
8408 S: serde::Serializer,
8409 {
8410 serializer.serialize_str(self.as_str())
8411 }
8412}
8413#[cfg(feature = "deserialize")]
8414impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
8415 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8416 use std::str::FromStr;
8417 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8418 Ok(Self::from_str(&s).expect("infallible"))
8419 }
8420}
8421#[derive(Clone, Eq, PartialEq)]
8423#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8424#[derive(serde::Serialize)]
8425pub struct UpdateSetupIntentPaymentMethodDataUpi {
8426 #[serde(skip_serializing_if = "Option::is_none")]
8428 pub mandate_options: Option<UpdateSetupIntentPaymentMethodDataUpiMandateOptions>,
8429}
8430#[cfg(feature = "redact-generated-debug")]
8431impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpi {
8432 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8433 f.debug_struct("UpdateSetupIntentPaymentMethodDataUpi").finish_non_exhaustive()
8434 }
8435}
8436impl UpdateSetupIntentPaymentMethodDataUpi {
8437 pub fn new() -> Self {
8438 Self { mandate_options: None }
8439 }
8440}
8441impl Default for UpdateSetupIntentPaymentMethodDataUpi {
8442 fn default() -> Self {
8443 Self::new()
8444 }
8445}
8446#[derive(Clone, Eq, PartialEq)]
8448#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8449#[derive(serde::Serialize)]
8450pub struct UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
8451 #[serde(skip_serializing_if = "Option::is_none")]
8453 pub amount: Option<i64>,
8454 #[serde(skip_serializing_if = "Option::is_none")]
8458 pub amount_type: Option<UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType>,
8459 #[serde(skip_serializing_if = "Option::is_none")]
8461 pub description: Option<String>,
8462 #[serde(skip_serializing_if = "Option::is_none")]
8464 pub end_date: Option<stripe_types::Timestamp>,
8465}
8466#[cfg(feature = "redact-generated-debug")]
8467impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
8468 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8469 f.debug_struct("UpdateSetupIntentPaymentMethodDataUpiMandateOptions")
8470 .finish_non_exhaustive()
8471 }
8472}
8473impl UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
8474 pub fn new() -> Self {
8475 Self { amount: None, amount_type: None, description: None, end_date: None }
8476 }
8477}
8478impl Default for UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
8479 fn default() -> Self {
8480 Self::new()
8481 }
8482}
8483#[derive(Clone, Eq, PartialEq)]
8487#[non_exhaustive]
8488pub enum UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8489 Fixed,
8490 Maximum,
8491 Unknown(String),
8493}
8494impl UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8495 pub fn as_str(&self) -> &str {
8496 use UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
8497 match self {
8498 Fixed => "fixed",
8499 Maximum => "maximum",
8500 Unknown(v) => v,
8501 }
8502 }
8503}
8504
8505impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8506 type Err = std::convert::Infallible;
8507 fn from_str(s: &str) -> Result<Self, Self::Err> {
8508 use UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
8509 match s {
8510 "fixed" => Ok(Fixed),
8511 "maximum" => Ok(Maximum),
8512 v => {
8513 tracing::warn!(
8514 "Unknown value '{}' for enum '{}'",
8515 v,
8516 "UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType"
8517 );
8518 Ok(Unknown(v.to_owned()))
8519 }
8520 }
8521 }
8522}
8523impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8524 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8525 f.write_str(self.as_str())
8526 }
8527}
8528
8529#[cfg(not(feature = "redact-generated-debug"))]
8530impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8531 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8532 f.write_str(self.as_str())
8533 }
8534}
8535#[cfg(feature = "redact-generated-debug")]
8536impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8537 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8538 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType))
8539 .finish_non_exhaustive()
8540 }
8541}
8542impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
8543 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8544 where
8545 S: serde::Serializer,
8546 {
8547 serializer.serialize_str(self.as_str())
8548 }
8549}
8550#[cfg(feature = "deserialize")]
8551impl<'de> serde::Deserialize<'de>
8552 for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType
8553{
8554 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8555 use std::str::FromStr;
8556 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8557 Ok(Self::from_str(&s).expect("infallible"))
8558 }
8559}
8560#[derive(Clone, Eq, PartialEq)]
8562#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8563#[derive(serde::Serialize)]
8564pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
8565 #[serde(skip_serializing_if = "Option::is_none")]
8567 pub account_holder_type:
8568 Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
8569 #[serde(skip_serializing_if = "Option::is_none")]
8571 pub account_number: Option<String>,
8572 #[serde(skip_serializing_if = "Option::is_none")]
8574 pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
8575 #[serde(skip_serializing_if = "Option::is_none")]
8577 pub financial_connections_account: Option<String>,
8578 #[serde(skip_serializing_if = "Option::is_none")]
8580 pub routing_number: Option<String>,
8581}
8582#[cfg(feature = "redact-generated-debug")]
8583impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccount {
8584 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8585 f.debug_struct("UpdateSetupIntentPaymentMethodDataUsBankAccount").finish_non_exhaustive()
8586 }
8587}
8588impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
8589 pub fn new() -> Self {
8590 Self {
8591 account_holder_type: None,
8592 account_number: None,
8593 account_type: None,
8594 financial_connections_account: None,
8595 routing_number: None,
8596 }
8597 }
8598}
8599impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
8600 fn default() -> Self {
8601 Self::new()
8602 }
8603}
8604#[derive(Clone, Eq, PartialEq)]
8606#[non_exhaustive]
8607pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8608 Company,
8609 Individual,
8610 Unknown(String),
8612}
8613impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8614 pub fn as_str(&self) -> &str {
8615 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
8616 match self {
8617 Company => "company",
8618 Individual => "individual",
8619 Unknown(v) => v,
8620 }
8621 }
8622}
8623
8624impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8625 type Err = std::convert::Infallible;
8626 fn from_str(s: &str) -> Result<Self, Self::Err> {
8627 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
8628 match s {
8629 "company" => Ok(Company),
8630 "individual" => Ok(Individual),
8631 v => {
8632 tracing::warn!(
8633 "Unknown value '{}' for enum '{}'",
8634 v,
8635 "UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
8636 );
8637 Ok(Unknown(v.to_owned()))
8638 }
8639 }
8640 }
8641}
8642impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8643 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8644 f.write_str(self.as_str())
8645 }
8646}
8647
8648#[cfg(not(feature = "redact-generated-debug"))]
8649impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8650 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8651 f.write_str(self.as_str())
8652 }
8653}
8654#[cfg(feature = "redact-generated-debug")]
8655impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8656 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8657 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType))
8658 .finish_non_exhaustive()
8659 }
8660}
8661impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
8662 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8663 where
8664 S: serde::Serializer,
8665 {
8666 serializer.serialize_str(self.as_str())
8667 }
8668}
8669#[cfg(feature = "deserialize")]
8670impl<'de> serde::Deserialize<'de>
8671 for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
8672{
8673 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8674 use std::str::FromStr;
8675 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8676 Ok(Self::from_str(&s).expect("infallible"))
8677 }
8678}
8679#[derive(Clone, Eq, PartialEq)]
8681#[non_exhaustive]
8682pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8683 Checking,
8684 Savings,
8685 Unknown(String),
8687}
8688impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8689 pub fn as_str(&self) -> &str {
8690 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
8691 match self {
8692 Checking => "checking",
8693 Savings => "savings",
8694 Unknown(v) => v,
8695 }
8696 }
8697}
8698
8699impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8700 type Err = std::convert::Infallible;
8701 fn from_str(s: &str) -> Result<Self, Self::Err> {
8702 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
8703 match s {
8704 "checking" => Ok(Checking),
8705 "savings" => Ok(Savings),
8706 v => {
8707 tracing::warn!(
8708 "Unknown value '{}' for enum '{}'",
8709 v,
8710 "UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType"
8711 );
8712 Ok(Unknown(v.to_owned()))
8713 }
8714 }
8715 }
8716}
8717impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8718 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8719 f.write_str(self.as_str())
8720 }
8721}
8722
8723#[cfg(not(feature = "redact-generated-debug"))]
8724impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8725 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8726 f.write_str(self.as_str())
8727 }
8728}
8729#[cfg(feature = "redact-generated-debug")]
8730impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8731 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8732 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType))
8733 .finish_non_exhaustive()
8734 }
8735}
8736impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8737 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8738 where
8739 S: serde::Serializer,
8740 {
8741 serializer.serialize_str(self.as_str())
8742 }
8743}
8744#[cfg(feature = "deserialize")]
8745impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
8746 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8747 use std::str::FromStr;
8748 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8749 Ok(Self::from_str(&s).expect("infallible"))
8750 }
8751}
8752#[derive(Clone)]
8754#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8755#[derive(serde::Serialize)]
8756pub struct UpdateSetupIntentPaymentMethodOptions {
8757 #[serde(skip_serializing_if = "Option::is_none")]
8759 pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
8760 #[serde(skip_serializing_if = "Option::is_none")]
8762 #[serde(with = "stripe_types::with_serde_json_opt")]
8763 pub amazon_pay: Option<miniserde::json::Value>,
8764 #[serde(skip_serializing_if = "Option::is_none")]
8766 pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
8767 #[serde(skip_serializing_if = "Option::is_none")]
8769 pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
8770 #[serde(skip_serializing_if = "Option::is_none")]
8772 #[serde(with = "stripe_types::with_serde_json_opt")]
8773 pub card_present: Option<miniserde::json::Value>,
8774 #[serde(skip_serializing_if = "Option::is_none")]
8776 pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
8777 #[serde(skip_serializing_if = "Option::is_none")]
8779 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
8780 #[serde(skip_serializing_if = "Option::is_none")]
8782 pub paypal: Option<PaymentMethodOptionsParam>,
8783 #[serde(skip_serializing_if = "Option::is_none")]
8785 pub payto: Option<UpdateSetupIntentPaymentMethodOptionsPayto>,
8786 #[serde(skip_serializing_if = "Option::is_none")]
8788 pub pix: Option<UpdateSetupIntentPaymentMethodOptionsPix>,
8789 #[serde(skip_serializing_if = "Option::is_none")]
8791 pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
8792 #[serde(skip_serializing_if = "Option::is_none")]
8794 pub upi: Option<UpdateSetupIntentPaymentMethodOptionsUpi>,
8795 #[serde(skip_serializing_if = "Option::is_none")]
8797 pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
8798}
8799#[cfg(feature = "redact-generated-debug")]
8800impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptions {
8801 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8802 f.debug_struct("UpdateSetupIntentPaymentMethodOptions").finish_non_exhaustive()
8803 }
8804}
8805impl UpdateSetupIntentPaymentMethodOptions {
8806 pub fn new() -> Self {
8807 Self {
8808 acss_debit: None,
8809 amazon_pay: None,
8810 bacs_debit: None,
8811 card: None,
8812 card_present: None,
8813 klarna: None,
8814 link: None,
8815 paypal: None,
8816 payto: None,
8817 pix: None,
8818 sepa_debit: None,
8819 upi: None,
8820 us_bank_account: None,
8821 }
8822 }
8823}
8824impl Default for UpdateSetupIntentPaymentMethodOptions {
8825 fn default() -> Self {
8826 Self::new()
8827 }
8828}
8829#[derive(Clone, Eq, PartialEq)]
8831#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8832#[derive(serde::Serialize)]
8833pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
8834 #[serde(skip_serializing_if = "Option::is_none")]
8837 pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
8838 #[serde(skip_serializing_if = "Option::is_none")]
8840 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
8841 #[serde(skip_serializing_if = "Option::is_none")]
8843 pub verification_method:
8844 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
8845}
8846#[cfg(feature = "redact-generated-debug")]
8847impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
8848 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8849 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
8850 }
8851}
8852impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
8853 pub fn new() -> Self {
8854 Self { currency: None, mandate_options: None, verification_method: None }
8855 }
8856}
8857impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
8858 fn default() -> Self {
8859 Self::new()
8860 }
8861}
8862#[derive(Clone, Eq, PartialEq)]
8865#[non_exhaustive]
8866pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8867 Cad,
8868 Usd,
8869 Unknown(String),
8871}
8872impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8873 pub fn as_str(&self) -> &str {
8874 use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
8875 match self {
8876 Cad => "cad",
8877 Usd => "usd",
8878 Unknown(v) => v,
8879 }
8880 }
8881}
8882
8883impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8884 type Err = std::convert::Infallible;
8885 fn from_str(s: &str) -> Result<Self, Self::Err> {
8886 use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
8887 match s {
8888 "cad" => Ok(Cad),
8889 "usd" => Ok(Usd),
8890 v => {
8891 tracing::warn!(
8892 "Unknown value '{}' for enum '{}'",
8893 v,
8894 "UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
8895 );
8896 Ok(Unknown(v.to_owned()))
8897 }
8898 }
8899 }
8900}
8901impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8902 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8903 f.write_str(self.as_str())
8904 }
8905}
8906
8907#[cfg(not(feature = "redact-generated-debug"))]
8908impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8909 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8910 f.write_str(self.as_str())
8911 }
8912}
8913#[cfg(feature = "redact-generated-debug")]
8914impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8915 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8916 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency))
8917 .finish_non_exhaustive()
8918 }
8919}
8920impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8921 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8922 where
8923 S: serde::Serializer,
8924 {
8925 serializer.serialize_str(self.as_str())
8926 }
8927}
8928#[cfg(feature = "deserialize")]
8929impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
8930 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8931 use std::str::FromStr;
8932 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8933 Ok(Self::from_str(&s).expect("infallible"))
8934 }
8935}
8936#[derive(Clone, Eq, PartialEq)]
8938#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8939#[derive(serde::Serialize)]
8940pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
8941 #[serde(skip_serializing_if = "Option::is_none")]
8945 pub custom_mandate_url: Option<String>,
8946 #[serde(skip_serializing_if = "Option::is_none")]
8948 pub default_for:
8949 Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
8950 #[serde(skip_serializing_if = "Option::is_none")]
8953 pub interval_description: Option<String>,
8954 #[serde(skip_serializing_if = "Option::is_none")]
8956 pub payment_schedule:
8957 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
8958 #[serde(skip_serializing_if = "Option::is_none")]
8960 pub transaction_type:
8961 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
8962}
8963#[cfg(feature = "redact-generated-debug")]
8964impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
8965 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8966 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions")
8967 .finish_non_exhaustive()
8968 }
8969}
8970impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
8971 pub fn new() -> Self {
8972 Self {
8973 custom_mandate_url: None,
8974 default_for: None,
8975 interval_description: None,
8976 payment_schedule: None,
8977 transaction_type: None,
8978 }
8979 }
8980}
8981impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
8982 fn default() -> Self {
8983 Self::new()
8984 }
8985}
8986#[derive(Clone, Eq, PartialEq)]
8988#[non_exhaustive]
8989pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
8990 Invoice,
8991 Subscription,
8992 Unknown(String),
8994}
8995impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
8996 pub fn as_str(&self) -> &str {
8997 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
8998 match self {
8999 Invoice => "invoice",
9000 Subscription => "subscription",
9001 Unknown(v) => v,
9002 }
9003 }
9004}
9005
9006impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
9007 type Err = std::convert::Infallible;
9008 fn from_str(s: &str) -> Result<Self, Self::Err> {
9009 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
9010 match s {
9011 "invoice" => Ok(Invoice),
9012 "subscription" => Ok(Subscription),
9013 v => {
9014 tracing::warn!(
9015 "Unknown value '{}' for enum '{}'",
9016 v,
9017 "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
9018 );
9019 Ok(Unknown(v.to_owned()))
9020 }
9021 }
9022 }
9023}
9024impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
9025 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9026 f.write_str(self.as_str())
9027 }
9028}
9029
9030#[cfg(not(feature = "redact-generated-debug"))]
9031impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
9032 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9033 f.write_str(self.as_str())
9034 }
9035}
9036#[cfg(feature = "redact-generated-debug")]
9037impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
9038 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9039 f.debug_struct(stringify!(
9040 UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
9041 ))
9042 .finish_non_exhaustive()
9043 }
9044}
9045impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
9046 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9047 where
9048 S: serde::Serializer,
9049 {
9050 serializer.serialize_str(self.as_str())
9051 }
9052}
9053#[cfg(feature = "deserialize")]
9054impl<'de> serde::Deserialize<'de>
9055 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
9056{
9057 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9058 use std::str::FromStr;
9059 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9060 Ok(Self::from_str(&s).expect("infallible"))
9061 }
9062}
9063#[derive(Clone, Eq, PartialEq)]
9065#[non_exhaustive]
9066pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
9067 Combined,
9068 Interval,
9069 Sporadic,
9070 Unknown(String),
9072}
9073impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
9074 pub fn as_str(&self) -> &str {
9075 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
9076 match self {
9077 Combined => "combined",
9078 Interval => "interval",
9079 Sporadic => "sporadic",
9080 Unknown(v) => v,
9081 }
9082 }
9083}
9084
9085impl std::str::FromStr
9086 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9087{
9088 type Err = std::convert::Infallible;
9089 fn from_str(s: &str) -> Result<Self, Self::Err> {
9090 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
9091 match s {
9092 "combined" => Ok(Combined),
9093 "interval" => Ok(Interval),
9094 "sporadic" => Ok(Sporadic),
9095 v => {
9096 tracing::warn!(
9097 "Unknown value '{}' for enum '{}'",
9098 v,
9099 "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
9100 );
9101 Ok(Unknown(v.to_owned()))
9102 }
9103 }
9104 }
9105}
9106impl std::fmt::Display
9107 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9108{
9109 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9110 f.write_str(self.as_str())
9111 }
9112}
9113
9114#[cfg(not(feature = "redact-generated-debug"))]
9115impl std::fmt::Debug
9116 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9117{
9118 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9119 f.write_str(self.as_str())
9120 }
9121}
9122#[cfg(feature = "redact-generated-debug")]
9123impl std::fmt::Debug
9124 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9125{
9126 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9127 f.debug_struct(stringify!(
9128 UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9129 ))
9130 .finish_non_exhaustive()
9131 }
9132}
9133impl serde::Serialize
9134 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9135{
9136 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9137 where
9138 S: serde::Serializer,
9139 {
9140 serializer.serialize_str(self.as_str())
9141 }
9142}
9143#[cfg(feature = "deserialize")]
9144impl<'de> serde::Deserialize<'de>
9145 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
9146{
9147 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9148 use std::str::FromStr;
9149 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9150 Ok(Self::from_str(&s).expect("infallible"))
9151 }
9152}
9153#[derive(Clone, Eq, PartialEq)]
9155#[non_exhaustive]
9156pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
9157 Business,
9158 Personal,
9159 Unknown(String),
9161}
9162impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
9163 pub fn as_str(&self) -> &str {
9164 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
9165 match self {
9166 Business => "business",
9167 Personal => "personal",
9168 Unknown(v) => v,
9169 }
9170 }
9171}
9172
9173impl std::str::FromStr
9174 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9175{
9176 type Err = std::convert::Infallible;
9177 fn from_str(s: &str) -> Result<Self, Self::Err> {
9178 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
9179 match s {
9180 "business" => Ok(Business),
9181 "personal" => Ok(Personal),
9182 v => {
9183 tracing::warn!(
9184 "Unknown value '{}' for enum '{}'",
9185 v,
9186 "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
9187 );
9188 Ok(Unknown(v.to_owned()))
9189 }
9190 }
9191 }
9192}
9193impl std::fmt::Display
9194 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9195{
9196 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9197 f.write_str(self.as_str())
9198 }
9199}
9200
9201#[cfg(not(feature = "redact-generated-debug"))]
9202impl std::fmt::Debug
9203 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9204{
9205 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9206 f.write_str(self.as_str())
9207 }
9208}
9209#[cfg(feature = "redact-generated-debug")]
9210impl std::fmt::Debug
9211 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9212{
9213 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9214 f.debug_struct(stringify!(
9215 UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9216 ))
9217 .finish_non_exhaustive()
9218 }
9219}
9220impl serde::Serialize
9221 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9222{
9223 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9224 where
9225 S: serde::Serializer,
9226 {
9227 serializer.serialize_str(self.as_str())
9228 }
9229}
9230#[cfg(feature = "deserialize")]
9231impl<'de> serde::Deserialize<'de>
9232 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
9233{
9234 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9235 use std::str::FromStr;
9236 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9237 Ok(Self::from_str(&s).expect("infallible"))
9238 }
9239}
9240#[derive(Clone, Eq, PartialEq)]
9242#[non_exhaustive]
9243pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9244 Automatic,
9245 Instant,
9246 Microdeposits,
9247 Unknown(String),
9249}
9250impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9251 pub fn as_str(&self) -> &str {
9252 use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
9253 match self {
9254 Automatic => "automatic",
9255 Instant => "instant",
9256 Microdeposits => "microdeposits",
9257 Unknown(v) => v,
9258 }
9259 }
9260}
9261
9262impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9263 type Err = std::convert::Infallible;
9264 fn from_str(s: &str) -> Result<Self, Self::Err> {
9265 use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
9266 match s {
9267 "automatic" => Ok(Automatic),
9268 "instant" => Ok(Instant),
9269 "microdeposits" => Ok(Microdeposits),
9270 v => {
9271 tracing::warn!(
9272 "Unknown value '{}' for enum '{}'",
9273 v,
9274 "UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
9275 );
9276 Ok(Unknown(v.to_owned()))
9277 }
9278 }
9279 }
9280}
9281impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9282 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9283 f.write_str(self.as_str())
9284 }
9285}
9286
9287#[cfg(not(feature = "redact-generated-debug"))]
9288impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9289 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9290 f.write_str(self.as_str())
9291 }
9292}
9293#[cfg(feature = "redact-generated-debug")]
9294impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9295 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9296 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod))
9297 .finish_non_exhaustive()
9298 }
9299}
9300impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
9301 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9302 where
9303 S: serde::Serializer,
9304 {
9305 serializer.serialize_str(self.as_str())
9306 }
9307}
9308#[cfg(feature = "deserialize")]
9309impl<'de> serde::Deserialize<'de>
9310 for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
9311{
9312 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9313 use std::str::FromStr;
9314 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9315 Ok(Self::from_str(&s).expect("infallible"))
9316 }
9317}
9318#[derive(Clone, Eq, PartialEq)]
9320#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9321#[derive(serde::Serialize)]
9322pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
9323 #[serde(skip_serializing_if = "Option::is_none")]
9325 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
9326}
9327#[cfg(feature = "redact-generated-debug")]
9328impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
9329 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9330 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
9331 }
9332}
9333impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
9334 pub fn new() -> Self {
9335 Self { mandate_options: None }
9336 }
9337}
9338impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
9339 fn default() -> Self {
9340 Self::new()
9341 }
9342}
9343#[derive(Clone, Eq, PartialEq)]
9345#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9346#[derive(serde::Serialize)]
9347pub struct UpdateSetupIntentPaymentMethodOptionsCard {
9348 #[serde(skip_serializing_if = "Option::is_none")]
9350 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
9351 #[serde(skip_serializing_if = "Option::is_none")]
9355 pub moto: Option<bool>,
9356 #[serde(skip_serializing_if = "Option::is_none")]
9360 pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
9361 #[serde(skip_serializing_if = "Option::is_none")]
9366 pub request_three_d_secure:
9367 Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
9368 #[serde(skip_serializing_if = "Option::is_none")]
9371 pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
9372}
9373#[cfg(feature = "redact-generated-debug")]
9374impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCard {
9375 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9376 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCard").finish_non_exhaustive()
9377 }
9378}
9379impl UpdateSetupIntentPaymentMethodOptionsCard {
9380 pub fn new() -> Self {
9381 Self {
9382 mandate_options: None,
9383 moto: None,
9384 network: None,
9385 request_three_d_secure: None,
9386 three_d_secure: None,
9387 }
9388 }
9389}
9390impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
9391 fn default() -> Self {
9392 Self::new()
9393 }
9394}
9395#[derive(Clone, Eq, PartialEq)]
9397#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9398#[derive(serde::Serialize)]
9399pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
9400 pub amount: i64,
9402 pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
9406 pub currency: stripe_types::Currency,
9410 #[serde(skip_serializing_if = "Option::is_none")]
9412 pub description: Option<String>,
9413 #[serde(skip_serializing_if = "Option::is_none")]
9417 pub end_date: Option<stripe_types::Timestamp>,
9418 pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
9420 #[serde(skip_serializing_if = "Option::is_none")]
9425 pub interval_count: Option<u64>,
9426 pub reference: String,
9428 pub start_date: stripe_types::Timestamp,
9430 #[serde(skip_serializing_if = "Option::is_none")]
9432 pub supported_types:
9433 Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
9434}
9435#[cfg(feature = "redact-generated-debug")]
9436impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
9437 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9438 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCardMandateOptions")
9439 .finish_non_exhaustive()
9440 }
9441}
9442impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
9443 pub fn new(
9444 amount: impl Into<i64>,
9445 amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
9446 currency: impl Into<stripe_types::Currency>,
9447 interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
9448 reference: impl Into<String>,
9449 start_date: impl Into<stripe_types::Timestamp>,
9450 ) -> Self {
9451 Self {
9452 amount: amount.into(),
9453 amount_type: amount_type.into(),
9454 currency: currency.into(),
9455 description: None,
9456 end_date: None,
9457 interval: interval.into(),
9458 interval_count: None,
9459 reference: reference.into(),
9460 start_date: start_date.into(),
9461 supported_types: None,
9462 }
9463 }
9464}
9465#[derive(Clone, Eq, PartialEq)]
9469#[non_exhaustive]
9470pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9471 Fixed,
9472 Maximum,
9473 Unknown(String),
9475}
9476impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9477 pub fn as_str(&self) -> &str {
9478 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
9479 match self {
9480 Fixed => "fixed",
9481 Maximum => "maximum",
9482 Unknown(v) => v,
9483 }
9484 }
9485}
9486
9487impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9488 type Err = std::convert::Infallible;
9489 fn from_str(s: &str) -> Result<Self, Self::Err> {
9490 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
9491 match s {
9492 "fixed" => Ok(Fixed),
9493 "maximum" => Ok(Maximum),
9494 v => {
9495 tracing::warn!(
9496 "Unknown value '{}' for enum '{}'",
9497 v,
9498 "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
9499 );
9500 Ok(Unknown(v.to_owned()))
9501 }
9502 }
9503 }
9504}
9505impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9506 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9507 f.write_str(self.as_str())
9508 }
9509}
9510
9511#[cfg(not(feature = "redact-generated-debug"))]
9512impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9513 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9514 f.write_str(self.as_str())
9515 }
9516}
9517#[cfg(feature = "redact-generated-debug")]
9518impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9519 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9520 f.debug_struct(stringify!(
9521 UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
9522 ))
9523 .finish_non_exhaustive()
9524 }
9525}
9526impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
9527 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9528 where
9529 S: serde::Serializer,
9530 {
9531 serializer.serialize_str(self.as_str())
9532 }
9533}
9534#[cfg(feature = "deserialize")]
9535impl<'de> serde::Deserialize<'de>
9536 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
9537{
9538 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9539 use std::str::FromStr;
9540 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9541 Ok(Self::from_str(&s).expect("infallible"))
9542 }
9543}
9544#[derive(Clone, Eq, PartialEq)]
9546#[non_exhaustive]
9547pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9548 Day,
9549 Month,
9550 Sporadic,
9551 Week,
9552 Year,
9553 Unknown(String),
9555}
9556impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9557 pub fn as_str(&self) -> &str {
9558 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
9559 match self {
9560 Day => "day",
9561 Month => "month",
9562 Sporadic => "sporadic",
9563 Week => "week",
9564 Year => "year",
9565 Unknown(v) => v,
9566 }
9567 }
9568}
9569
9570impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9571 type Err = std::convert::Infallible;
9572 fn from_str(s: &str) -> Result<Self, Self::Err> {
9573 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
9574 match s {
9575 "day" => Ok(Day),
9576 "month" => Ok(Month),
9577 "sporadic" => Ok(Sporadic),
9578 "week" => Ok(Week),
9579 "year" => Ok(Year),
9580 v => {
9581 tracing::warn!(
9582 "Unknown value '{}' for enum '{}'",
9583 v,
9584 "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
9585 );
9586 Ok(Unknown(v.to_owned()))
9587 }
9588 }
9589 }
9590}
9591impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9592 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9593 f.write_str(self.as_str())
9594 }
9595}
9596
9597#[cfg(not(feature = "redact-generated-debug"))]
9598impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9599 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9600 f.write_str(self.as_str())
9601 }
9602}
9603#[cfg(feature = "redact-generated-debug")]
9604impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9605 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9606 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval))
9607 .finish_non_exhaustive()
9608 }
9609}
9610impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
9611 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9612 where
9613 S: serde::Serializer,
9614 {
9615 serializer.serialize_str(self.as_str())
9616 }
9617}
9618#[cfg(feature = "deserialize")]
9619impl<'de> serde::Deserialize<'de>
9620 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
9621{
9622 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9623 use std::str::FromStr;
9624 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9625 Ok(Self::from_str(&s).expect("infallible"))
9626 }
9627}
9628#[derive(Clone, Eq, PartialEq)]
9630#[non_exhaustive]
9631pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9632 India,
9633 Unknown(String),
9635}
9636impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9637 pub fn as_str(&self) -> &str {
9638 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
9639 match self {
9640 India => "india",
9641 Unknown(v) => v,
9642 }
9643 }
9644}
9645
9646impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9647 type Err = std::convert::Infallible;
9648 fn from_str(s: &str) -> Result<Self, Self::Err> {
9649 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
9650 match s {
9651 "india" => Ok(India),
9652 v => {
9653 tracing::warn!(
9654 "Unknown value '{}' for enum '{}'",
9655 v,
9656 "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
9657 );
9658 Ok(Unknown(v.to_owned()))
9659 }
9660 }
9661 }
9662}
9663impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9664 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9665 f.write_str(self.as_str())
9666 }
9667}
9668
9669#[cfg(not(feature = "redact-generated-debug"))]
9670impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9671 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9672 f.write_str(self.as_str())
9673 }
9674}
9675#[cfg(feature = "redact-generated-debug")]
9676impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9677 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9678 f.debug_struct(stringify!(
9679 UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
9680 ))
9681 .finish_non_exhaustive()
9682 }
9683}
9684impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
9685 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9686 where
9687 S: serde::Serializer,
9688 {
9689 serializer.serialize_str(self.as_str())
9690 }
9691}
9692#[cfg(feature = "deserialize")]
9693impl<'de> serde::Deserialize<'de>
9694 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
9695{
9696 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9697 use std::str::FromStr;
9698 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9699 Ok(Self::from_str(&s).expect("infallible"))
9700 }
9701}
9702#[derive(Clone, Eq, PartialEq)]
9706#[non_exhaustive]
9707pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9708 Amex,
9709 CartesBancaires,
9710 Diners,
9711 Discover,
9712 EftposAu,
9713 Girocard,
9714 Interac,
9715 Jcb,
9716 Link,
9717 Mastercard,
9718 Unionpay,
9719 Unknown,
9720 Visa,
9721 _Unknown(String),
9724}
9725impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9726 pub fn as_str(&self) -> &str {
9727 use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
9728 match self {
9729 Amex => "amex",
9730 CartesBancaires => "cartes_bancaires",
9731 Diners => "diners",
9732 Discover => "discover",
9733 EftposAu => "eftpos_au",
9734 Girocard => "girocard",
9735 Interac => "interac",
9736 Jcb => "jcb",
9737 Link => "link",
9738 Mastercard => "mastercard",
9739 Unionpay => "unionpay",
9740 Unknown => "unknown",
9741 Visa => "visa",
9742 _Unknown(v) => v,
9743 }
9744 }
9745}
9746
9747impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9748 type Err = std::convert::Infallible;
9749 fn from_str(s: &str) -> Result<Self, Self::Err> {
9750 use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
9751 match s {
9752 "amex" => Ok(Amex),
9753 "cartes_bancaires" => Ok(CartesBancaires),
9754 "diners" => Ok(Diners),
9755 "discover" => Ok(Discover),
9756 "eftpos_au" => Ok(EftposAu),
9757 "girocard" => Ok(Girocard),
9758 "interac" => Ok(Interac),
9759 "jcb" => Ok(Jcb),
9760 "link" => Ok(Link),
9761 "mastercard" => Ok(Mastercard),
9762 "unionpay" => Ok(Unionpay),
9763 "unknown" => Ok(Unknown),
9764 "visa" => Ok(Visa),
9765 v => {
9766 tracing::warn!(
9767 "Unknown value '{}' for enum '{}'",
9768 v,
9769 "UpdateSetupIntentPaymentMethodOptionsCardNetwork"
9770 );
9771 Ok(_Unknown(v.to_owned()))
9772 }
9773 }
9774 }
9775}
9776impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9777 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9778 f.write_str(self.as_str())
9779 }
9780}
9781
9782#[cfg(not(feature = "redact-generated-debug"))]
9783impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9784 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9785 f.write_str(self.as_str())
9786 }
9787}
9788#[cfg(feature = "redact-generated-debug")]
9789impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9790 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9791 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardNetwork))
9792 .finish_non_exhaustive()
9793 }
9794}
9795impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9796 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9797 where
9798 S: serde::Serializer,
9799 {
9800 serializer.serialize_str(self.as_str())
9801 }
9802}
9803#[cfg(feature = "deserialize")]
9804impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
9805 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9806 use std::str::FromStr;
9807 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9808 Ok(Self::from_str(&s).expect("infallible"))
9809 }
9810}
9811#[derive(Clone, Eq, PartialEq)]
9816#[non_exhaustive]
9817pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9818 Any,
9819 Automatic,
9820 Challenge,
9821 Unknown(String),
9823}
9824impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9825 pub fn as_str(&self) -> &str {
9826 use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
9827 match self {
9828 Any => "any",
9829 Automatic => "automatic",
9830 Challenge => "challenge",
9831 Unknown(v) => v,
9832 }
9833 }
9834}
9835
9836impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9837 type Err = std::convert::Infallible;
9838 fn from_str(s: &str) -> Result<Self, Self::Err> {
9839 use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
9840 match s {
9841 "any" => Ok(Any),
9842 "automatic" => Ok(Automatic),
9843 "challenge" => Ok(Challenge),
9844 v => {
9845 tracing::warn!(
9846 "Unknown value '{}' for enum '{}'",
9847 v,
9848 "UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
9849 );
9850 Ok(Unknown(v.to_owned()))
9851 }
9852 }
9853 }
9854}
9855impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9856 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9857 f.write_str(self.as_str())
9858 }
9859}
9860
9861#[cfg(not(feature = "redact-generated-debug"))]
9862impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9863 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9864 f.write_str(self.as_str())
9865 }
9866}
9867#[cfg(feature = "redact-generated-debug")]
9868impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9869 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9870 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure))
9871 .finish_non_exhaustive()
9872 }
9873}
9874impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9875 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9876 where
9877 S: serde::Serializer,
9878 {
9879 serializer.serialize_str(self.as_str())
9880 }
9881}
9882#[cfg(feature = "deserialize")]
9883impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
9884 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9885 use std::str::FromStr;
9886 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9887 Ok(Self::from_str(&s).expect("infallible"))
9888 }
9889}
9890#[derive(Clone, Eq, PartialEq)]
9893#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9894#[derive(serde::Serialize)]
9895pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
9896 #[serde(skip_serializing_if = "Option::is_none")]
9898 pub ares_trans_status:
9899 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
9900 #[serde(skip_serializing_if = "Option::is_none")]
9905 pub cryptogram: Option<String>,
9906 #[serde(skip_serializing_if = "Option::is_none")]
9909 pub electronic_commerce_indicator:
9910 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
9911 #[serde(skip_serializing_if = "Option::is_none")]
9915 pub network_options:
9916 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
9917 #[serde(skip_serializing_if = "Option::is_none")]
9920 pub requestor_challenge_indicator: Option<String>,
9921 #[serde(skip_serializing_if = "Option::is_none")]
9924 pub transaction_id: Option<String>,
9925 #[serde(skip_serializing_if = "Option::is_none")]
9927 pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
9928}
9929#[cfg(feature = "redact-generated-debug")]
9930impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
9931 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9932 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure")
9933 .finish_non_exhaustive()
9934 }
9935}
9936impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
9937 pub fn new() -> Self {
9938 Self {
9939 ares_trans_status: None,
9940 cryptogram: None,
9941 electronic_commerce_indicator: None,
9942 network_options: None,
9943 requestor_challenge_indicator: None,
9944 transaction_id: None,
9945 version: None,
9946 }
9947 }
9948}
9949impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
9950 fn default() -> Self {
9951 Self::new()
9952 }
9953}
9954#[derive(Clone, Eq, PartialEq)]
9956#[non_exhaustive]
9957pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
9958 A,
9959 C,
9960 I,
9961 N,
9962 R,
9963 U,
9964 Y,
9965 Unknown(String),
9967}
9968impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
9969 pub fn as_str(&self) -> &str {
9970 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
9971 match self {
9972 A => "A",
9973 C => "C",
9974 I => "I",
9975 N => "N",
9976 R => "R",
9977 U => "U",
9978 Y => "Y",
9979 Unknown(v) => v,
9980 }
9981 }
9982}
9983
9984impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
9985 type Err = std::convert::Infallible;
9986 fn from_str(s: &str) -> Result<Self, Self::Err> {
9987 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
9988 match s {
9989 "A" => Ok(A),
9990 "C" => Ok(C),
9991 "I" => Ok(I),
9992 "N" => Ok(N),
9993 "R" => Ok(R),
9994 "U" => Ok(U),
9995 "Y" => Ok(Y),
9996 v => {
9997 tracing::warn!(
9998 "Unknown value '{}' for enum '{}'",
9999 v,
10000 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
10001 );
10002 Ok(Unknown(v.to_owned()))
10003 }
10004 }
10005 }
10006}
10007impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
10008 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10009 f.write_str(self.as_str())
10010 }
10011}
10012
10013#[cfg(not(feature = "redact-generated-debug"))]
10014impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
10015 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10016 f.write_str(self.as_str())
10017 }
10018}
10019#[cfg(feature = "redact-generated-debug")]
10020impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
10021 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10022 f.debug_struct(stringify!(
10023 UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
10024 ))
10025 .finish_non_exhaustive()
10026 }
10027}
10028impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
10029 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10030 where
10031 S: serde::Serializer,
10032 {
10033 serializer.serialize_str(self.as_str())
10034 }
10035}
10036#[cfg(feature = "deserialize")]
10037impl<'de> serde::Deserialize<'de>
10038 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
10039{
10040 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10041 use std::str::FromStr;
10042 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10043 Ok(Self::from_str(&s).expect("infallible"))
10044 }
10045}
10046#[derive(Clone, Eq, PartialEq)]
10049#[non_exhaustive]
10050pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
10051 V01,
10052 V02,
10053 V05,
10054 V06,
10055 V07,
10056 Unknown(String),
10058}
10059impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
10060 pub fn as_str(&self) -> &str {
10061 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
10062 match self {
10063 V01 => "01",
10064 V02 => "02",
10065 V05 => "05",
10066 V06 => "06",
10067 V07 => "07",
10068 Unknown(v) => v,
10069 }
10070 }
10071}
10072
10073impl std::str::FromStr
10074 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10075{
10076 type Err = std::convert::Infallible;
10077 fn from_str(s: &str) -> Result<Self, Self::Err> {
10078 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
10079 match s {
10080 "01" => Ok(V01),
10081 "02" => Ok(V02),
10082 "05" => Ok(V05),
10083 "06" => Ok(V06),
10084 "07" => Ok(V07),
10085 v => {
10086 tracing::warn!(
10087 "Unknown value '{}' for enum '{}'",
10088 v,
10089 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
10090 );
10091 Ok(Unknown(v.to_owned()))
10092 }
10093 }
10094 }
10095}
10096impl std::fmt::Display
10097 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10098{
10099 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10100 f.write_str(self.as_str())
10101 }
10102}
10103
10104#[cfg(not(feature = "redact-generated-debug"))]
10105impl std::fmt::Debug
10106 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10107{
10108 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10109 f.write_str(self.as_str())
10110 }
10111}
10112#[cfg(feature = "redact-generated-debug")]
10113impl std::fmt::Debug
10114 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10115{
10116 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10117 f.debug_struct(stringify!(
10118 UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10119 ))
10120 .finish_non_exhaustive()
10121 }
10122}
10123impl serde::Serialize
10124 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10125{
10126 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10127 where
10128 S: serde::Serializer,
10129 {
10130 serializer.serialize_str(self.as_str())
10131 }
10132}
10133#[cfg(feature = "deserialize")]
10134impl<'de> serde::Deserialize<'de>
10135 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
10136{
10137 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10138 use std::str::FromStr;
10139 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10140 Ok(Self::from_str(&s).expect("infallible"))
10141 }
10142}
10143#[derive(Clone, Eq, PartialEq)]
10147#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10148#[derive(serde::Serialize)]
10149pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
10150 #[serde(skip_serializing_if = "Option::is_none")]
10152 pub cartes_bancaires:
10153 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
10154}
10155#[cfg(feature = "redact-generated-debug")]
10156impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
10157 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10158 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions")
10159 .finish_non_exhaustive()
10160 }
10161}
10162impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
10163 pub fn new() -> Self {
10164 Self { cartes_bancaires: None }
10165 }
10166}
10167impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
10168 fn default() -> Self {
10169 Self::new()
10170 }
10171}
10172#[derive(Clone, Eq, PartialEq)]
10174#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10175#[derive(serde::Serialize)]
10176pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
10177 pub cb_avalgo:
10181 UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
10182 #[serde(skip_serializing_if = "Option::is_none")]
10187 pub cb_exemption: Option<String>,
10188 #[serde(skip_serializing_if = "Option::is_none")]
10191 pub cb_score: Option<i64>,
10192}
10193#[cfg(feature = "redact-generated-debug")]
10194impl std::fmt::Debug
10195 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires
10196{
10197 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10198 f.debug_struct(
10199 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires",
10200 )
10201 .finish_non_exhaustive()
10202 }
10203}
10204impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
10205 pub fn new(
10206 cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
10207 ) -> Self {
10208 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
10209 }
10210}
10211#[derive(Clone, Eq, PartialEq)]
10215#[non_exhaustive]
10216pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10217{
10218 V0,
10219 V1,
10220 V2,
10221 V3,
10222 V4,
10223 A,
10224 Unknown(String),
10226}
10227impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
10228 pub fn as_str(&self) -> &str {
10229 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
10230 match self {
10231 V0 => "0",
10232 V1 => "1",
10233 V2 => "2",
10234 V3 => "3",
10235 V4 => "4",
10236 A => "A",
10237 Unknown(v) => v,
10238 }
10239 }
10240}
10241
10242impl std::str::FromStr
10243 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10244{
10245 type Err = std::convert::Infallible;
10246 fn from_str(s: &str) -> Result<Self, Self::Err> {
10247 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
10248 match s {
10249 "0" => Ok(V0),
10250 "1" => Ok(V1),
10251 "2" => Ok(V2),
10252 "3" => Ok(V3),
10253 "4" => Ok(V4),
10254 "A" => Ok(A),
10255 v => {
10256 tracing::warn!(
10257 "Unknown value '{}' for enum '{}'",
10258 v,
10259 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
10260 );
10261 Ok(Unknown(v.to_owned()))
10262 }
10263 }
10264 }
10265}
10266impl std::fmt::Display
10267 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10268{
10269 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10270 f.write_str(self.as_str())
10271 }
10272}
10273
10274#[cfg(not(feature = "redact-generated-debug"))]
10275impl std::fmt::Debug
10276 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10277{
10278 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10279 f.write_str(self.as_str())
10280 }
10281}
10282#[cfg(feature = "redact-generated-debug")]
10283impl std::fmt::Debug
10284 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10285{
10286 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10287 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo)).finish_non_exhaustive()
10288 }
10289}
10290impl serde::Serialize
10291 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10292{
10293 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10294 where
10295 S: serde::Serializer,
10296 {
10297 serializer.serialize_str(self.as_str())
10298 }
10299}
10300#[cfg(feature = "deserialize")]
10301impl<'de> serde::Deserialize<'de>
10302 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
10303{
10304 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10305 use std::str::FromStr;
10306 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10307 Ok(Self::from_str(&s).expect("infallible"))
10308 }
10309}
10310#[derive(Clone, Eq, PartialEq)]
10312#[non_exhaustive]
10313pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10314 V1_0_2,
10315 V2_1_0,
10316 V2_2_0,
10317 V2_3_0,
10318 V2_3_1,
10319 Unknown(String),
10321}
10322impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10323 pub fn as_str(&self) -> &str {
10324 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
10325 match self {
10326 V1_0_2 => "1.0.2",
10327 V2_1_0 => "2.1.0",
10328 V2_2_0 => "2.2.0",
10329 V2_3_0 => "2.3.0",
10330 V2_3_1 => "2.3.1",
10331 Unknown(v) => v,
10332 }
10333 }
10334}
10335
10336impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10337 type Err = std::convert::Infallible;
10338 fn from_str(s: &str) -> Result<Self, Self::Err> {
10339 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
10340 match s {
10341 "1.0.2" => Ok(V1_0_2),
10342 "2.1.0" => Ok(V2_1_0),
10343 "2.2.0" => Ok(V2_2_0),
10344 "2.3.0" => Ok(V2_3_0),
10345 "2.3.1" => Ok(V2_3_1),
10346 v => {
10347 tracing::warn!(
10348 "Unknown value '{}' for enum '{}'",
10349 v,
10350 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
10351 );
10352 Ok(Unknown(v.to_owned()))
10353 }
10354 }
10355 }
10356}
10357impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10358 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10359 f.write_str(self.as_str())
10360 }
10361}
10362
10363#[cfg(not(feature = "redact-generated-debug"))]
10364impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10365 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10366 f.write_str(self.as_str())
10367 }
10368}
10369#[cfg(feature = "redact-generated-debug")]
10370impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10371 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10372 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion))
10373 .finish_non_exhaustive()
10374 }
10375}
10376impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10377 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10378 where
10379 S: serde::Serializer,
10380 {
10381 serializer.serialize_str(self.as_str())
10382 }
10383}
10384#[cfg(feature = "deserialize")]
10385impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
10386 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10387 use std::str::FromStr;
10388 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10389 Ok(Self::from_str(&s).expect("infallible"))
10390 }
10391}
10392#[derive(Clone, Eq, PartialEq)]
10394#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10395#[derive(serde::Serialize)]
10396pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
10397 #[serde(skip_serializing_if = "Option::is_none")]
10399 pub currency: Option<stripe_types::Currency>,
10400 #[serde(skip_serializing_if = "Option::is_none")]
10402 pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
10403 #[serde(skip_serializing_if = "Option::is_none")]
10405 pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
10406 #[serde(skip_serializing_if = "Option::is_none")]
10408 pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
10409}
10410#[cfg(feature = "redact-generated-debug")]
10411impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarna {
10412 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10413 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsKlarna").finish_non_exhaustive()
10414 }
10415}
10416impl UpdateSetupIntentPaymentMethodOptionsKlarna {
10417 pub fn new() -> Self {
10418 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
10419 }
10420}
10421impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
10422 fn default() -> Self {
10423 Self::new()
10424 }
10425}
10426#[derive(Clone, Eq, PartialEq)]
10428#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10429#[derive(serde::Serialize)]
10430pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
10431 #[serde(skip_serializing_if = "Option::is_none")]
10434 pub average_amount: Option<i64>,
10435 #[serde(skip_serializing_if = "Option::is_none")]
10438 pub maximum_amount: Option<i64>,
10439 #[serde(skip_serializing_if = "Option::is_none")]
10442 pub minimum_amount: Option<i64>,
10443 #[serde(skip_serializing_if = "Option::is_none")]
10445 pub purchase_interval:
10446 Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
10447 #[serde(skip_serializing_if = "Option::is_none")]
10449 pub purchase_interval_count: Option<u64>,
10450}
10451#[cfg(feature = "redact-generated-debug")]
10452impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
10453 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10454 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand")
10455 .finish_non_exhaustive()
10456 }
10457}
10458impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
10459 pub fn new() -> Self {
10460 Self {
10461 average_amount: None,
10462 maximum_amount: None,
10463 minimum_amount: None,
10464 purchase_interval: None,
10465 purchase_interval_count: None,
10466 }
10467 }
10468}
10469impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
10470 fn default() -> Self {
10471 Self::new()
10472 }
10473}
10474#[derive(Clone, Eq, PartialEq)]
10476#[non_exhaustive]
10477pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10478 Day,
10479 Month,
10480 Week,
10481 Year,
10482 Unknown(String),
10484}
10485impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10486 pub fn as_str(&self) -> &str {
10487 use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
10488 match self {
10489 Day => "day",
10490 Month => "month",
10491 Week => "week",
10492 Year => "year",
10493 Unknown(v) => v,
10494 }
10495 }
10496}
10497
10498impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10499 type Err = std::convert::Infallible;
10500 fn from_str(s: &str) -> Result<Self, Self::Err> {
10501 use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
10502 match s {
10503 "day" => Ok(Day),
10504 "month" => Ok(Month),
10505 "week" => Ok(Week),
10506 "year" => Ok(Year),
10507 v => {
10508 tracing::warn!(
10509 "Unknown value '{}' for enum '{}'",
10510 v,
10511 "UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
10512 );
10513 Ok(Unknown(v.to_owned()))
10514 }
10515 }
10516 }
10517}
10518impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10519 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10520 f.write_str(self.as_str())
10521 }
10522}
10523
10524#[cfg(not(feature = "redact-generated-debug"))]
10525impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10526 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10527 f.write_str(self.as_str())
10528 }
10529}
10530#[cfg(feature = "redact-generated-debug")]
10531impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10532 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10533 f.debug_struct(stringify!(
10534 UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
10535 ))
10536 .finish_non_exhaustive()
10537 }
10538}
10539impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
10540 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10541 where
10542 S: serde::Serializer,
10543 {
10544 serializer.serialize_str(self.as_str())
10545 }
10546}
10547#[cfg(feature = "deserialize")]
10548impl<'de> serde::Deserialize<'de>
10549 for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
10550{
10551 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10552 use std::str::FromStr;
10553 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10554 Ok(Self::from_str(&s).expect("infallible"))
10555 }
10556}
10557#[derive(Clone, Eq, PartialEq)]
10559#[non_exhaustive]
10560pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10561 CsMinusCz,
10562 DaMinusDk,
10563 DeMinusAt,
10564 DeMinusCh,
10565 DeMinusDe,
10566 ElMinusGr,
10567 EnMinusAt,
10568 EnMinusAu,
10569 EnMinusBe,
10570 EnMinusCa,
10571 EnMinusCh,
10572 EnMinusCz,
10573 EnMinusDe,
10574 EnMinusDk,
10575 EnMinusEs,
10576 EnMinusFi,
10577 EnMinusFr,
10578 EnMinusGb,
10579 EnMinusGr,
10580 EnMinusIe,
10581 EnMinusIt,
10582 EnMinusNl,
10583 EnMinusNo,
10584 EnMinusNz,
10585 EnMinusPl,
10586 EnMinusPt,
10587 EnMinusRo,
10588 EnMinusSe,
10589 EnMinusUs,
10590 EsMinusEs,
10591 EsMinusUs,
10592 FiMinusFi,
10593 FrMinusBe,
10594 FrMinusCa,
10595 FrMinusCh,
10596 FrMinusFr,
10597 ItMinusCh,
10598 ItMinusIt,
10599 NbMinusNo,
10600 NlMinusBe,
10601 NlMinusNl,
10602 PlMinusPl,
10603 PtMinusPt,
10604 RoMinusRo,
10605 SvMinusFi,
10606 SvMinusSe,
10607 Unknown(String),
10609}
10610impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10611 pub fn as_str(&self) -> &str {
10612 use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
10613 match self {
10614 CsMinusCz => "cs-CZ",
10615 DaMinusDk => "da-DK",
10616 DeMinusAt => "de-AT",
10617 DeMinusCh => "de-CH",
10618 DeMinusDe => "de-DE",
10619 ElMinusGr => "el-GR",
10620 EnMinusAt => "en-AT",
10621 EnMinusAu => "en-AU",
10622 EnMinusBe => "en-BE",
10623 EnMinusCa => "en-CA",
10624 EnMinusCh => "en-CH",
10625 EnMinusCz => "en-CZ",
10626 EnMinusDe => "en-DE",
10627 EnMinusDk => "en-DK",
10628 EnMinusEs => "en-ES",
10629 EnMinusFi => "en-FI",
10630 EnMinusFr => "en-FR",
10631 EnMinusGb => "en-GB",
10632 EnMinusGr => "en-GR",
10633 EnMinusIe => "en-IE",
10634 EnMinusIt => "en-IT",
10635 EnMinusNl => "en-NL",
10636 EnMinusNo => "en-NO",
10637 EnMinusNz => "en-NZ",
10638 EnMinusPl => "en-PL",
10639 EnMinusPt => "en-PT",
10640 EnMinusRo => "en-RO",
10641 EnMinusSe => "en-SE",
10642 EnMinusUs => "en-US",
10643 EsMinusEs => "es-ES",
10644 EsMinusUs => "es-US",
10645 FiMinusFi => "fi-FI",
10646 FrMinusBe => "fr-BE",
10647 FrMinusCa => "fr-CA",
10648 FrMinusCh => "fr-CH",
10649 FrMinusFr => "fr-FR",
10650 ItMinusCh => "it-CH",
10651 ItMinusIt => "it-IT",
10652 NbMinusNo => "nb-NO",
10653 NlMinusBe => "nl-BE",
10654 NlMinusNl => "nl-NL",
10655 PlMinusPl => "pl-PL",
10656 PtMinusPt => "pt-PT",
10657 RoMinusRo => "ro-RO",
10658 SvMinusFi => "sv-FI",
10659 SvMinusSe => "sv-SE",
10660 Unknown(v) => v,
10661 }
10662 }
10663}
10664
10665impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10666 type Err = std::convert::Infallible;
10667 fn from_str(s: &str) -> Result<Self, Self::Err> {
10668 use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
10669 match s {
10670 "cs-CZ" => Ok(CsMinusCz),
10671 "da-DK" => Ok(DaMinusDk),
10672 "de-AT" => Ok(DeMinusAt),
10673 "de-CH" => Ok(DeMinusCh),
10674 "de-DE" => Ok(DeMinusDe),
10675 "el-GR" => Ok(ElMinusGr),
10676 "en-AT" => Ok(EnMinusAt),
10677 "en-AU" => Ok(EnMinusAu),
10678 "en-BE" => Ok(EnMinusBe),
10679 "en-CA" => Ok(EnMinusCa),
10680 "en-CH" => Ok(EnMinusCh),
10681 "en-CZ" => Ok(EnMinusCz),
10682 "en-DE" => Ok(EnMinusDe),
10683 "en-DK" => Ok(EnMinusDk),
10684 "en-ES" => Ok(EnMinusEs),
10685 "en-FI" => Ok(EnMinusFi),
10686 "en-FR" => Ok(EnMinusFr),
10687 "en-GB" => Ok(EnMinusGb),
10688 "en-GR" => Ok(EnMinusGr),
10689 "en-IE" => Ok(EnMinusIe),
10690 "en-IT" => Ok(EnMinusIt),
10691 "en-NL" => Ok(EnMinusNl),
10692 "en-NO" => Ok(EnMinusNo),
10693 "en-NZ" => Ok(EnMinusNz),
10694 "en-PL" => Ok(EnMinusPl),
10695 "en-PT" => Ok(EnMinusPt),
10696 "en-RO" => Ok(EnMinusRo),
10697 "en-SE" => Ok(EnMinusSe),
10698 "en-US" => Ok(EnMinusUs),
10699 "es-ES" => Ok(EsMinusEs),
10700 "es-US" => Ok(EsMinusUs),
10701 "fi-FI" => Ok(FiMinusFi),
10702 "fr-BE" => Ok(FrMinusBe),
10703 "fr-CA" => Ok(FrMinusCa),
10704 "fr-CH" => Ok(FrMinusCh),
10705 "fr-FR" => Ok(FrMinusFr),
10706 "it-CH" => Ok(ItMinusCh),
10707 "it-IT" => Ok(ItMinusIt),
10708 "nb-NO" => Ok(NbMinusNo),
10709 "nl-BE" => Ok(NlMinusBe),
10710 "nl-NL" => Ok(NlMinusNl),
10711 "pl-PL" => Ok(PlMinusPl),
10712 "pt-PT" => Ok(PtMinusPt),
10713 "ro-RO" => Ok(RoMinusRo),
10714 "sv-FI" => Ok(SvMinusFi),
10715 "sv-SE" => Ok(SvMinusSe),
10716 v => {
10717 tracing::warn!(
10718 "Unknown value '{}' for enum '{}'",
10719 v,
10720 "UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
10721 );
10722 Ok(Unknown(v.to_owned()))
10723 }
10724 }
10725 }
10726}
10727impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10728 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10729 f.write_str(self.as_str())
10730 }
10731}
10732
10733#[cfg(not(feature = "redact-generated-debug"))]
10734impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10735 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10736 f.write_str(self.as_str())
10737 }
10738}
10739#[cfg(feature = "redact-generated-debug")]
10740impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10741 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10742 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale))
10743 .finish_non_exhaustive()
10744 }
10745}
10746impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10747 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10748 where
10749 S: serde::Serializer,
10750 {
10751 serializer.serialize_str(self.as_str())
10752 }
10753}
10754#[cfg(feature = "deserialize")]
10755impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
10756 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10757 use std::str::FromStr;
10758 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10759 Ok(Self::from_str(&s).expect("infallible"))
10760 }
10761}
10762#[derive(Clone, Eq, PartialEq)]
10764#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10765#[derive(serde::Serialize)]
10766pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
10767 pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
10769 #[serde(skip_serializing_if = "Option::is_none")]
10772 pub interval_count: Option<u64>,
10773 #[serde(skip_serializing_if = "Option::is_none")]
10775 pub name: Option<String>,
10776 pub next_billing: SubscriptionNextBillingParam,
10778 pub reference: String,
10781}
10782#[cfg(feature = "redact-generated-debug")]
10783impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
10784 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10785 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions")
10786 .finish_non_exhaustive()
10787 }
10788}
10789impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
10790 pub fn new(
10791 interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
10792 next_billing: impl Into<SubscriptionNextBillingParam>,
10793 reference: impl Into<String>,
10794 ) -> Self {
10795 Self {
10796 interval: interval.into(),
10797 interval_count: None,
10798 name: None,
10799 next_billing: next_billing.into(),
10800 reference: reference.into(),
10801 }
10802 }
10803}
10804#[derive(Clone, Eq, PartialEq)]
10806#[non_exhaustive]
10807pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10808 Day,
10809 Month,
10810 Week,
10811 Year,
10812 Unknown(String),
10814}
10815impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10816 pub fn as_str(&self) -> &str {
10817 use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
10818 match self {
10819 Day => "day",
10820 Month => "month",
10821 Week => "week",
10822 Year => "year",
10823 Unknown(v) => v,
10824 }
10825 }
10826}
10827
10828impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10829 type Err = std::convert::Infallible;
10830 fn from_str(s: &str) -> Result<Self, Self::Err> {
10831 use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
10832 match s {
10833 "day" => Ok(Day),
10834 "month" => Ok(Month),
10835 "week" => Ok(Week),
10836 "year" => Ok(Year),
10837 v => {
10838 tracing::warn!(
10839 "Unknown value '{}' for enum '{}'",
10840 v,
10841 "UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
10842 );
10843 Ok(Unknown(v.to_owned()))
10844 }
10845 }
10846 }
10847}
10848impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10849 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10850 f.write_str(self.as_str())
10851 }
10852}
10853
10854#[cfg(not(feature = "redact-generated-debug"))]
10855impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10856 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10857 f.write_str(self.as_str())
10858 }
10859}
10860#[cfg(feature = "redact-generated-debug")]
10861impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10862 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10863 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval))
10864 .finish_non_exhaustive()
10865 }
10866}
10867impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
10868 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10869 where
10870 S: serde::Serializer,
10871 {
10872 serializer.serialize_str(self.as_str())
10873 }
10874}
10875#[cfg(feature = "deserialize")]
10876impl<'de> serde::Deserialize<'de>
10877 for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
10878{
10879 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10880 use std::str::FromStr;
10881 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10882 Ok(Self::from_str(&s).expect("infallible"))
10883 }
10884}
10885#[derive(Clone, Eq, PartialEq)]
10887#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10888#[derive(serde::Serialize)]
10889pub struct UpdateSetupIntentPaymentMethodOptionsPayto {
10890 #[serde(skip_serializing_if = "Option::is_none")]
10892 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
10893}
10894#[cfg(feature = "redact-generated-debug")]
10895impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPayto {
10896 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10897 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsPayto").finish_non_exhaustive()
10898 }
10899}
10900impl UpdateSetupIntentPaymentMethodOptionsPayto {
10901 pub fn new() -> Self {
10902 Self { mandate_options: None }
10903 }
10904}
10905impl Default for UpdateSetupIntentPaymentMethodOptionsPayto {
10906 fn default() -> Self {
10907 Self::new()
10908 }
10909}
10910#[derive(Clone, Eq, PartialEq)]
10912#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10913#[derive(serde::Serialize)]
10914pub struct UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
10915 #[serde(skip_serializing_if = "Option::is_none")]
10917 pub amount: Option<i64>,
10918 #[serde(skip_serializing_if = "Option::is_none")]
10922 pub amount_type: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
10923 #[serde(skip_serializing_if = "Option::is_none")]
10925 pub end_date: Option<String>,
10926 #[serde(skip_serializing_if = "Option::is_none")]
10928 pub payment_schedule:
10929 Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
10930 #[serde(skip_serializing_if = "Option::is_none")]
10934 pub payments_per_period: Option<i64>,
10935 #[serde(skip_serializing_if = "Option::is_none")]
10937 pub purpose: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
10938 #[serde(skip_serializing_if = "Option::is_none")]
10940 pub start_date: Option<String>,
10941}
10942#[cfg(feature = "redact-generated-debug")]
10943impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
10944 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10945 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions")
10946 .finish_non_exhaustive()
10947 }
10948}
10949impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
10950 pub fn new() -> Self {
10951 Self {
10952 amount: None,
10953 amount_type: None,
10954 end_date: None,
10955 payment_schedule: None,
10956 payments_per_period: None,
10957 purpose: None,
10958 start_date: None,
10959 }
10960 }
10961}
10962impl Default for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
10963 fn default() -> Self {
10964 Self::new()
10965 }
10966}
10967#[derive(Clone, Eq, PartialEq)]
10971#[non_exhaustive]
10972pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
10973 Fixed,
10974 Maximum,
10975 Unknown(String),
10977}
10978impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
10979 pub fn as_str(&self) -> &str {
10980 use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
10981 match self {
10982 Fixed => "fixed",
10983 Maximum => "maximum",
10984 Unknown(v) => v,
10985 }
10986 }
10987}
10988
10989impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
10990 type Err = std::convert::Infallible;
10991 fn from_str(s: &str) -> Result<Self, Self::Err> {
10992 use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
10993 match s {
10994 "fixed" => Ok(Fixed),
10995 "maximum" => Ok(Maximum),
10996 v => {
10997 tracing::warn!(
10998 "Unknown value '{}' for enum '{}'",
10999 v,
11000 "UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
11001 );
11002 Ok(Unknown(v.to_owned()))
11003 }
11004 }
11005 }
11006}
11007impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
11008 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11009 f.write_str(self.as_str())
11010 }
11011}
11012
11013#[cfg(not(feature = "redact-generated-debug"))]
11014impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
11015 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11016 f.write_str(self.as_str())
11017 }
11018}
11019#[cfg(feature = "redact-generated-debug")]
11020impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
11021 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11022 f.debug_struct(stringify!(
11023 UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
11024 ))
11025 .finish_non_exhaustive()
11026 }
11027}
11028impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
11029 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11030 where
11031 S: serde::Serializer,
11032 {
11033 serializer.serialize_str(self.as_str())
11034 }
11035}
11036#[cfg(feature = "deserialize")]
11037impl<'de> serde::Deserialize<'de>
11038 for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
11039{
11040 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11041 use std::str::FromStr;
11042 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11043 Ok(Self::from_str(&s).expect("infallible"))
11044 }
11045}
11046#[derive(Clone, Eq, PartialEq)]
11048#[non_exhaustive]
11049pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11050 Adhoc,
11051 Annual,
11052 Daily,
11053 Fortnightly,
11054 Monthly,
11055 Quarterly,
11056 SemiAnnual,
11057 Weekly,
11058 Unknown(String),
11060}
11061impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11062 pub fn as_str(&self) -> &str {
11063 use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
11064 match self {
11065 Adhoc => "adhoc",
11066 Annual => "annual",
11067 Daily => "daily",
11068 Fortnightly => "fortnightly",
11069 Monthly => "monthly",
11070 Quarterly => "quarterly",
11071 SemiAnnual => "semi_annual",
11072 Weekly => "weekly",
11073 Unknown(v) => v,
11074 }
11075 }
11076}
11077
11078impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11079 type Err = std::convert::Infallible;
11080 fn from_str(s: &str) -> Result<Self, Self::Err> {
11081 use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
11082 match s {
11083 "adhoc" => Ok(Adhoc),
11084 "annual" => Ok(Annual),
11085 "daily" => Ok(Daily),
11086 "fortnightly" => Ok(Fortnightly),
11087 "monthly" => Ok(Monthly),
11088 "quarterly" => Ok(Quarterly),
11089 "semi_annual" => Ok(SemiAnnual),
11090 "weekly" => Ok(Weekly),
11091 v => {
11092 tracing::warn!(
11093 "Unknown value '{}' for enum '{}'",
11094 v,
11095 "UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
11096 );
11097 Ok(Unknown(v.to_owned()))
11098 }
11099 }
11100 }
11101}
11102impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11103 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11104 f.write_str(self.as_str())
11105 }
11106}
11107
11108#[cfg(not(feature = "redact-generated-debug"))]
11109impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11110 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11111 f.write_str(self.as_str())
11112 }
11113}
11114#[cfg(feature = "redact-generated-debug")]
11115impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11116 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11117 f.debug_struct(stringify!(
11118 UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
11119 ))
11120 .finish_non_exhaustive()
11121 }
11122}
11123impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
11124 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11125 where
11126 S: serde::Serializer,
11127 {
11128 serializer.serialize_str(self.as_str())
11129 }
11130}
11131#[cfg(feature = "deserialize")]
11132impl<'de> serde::Deserialize<'de>
11133 for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
11134{
11135 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11136 use std::str::FromStr;
11137 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11138 Ok(Self::from_str(&s).expect("infallible"))
11139 }
11140}
11141#[derive(Clone, Eq, PartialEq)]
11143#[non_exhaustive]
11144pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11145 DependantSupport,
11146 Government,
11147 Loan,
11148 Mortgage,
11149 Other,
11150 Pension,
11151 Personal,
11152 Retail,
11153 Salary,
11154 Tax,
11155 Utility,
11156 Unknown(String),
11158}
11159impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11160 pub fn as_str(&self) -> &str {
11161 use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
11162 match self {
11163 DependantSupport => "dependant_support",
11164 Government => "government",
11165 Loan => "loan",
11166 Mortgage => "mortgage",
11167 Other => "other",
11168 Pension => "pension",
11169 Personal => "personal",
11170 Retail => "retail",
11171 Salary => "salary",
11172 Tax => "tax",
11173 Utility => "utility",
11174 Unknown(v) => v,
11175 }
11176 }
11177}
11178
11179impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11180 type Err = std::convert::Infallible;
11181 fn from_str(s: &str) -> Result<Self, Self::Err> {
11182 use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
11183 match s {
11184 "dependant_support" => Ok(DependantSupport),
11185 "government" => Ok(Government),
11186 "loan" => Ok(Loan),
11187 "mortgage" => Ok(Mortgage),
11188 "other" => Ok(Other),
11189 "pension" => Ok(Pension),
11190 "personal" => Ok(Personal),
11191 "retail" => Ok(Retail),
11192 "salary" => Ok(Salary),
11193 "tax" => Ok(Tax),
11194 "utility" => Ok(Utility),
11195 v => {
11196 tracing::warn!(
11197 "Unknown value '{}' for enum '{}'",
11198 v,
11199 "UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
11200 );
11201 Ok(Unknown(v.to_owned()))
11202 }
11203 }
11204 }
11205}
11206impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11207 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11208 f.write_str(self.as_str())
11209 }
11210}
11211
11212#[cfg(not(feature = "redact-generated-debug"))]
11213impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11214 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11215 f.write_str(self.as_str())
11216 }
11217}
11218#[cfg(feature = "redact-generated-debug")]
11219impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11220 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11221 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose))
11222 .finish_non_exhaustive()
11223 }
11224}
11225impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
11226 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11227 where
11228 S: serde::Serializer,
11229 {
11230 serializer.serialize_str(self.as_str())
11231 }
11232}
11233#[cfg(feature = "deserialize")]
11234impl<'de> serde::Deserialize<'de>
11235 for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
11236{
11237 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11238 use std::str::FromStr;
11239 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11240 Ok(Self::from_str(&s).expect("infallible"))
11241 }
11242}
11243#[derive(Clone, Eq, PartialEq)]
11245#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11246#[derive(serde::Serialize)]
11247pub struct UpdateSetupIntentPaymentMethodOptionsPix {
11248 #[serde(skip_serializing_if = "Option::is_none")]
11250 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsPixMandateOptions>,
11251}
11252#[cfg(feature = "redact-generated-debug")]
11253impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPix {
11254 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11255 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsPix").finish_non_exhaustive()
11256 }
11257}
11258impl UpdateSetupIntentPaymentMethodOptionsPix {
11259 pub fn new() -> Self {
11260 Self { mandate_options: None }
11261 }
11262}
11263impl Default for UpdateSetupIntentPaymentMethodOptionsPix {
11264 fn default() -> Self {
11265 Self::new()
11266 }
11267}
11268#[derive(Clone, Eq, PartialEq)]
11270#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11271#[derive(serde::Serialize)]
11272pub struct UpdateSetupIntentPaymentMethodOptionsPixMandateOptions {
11273 #[serde(skip_serializing_if = "Option::is_none")]
11277 pub amount: Option<i64>,
11278 #[serde(skip_serializing_if = "Option::is_none")]
11280 pub amount_includes_iof:
11281 Option<UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof>,
11282 #[serde(skip_serializing_if = "Option::is_none")]
11284 pub amount_type: Option<UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType>,
11285 #[serde(skip_serializing_if = "Option::is_none")]
11288 pub currency: Option<stripe_types::Currency>,
11289 #[serde(skip_serializing_if = "Option::is_none")]
11293 pub end_date: Option<String>,
11294 #[serde(skip_serializing_if = "Option::is_none")]
11296 pub payment_schedule:
11297 Option<UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule>,
11298 #[serde(skip_serializing_if = "Option::is_none")]
11300 pub reference: Option<String>,
11301 #[serde(skip_serializing_if = "Option::is_none")]
11305 pub start_date: Option<String>,
11306}
11307#[cfg(feature = "redact-generated-debug")]
11308impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptions {
11309 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11310 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsPixMandateOptions")
11311 .finish_non_exhaustive()
11312 }
11313}
11314impl UpdateSetupIntentPaymentMethodOptionsPixMandateOptions {
11315 pub fn new() -> Self {
11316 Self {
11317 amount: None,
11318 amount_includes_iof: None,
11319 amount_type: None,
11320 currency: None,
11321 end_date: None,
11322 payment_schedule: None,
11323 reference: None,
11324 start_date: None,
11325 }
11326 }
11327}
11328impl Default for UpdateSetupIntentPaymentMethodOptionsPixMandateOptions {
11329 fn default() -> Self {
11330 Self::new()
11331 }
11332}
11333#[derive(Clone, Eq, PartialEq)]
11335#[non_exhaustive]
11336pub enum UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11337 Always,
11338 Never,
11339 Unknown(String),
11341}
11342impl UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11343 pub fn as_str(&self) -> &str {
11344 use UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
11345 match self {
11346 Always => "always",
11347 Never => "never",
11348 Unknown(v) => v,
11349 }
11350 }
11351}
11352
11353impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11354 type Err = std::convert::Infallible;
11355 fn from_str(s: &str) -> Result<Self, Self::Err> {
11356 use UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
11357 match s {
11358 "always" => Ok(Always),
11359 "never" => Ok(Never),
11360 v => {
11361 tracing::warn!(
11362 "Unknown value '{}' for enum '{}'",
11363 v,
11364 "UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof"
11365 );
11366 Ok(Unknown(v.to_owned()))
11367 }
11368 }
11369 }
11370}
11371impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11372 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11373 f.write_str(self.as_str())
11374 }
11375}
11376
11377#[cfg(not(feature = "redact-generated-debug"))]
11378impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11379 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11380 f.write_str(self.as_str())
11381 }
11382}
11383#[cfg(feature = "redact-generated-debug")]
11384impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11385 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11386 f.debug_struct(stringify!(
11387 UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11388 ))
11389 .finish_non_exhaustive()
11390 }
11391}
11392impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11393 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11394 where
11395 S: serde::Serializer,
11396 {
11397 serializer.serialize_str(self.as_str())
11398 }
11399}
11400#[cfg(feature = "deserialize")]
11401impl<'de> serde::Deserialize<'de>
11402 for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11403{
11404 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11405 use std::str::FromStr;
11406 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11407 Ok(Self::from_str(&s).expect("infallible"))
11408 }
11409}
11410#[derive(Clone, Eq, PartialEq)]
11412#[non_exhaustive]
11413pub enum UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11414 Fixed,
11415 Maximum,
11416 Unknown(String),
11418}
11419impl UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11420 pub fn as_str(&self) -> &str {
11421 use UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType::*;
11422 match self {
11423 Fixed => "fixed",
11424 Maximum => "maximum",
11425 Unknown(v) => v,
11426 }
11427 }
11428}
11429
11430impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11431 type Err = std::convert::Infallible;
11432 fn from_str(s: &str) -> Result<Self, Self::Err> {
11433 use UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType::*;
11434 match s {
11435 "fixed" => Ok(Fixed),
11436 "maximum" => Ok(Maximum),
11437 v => {
11438 tracing::warn!(
11439 "Unknown value '{}' for enum '{}'",
11440 v,
11441 "UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType"
11442 );
11443 Ok(Unknown(v.to_owned()))
11444 }
11445 }
11446 }
11447}
11448impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11449 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11450 f.write_str(self.as_str())
11451 }
11452}
11453
11454#[cfg(not(feature = "redact-generated-debug"))]
11455impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11456 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11457 f.write_str(self.as_str())
11458 }
11459}
11460#[cfg(feature = "redact-generated-debug")]
11461impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11462 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11463 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType))
11464 .finish_non_exhaustive()
11465 }
11466}
11467impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
11468 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11469 where
11470 S: serde::Serializer,
11471 {
11472 serializer.serialize_str(self.as_str())
11473 }
11474}
11475#[cfg(feature = "deserialize")]
11476impl<'de> serde::Deserialize<'de>
11477 for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType
11478{
11479 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11480 use std::str::FromStr;
11481 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11482 Ok(Self::from_str(&s).expect("infallible"))
11483 }
11484}
11485#[derive(Clone, Eq, PartialEq)]
11487#[non_exhaustive]
11488pub enum UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11489 Halfyearly,
11490 Monthly,
11491 Quarterly,
11492 Weekly,
11493 Yearly,
11494 Unknown(String),
11496}
11497impl UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11498 pub fn as_str(&self) -> &str {
11499 use UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
11500 match self {
11501 Halfyearly => "halfyearly",
11502 Monthly => "monthly",
11503 Quarterly => "quarterly",
11504 Weekly => "weekly",
11505 Yearly => "yearly",
11506 Unknown(v) => v,
11507 }
11508 }
11509}
11510
11511impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11512 type Err = std::convert::Infallible;
11513 fn from_str(s: &str) -> Result<Self, Self::Err> {
11514 use UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
11515 match s {
11516 "halfyearly" => Ok(Halfyearly),
11517 "monthly" => Ok(Monthly),
11518 "quarterly" => Ok(Quarterly),
11519 "weekly" => Ok(Weekly),
11520 "yearly" => Ok(Yearly),
11521 v => {
11522 tracing::warn!(
11523 "Unknown value '{}' for enum '{}'",
11524 v,
11525 "UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule"
11526 );
11527 Ok(Unknown(v.to_owned()))
11528 }
11529 }
11530 }
11531}
11532impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11533 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11534 f.write_str(self.as_str())
11535 }
11536}
11537
11538#[cfg(not(feature = "redact-generated-debug"))]
11539impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11540 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11541 f.write_str(self.as_str())
11542 }
11543}
11544#[cfg(feature = "redact-generated-debug")]
11545impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11546 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11547 f.debug_struct(stringify!(
11548 UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11549 ))
11550 .finish_non_exhaustive()
11551 }
11552}
11553impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11554 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11555 where
11556 S: serde::Serializer,
11557 {
11558 serializer.serialize_str(self.as_str())
11559 }
11560}
11561#[cfg(feature = "deserialize")]
11562impl<'de> serde::Deserialize<'de>
11563 for UpdateSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11564{
11565 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11566 use std::str::FromStr;
11567 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11568 Ok(Self::from_str(&s).expect("infallible"))
11569 }
11570}
11571#[derive(Clone, Eq, PartialEq)]
11573#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11574#[derive(serde::Serialize)]
11575pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
11576 #[serde(skip_serializing_if = "Option::is_none")]
11578 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
11579}
11580#[cfg(feature = "redact-generated-debug")]
11581impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
11582 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11583 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
11584 }
11585}
11586impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
11587 pub fn new() -> Self {
11588 Self { mandate_options: None }
11589 }
11590}
11591impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
11592 fn default() -> Self {
11593 Self::new()
11594 }
11595}
11596#[derive(Clone, Eq, PartialEq)]
11598#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11599#[derive(serde::Serialize)]
11600pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
11601 #[serde(skip_serializing_if = "Option::is_none")]
11606 pub reference_prefix: Option<String>,
11607}
11608#[cfg(feature = "redact-generated-debug")]
11609impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
11610 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11611 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions")
11612 .finish_non_exhaustive()
11613 }
11614}
11615impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
11616 pub fn new() -> Self {
11617 Self { reference_prefix: None }
11618 }
11619}
11620impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
11621 fn default() -> Self {
11622 Self::new()
11623 }
11624}
11625#[derive(Clone, Eq, PartialEq)]
11627#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11628#[derive(serde::Serialize)]
11629pub struct UpdateSetupIntentPaymentMethodOptionsUpi {
11630 #[serde(skip_serializing_if = "Option::is_none")]
11632 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions>,
11633 #[serde(skip_serializing_if = "Option::is_none")]
11634 pub setup_future_usage: Option<UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage>,
11635}
11636#[cfg(feature = "redact-generated-debug")]
11637impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpi {
11638 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11639 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUpi").finish_non_exhaustive()
11640 }
11641}
11642impl UpdateSetupIntentPaymentMethodOptionsUpi {
11643 pub fn new() -> Self {
11644 Self { mandate_options: None, setup_future_usage: None }
11645 }
11646}
11647impl Default for UpdateSetupIntentPaymentMethodOptionsUpi {
11648 fn default() -> Self {
11649 Self::new()
11650 }
11651}
11652#[derive(Clone, Eq, PartialEq)]
11654#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11655#[derive(serde::Serialize)]
11656pub struct UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
11657 #[serde(skip_serializing_if = "Option::is_none")]
11659 pub amount: Option<i64>,
11660 #[serde(skip_serializing_if = "Option::is_none")]
11664 pub amount_type: Option<UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType>,
11665 #[serde(skip_serializing_if = "Option::is_none")]
11667 pub description: Option<String>,
11668 #[serde(skip_serializing_if = "Option::is_none")]
11670 pub end_date: Option<stripe_types::Timestamp>,
11671}
11672#[cfg(feature = "redact-generated-debug")]
11673impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
11674 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11675 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions")
11676 .finish_non_exhaustive()
11677 }
11678}
11679impl UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
11680 pub fn new() -> Self {
11681 Self { amount: None, amount_type: None, description: None, end_date: None }
11682 }
11683}
11684impl Default for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
11685 fn default() -> Self {
11686 Self::new()
11687 }
11688}
11689#[derive(Clone, Eq, PartialEq)]
11693#[non_exhaustive]
11694pub enum UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11695 Fixed,
11696 Maximum,
11697 Unknown(String),
11699}
11700impl UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11701 pub fn as_str(&self) -> &str {
11702 use UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
11703 match self {
11704 Fixed => "fixed",
11705 Maximum => "maximum",
11706 Unknown(v) => v,
11707 }
11708 }
11709}
11710
11711impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11712 type Err = std::convert::Infallible;
11713 fn from_str(s: &str) -> Result<Self, Self::Err> {
11714 use UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
11715 match s {
11716 "fixed" => Ok(Fixed),
11717 "maximum" => Ok(Maximum),
11718 v => {
11719 tracing::warn!(
11720 "Unknown value '{}' for enum '{}'",
11721 v,
11722 "UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType"
11723 );
11724 Ok(Unknown(v.to_owned()))
11725 }
11726 }
11727 }
11728}
11729impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11730 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11731 f.write_str(self.as_str())
11732 }
11733}
11734
11735#[cfg(not(feature = "redact-generated-debug"))]
11736impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11737 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11738 f.write_str(self.as_str())
11739 }
11740}
11741#[cfg(feature = "redact-generated-debug")]
11742impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11743 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11744 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType))
11745 .finish_non_exhaustive()
11746 }
11747}
11748impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
11749 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11750 where
11751 S: serde::Serializer,
11752 {
11753 serializer.serialize_str(self.as_str())
11754 }
11755}
11756#[cfg(feature = "deserialize")]
11757impl<'de> serde::Deserialize<'de>
11758 for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
11759{
11760 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11761 use std::str::FromStr;
11762 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11763 Ok(Self::from_str(&s).expect("infallible"))
11764 }
11765}
11766#[derive(Clone, Eq, PartialEq)]
11767#[non_exhaustive]
11768pub enum UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11769 None,
11770 OffSession,
11771 OnSession,
11772 Unknown(String),
11774}
11775impl UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11776 pub fn as_str(&self) -> &str {
11777 use UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
11778 match self {
11779 None => "none",
11780 OffSession => "off_session",
11781 OnSession => "on_session",
11782 Unknown(v) => v,
11783 }
11784 }
11785}
11786
11787impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11788 type Err = std::convert::Infallible;
11789 fn from_str(s: &str) -> Result<Self, Self::Err> {
11790 use UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
11791 match s {
11792 "none" => Ok(None),
11793 "off_session" => Ok(OffSession),
11794 "on_session" => Ok(OnSession),
11795 v => {
11796 tracing::warn!(
11797 "Unknown value '{}' for enum '{}'",
11798 v,
11799 "UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage"
11800 );
11801 Ok(Unknown(v.to_owned()))
11802 }
11803 }
11804 }
11805}
11806impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11807 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11808 f.write_str(self.as_str())
11809 }
11810}
11811
11812#[cfg(not(feature = "redact-generated-debug"))]
11813impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11814 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11815 f.write_str(self.as_str())
11816 }
11817}
11818#[cfg(feature = "redact-generated-debug")]
11819impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11820 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11821 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage))
11822 .finish_non_exhaustive()
11823 }
11824}
11825impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11826 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11827 where
11828 S: serde::Serializer,
11829 {
11830 serializer.serialize_str(self.as_str())
11831 }
11832}
11833#[cfg(feature = "deserialize")]
11834impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
11835 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11836 use std::str::FromStr;
11837 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11838 Ok(Self::from_str(&s).expect("infallible"))
11839 }
11840}
11841#[derive(Clone, Eq, PartialEq)]
11843#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11844#[derive(serde::Serialize)]
11845pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
11846 #[serde(skip_serializing_if = "Option::is_none")]
11848 pub financial_connections:
11849 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
11850 #[serde(skip_serializing_if = "Option::is_none")]
11852 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
11853 #[serde(skip_serializing_if = "Option::is_none")]
11855 pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
11856 #[serde(skip_serializing_if = "Option::is_none")]
11858 pub verification_method:
11859 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
11860}
11861#[cfg(feature = "redact-generated-debug")]
11862impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
11863 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11864 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccount").finish_non_exhaustive()
11865 }
11866}
11867impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
11868 pub fn new() -> Self {
11869 Self {
11870 financial_connections: None,
11871 mandate_options: None,
11872 networks: None,
11873 verification_method: None,
11874 }
11875 }
11876}
11877impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
11878 fn default() -> Self {
11879 Self::new()
11880 }
11881}
11882#[derive(Clone, Eq, PartialEq)]
11884#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11885#[derive(serde::Serialize)]
11886pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11887 #[serde(skip_serializing_if = "Option::is_none")]
11889 pub filters:
11890 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
11891 #[serde(skip_serializing_if = "Option::is_none")]
11895 pub permissions: Option<
11896 Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
11897 >,
11898 #[serde(skip_serializing_if = "Option::is_none")]
11900 pub prefetch:
11901 Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
11902 #[serde(skip_serializing_if = "Option::is_none")]
11905 pub return_url: Option<String>,
11906}
11907#[cfg(feature = "redact-generated-debug")]
11908impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11909 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11910 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections")
11911 .finish_non_exhaustive()
11912 }
11913}
11914impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11915 pub fn new() -> Self {
11916 Self { filters: None, permissions: None, prefetch: None, return_url: None }
11917 }
11918}
11919impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11920 fn default() -> Self {
11921 Self::new()
11922 }
11923}
11924#[derive(Clone, Eq, PartialEq)]
11926#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11927#[derive(serde::Serialize)]
11928pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
11929 #[serde(skip_serializing_if = "Option::is_none")]
11932pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
11933
11934}
11935#[cfg(feature = "redact-generated-debug")]
11936impl std::fmt::Debug
11937 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
11938{
11939 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11940 f.debug_struct(
11941 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters",
11942 )
11943 .finish_non_exhaustive()
11944 }
11945}
11946impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
11947 pub fn new() -> Self {
11948 Self { account_subcategories: None }
11949 }
11950}
11951impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
11952 fn default() -> Self {
11953 Self::new()
11954 }
11955}
11956#[derive(Clone, Eq, PartialEq)]
11959#[non_exhaustive]
11960pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
11961{
11962 Checking,
11963 Savings,
11964 Unknown(String),
11966}
11967impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11968 pub fn as_str(&self) -> &str {
11969 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
11970 match self {
11971Checking => "checking",
11972Savings => "savings",
11973Unknown(v) => v,
11974
11975 }
11976 }
11977}
11978
11979impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11980 type Err = std::convert::Infallible;
11981 fn from_str(s: &str) -> Result<Self, Self::Err> {
11982 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
11983 match s {
11984 "checking" => Ok(Checking),
11985"savings" => Ok(Savings),
11986v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
11987
11988 }
11989 }
11990}
11991impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11992 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11993 f.write_str(self.as_str())
11994 }
11995}
11996
11997#[cfg(not(feature = "redact-generated-debug"))]
11998impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11999 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12000 f.write_str(self.as_str())
12001 }
12002}
12003#[cfg(feature = "redact-generated-debug")]
12004impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12005 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12006 f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories)).finish_non_exhaustive()
12007 }
12008}
12009impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12010 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
12011 serializer.serialize_str(self.as_str())
12012 }
12013}
12014#[cfg(feature = "deserialize")]
12015impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12016 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12017 use std::str::FromStr;
12018 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12019 Ok(Self::from_str(&s).expect("infallible"))
12020 }
12021}
12022#[derive(Clone, Eq, PartialEq)]
12026#[non_exhaustive]
12027pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12028 Balances,
12029 Ownership,
12030 PaymentMethod,
12031 Transactions,
12032 Unknown(String),
12034}
12035impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12036 pub fn as_str(&self) -> &str {
12037 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12038 match self {
12039 Balances => "balances",
12040 Ownership => "ownership",
12041 PaymentMethod => "payment_method",
12042 Transactions => "transactions",
12043 Unknown(v) => v,
12044 }
12045 }
12046}
12047
12048impl std::str::FromStr
12049 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12050{
12051 type Err = std::convert::Infallible;
12052 fn from_str(s: &str) -> Result<Self, Self::Err> {
12053 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12054 match s {
12055 "balances" => Ok(Balances),
12056 "ownership" => Ok(Ownership),
12057 "payment_method" => Ok(PaymentMethod),
12058 "transactions" => Ok(Transactions),
12059 v => {
12060 tracing::warn!(
12061 "Unknown value '{}' for enum '{}'",
12062 v,
12063 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
12064 );
12065 Ok(Unknown(v.to_owned()))
12066 }
12067 }
12068 }
12069}
12070impl std::fmt::Display
12071 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12072{
12073 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12074 f.write_str(self.as_str())
12075 }
12076}
12077
12078#[cfg(not(feature = "redact-generated-debug"))]
12079impl std::fmt::Debug
12080 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12081{
12082 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12083 f.write_str(self.as_str())
12084 }
12085}
12086#[cfg(feature = "redact-generated-debug")]
12087impl std::fmt::Debug
12088 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12089{
12090 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12091 f.debug_struct(stringify!(
12092 UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12093 ))
12094 .finish_non_exhaustive()
12095 }
12096}
12097impl serde::Serialize
12098 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12099{
12100 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12101 where
12102 S: serde::Serializer,
12103 {
12104 serializer.serialize_str(self.as_str())
12105 }
12106}
12107#[cfg(feature = "deserialize")]
12108impl<'de> serde::Deserialize<'de>
12109 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12110{
12111 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12112 use std::str::FromStr;
12113 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12114 Ok(Self::from_str(&s).expect("infallible"))
12115 }
12116}
12117#[derive(Clone, Eq, PartialEq)]
12119#[non_exhaustive]
12120pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12121 Balances,
12122 Ownership,
12123 Transactions,
12124 Unknown(String),
12126}
12127impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12128 pub fn as_str(&self) -> &str {
12129 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12130 match self {
12131 Balances => "balances",
12132 Ownership => "ownership",
12133 Transactions => "transactions",
12134 Unknown(v) => v,
12135 }
12136 }
12137}
12138
12139impl std::str::FromStr
12140 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12141{
12142 type Err = std::convert::Infallible;
12143 fn from_str(s: &str) -> Result<Self, Self::Err> {
12144 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12145 match s {
12146 "balances" => Ok(Balances),
12147 "ownership" => Ok(Ownership),
12148 "transactions" => Ok(Transactions),
12149 v => {
12150 tracing::warn!(
12151 "Unknown value '{}' for enum '{}'",
12152 v,
12153 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
12154 );
12155 Ok(Unknown(v.to_owned()))
12156 }
12157 }
12158 }
12159}
12160impl std::fmt::Display
12161 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12162{
12163 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12164 f.write_str(self.as_str())
12165 }
12166}
12167
12168#[cfg(not(feature = "redact-generated-debug"))]
12169impl std::fmt::Debug
12170 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12171{
12172 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12173 f.write_str(self.as_str())
12174 }
12175}
12176#[cfg(feature = "redact-generated-debug")]
12177impl std::fmt::Debug
12178 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12179{
12180 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12181 f.debug_struct(stringify!(
12182 UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12183 ))
12184 .finish_non_exhaustive()
12185 }
12186}
12187impl serde::Serialize
12188 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12189{
12190 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12191 where
12192 S: serde::Serializer,
12193 {
12194 serializer.serialize_str(self.as_str())
12195 }
12196}
12197#[cfg(feature = "deserialize")]
12198impl<'de> serde::Deserialize<'de>
12199 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12200{
12201 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12202 use std::str::FromStr;
12203 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12204 Ok(Self::from_str(&s).expect("infallible"))
12205 }
12206}
12207#[derive(Clone, Eq, PartialEq)]
12209#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12210#[derive(serde::Serialize)]
12211pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12212 #[serde(skip_serializing_if = "Option::is_none")]
12214 pub collection_method:
12215 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
12216}
12217#[cfg(feature = "redact-generated-debug")]
12218impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12219 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12220 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions")
12221 .finish_non_exhaustive()
12222 }
12223}
12224impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12225 pub fn new() -> Self {
12226 Self { collection_method: None }
12227 }
12228}
12229impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12230 fn default() -> Self {
12231 Self::new()
12232 }
12233}
12234#[derive(Clone, Eq, PartialEq)]
12236#[non_exhaustive]
12237pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12238 Paper,
12239 Unknown(String),
12241}
12242impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12243 pub fn as_str(&self) -> &str {
12244 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12245 match self {
12246 Paper => "paper",
12247 Unknown(v) => v,
12248 }
12249 }
12250}
12251
12252impl std::str::FromStr
12253 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12254{
12255 type Err = std::convert::Infallible;
12256 fn from_str(s: &str) -> Result<Self, Self::Err> {
12257 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12258 match s {
12259 "paper" => Ok(Paper),
12260 v => {
12261 tracing::warn!(
12262 "Unknown value '{}' for enum '{}'",
12263 v,
12264 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
12265 );
12266 Ok(Unknown(v.to_owned()))
12267 }
12268 }
12269 }
12270}
12271impl std::fmt::Display
12272 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12273{
12274 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12275 f.write_str(self.as_str())
12276 }
12277}
12278
12279#[cfg(not(feature = "redact-generated-debug"))]
12280impl std::fmt::Debug
12281 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12282{
12283 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12284 f.write_str(self.as_str())
12285 }
12286}
12287#[cfg(feature = "redact-generated-debug")]
12288impl std::fmt::Debug
12289 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12290{
12291 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12292 f.debug_struct(stringify!(
12293 UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12294 ))
12295 .finish_non_exhaustive()
12296 }
12297}
12298impl serde::Serialize
12299 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12300{
12301 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12302 where
12303 S: serde::Serializer,
12304 {
12305 serializer.serialize_str(self.as_str())
12306 }
12307}
12308#[cfg(feature = "deserialize")]
12309impl<'de> serde::Deserialize<'de>
12310 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12311{
12312 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12313 use std::str::FromStr;
12314 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12315 Ok(Self::from_str(&s).expect("infallible"))
12316 }
12317}
12318#[derive(Clone, Eq, PartialEq)]
12320#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12321#[derive(serde::Serialize)]
12322pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12323 #[serde(skip_serializing_if = "Option::is_none")]
12325 pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
12326}
12327#[cfg(feature = "redact-generated-debug")]
12328impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12329 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12330 f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks")
12331 .finish_non_exhaustive()
12332 }
12333}
12334impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12335 pub fn new() -> Self {
12336 Self { requested: None }
12337 }
12338}
12339impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12340 fn default() -> Self {
12341 Self::new()
12342 }
12343}
12344#[derive(Clone, Eq, PartialEq)]
12346#[non_exhaustive]
12347pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12348 Ach,
12349 UsDomesticWire,
12350 Unknown(String),
12352}
12353impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12354 pub fn as_str(&self) -> &str {
12355 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12356 match self {
12357 Ach => "ach",
12358 UsDomesticWire => "us_domestic_wire",
12359 Unknown(v) => v,
12360 }
12361 }
12362}
12363
12364impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12365 type Err = std::convert::Infallible;
12366 fn from_str(s: &str) -> Result<Self, Self::Err> {
12367 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12368 match s {
12369 "ach" => Ok(Ach),
12370 "us_domestic_wire" => Ok(UsDomesticWire),
12371 v => {
12372 tracing::warn!(
12373 "Unknown value '{}' for enum '{}'",
12374 v,
12375 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
12376 );
12377 Ok(Unknown(v.to_owned()))
12378 }
12379 }
12380 }
12381}
12382impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12383 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12384 f.write_str(self.as_str())
12385 }
12386}
12387
12388#[cfg(not(feature = "redact-generated-debug"))]
12389impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12390 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12391 f.write_str(self.as_str())
12392 }
12393}
12394#[cfg(feature = "redact-generated-debug")]
12395impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12396 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12397 f.debug_struct(stringify!(
12398 UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
12399 ))
12400 .finish_non_exhaustive()
12401 }
12402}
12403impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12404 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12405 where
12406 S: serde::Serializer,
12407 {
12408 serializer.serialize_str(self.as_str())
12409 }
12410}
12411#[cfg(feature = "deserialize")]
12412impl<'de> serde::Deserialize<'de>
12413 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
12414{
12415 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12416 use std::str::FromStr;
12417 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12418 Ok(Self::from_str(&s).expect("infallible"))
12419 }
12420}
12421#[derive(Clone, Eq, PartialEq)]
12423#[non_exhaustive]
12424pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12425 Automatic,
12426 Instant,
12427 Microdeposits,
12428 Unknown(String),
12430}
12431impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12432 pub fn as_str(&self) -> &str {
12433 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12434 match self {
12435 Automatic => "automatic",
12436 Instant => "instant",
12437 Microdeposits => "microdeposits",
12438 Unknown(v) => v,
12439 }
12440 }
12441}
12442
12443impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12444 type Err = std::convert::Infallible;
12445 fn from_str(s: &str) -> Result<Self, Self::Err> {
12446 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12447 match s {
12448 "automatic" => Ok(Automatic),
12449 "instant" => Ok(Instant),
12450 "microdeposits" => Ok(Microdeposits),
12451 v => {
12452 tracing::warn!(
12453 "Unknown value '{}' for enum '{}'",
12454 v,
12455 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
12456 );
12457 Ok(Unknown(v.to_owned()))
12458 }
12459 }
12460 }
12461}
12462impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12463 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12464 f.write_str(self.as_str())
12465 }
12466}
12467
12468#[cfg(not(feature = "redact-generated-debug"))]
12469impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12470 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12471 f.write_str(self.as_str())
12472 }
12473}
12474#[cfg(feature = "redact-generated-debug")]
12475impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12476 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12477 f.debug_struct(stringify!(
12478 UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
12479 ))
12480 .finish_non_exhaustive()
12481 }
12482}
12483impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12484 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12485 where
12486 S: serde::Serializer,
12487 {
12488 serializer.serialize_str(self.as_str())
12489 }
12490}
12491#[cfg(feature = "deserialize")]
12492impl<'de> serde::Deserialize<'de>
12493 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
12494{
12495 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12496 use std::str::FromStr;
12497 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12498 Ok(Self::from_str(&s).expect("infallible"))
12499 }
12500}
12501#[derive(Clone)]
12503#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12504#[derive(serde::Serialize)]
12505pub struct UpdateSetupIntent {
12506 inner: UpdateSetupIntentBuilder,
12507 intent: stripe_shared::SetupIntentId,
12508}
12509#[cfg(feature = "redact-generated-debug")]
12510impl std::fmt::Debug for UpdateSetupIntent {
12511 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12512 f.debug_struct("UpdateSetupIntent").finish_non_exhaustive()
12513 }
12514}
12515impl UpdateSetupIntent {
12516 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12518 Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
12519 }
12520 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
12525 self.inner.attach_to_self = Some(attach_to_self.into());
12526 self
12527 }
12528 pub fn customer(mut self, customer: impl Into<String>) -> Self {
12533 self.inner.customer = Some(customer.into());
12534 self
12535 }
12536 pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
12541 self.inner.customer_account = Some(customer_account.into());
12542 self
12543 }
12544 pub fn description(mut self, description: impl Into<String>) -> Self {
12546 self.inner.description = Some(description.into());
12547 self
12548 }
12549 pub fn excluded_payment_method_types(
12551 mut self,
12552 excluded_payment_method_types: impl Into<
12553 Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
12554 >,
12555 ) -> Self {
12556 self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
12557 self
12558 }
12559 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12561 self.inner.expand = Some(expand.into());
12562 self
12563 }
12564 pub fn flow_directions(
12570 mut self,
12571 flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
12572 ) -> Self {
12573 self.inner.flow_directions = Some(flow_directions.into());
12574 self
12575 }
12576 pub fn metadata(
12581 mut self,
12582 metadata: impl Into<std::collections::HashMap<String, String>>,
12583 ) -> Self {
12584 self.inner.metadata = Some(metadata.into());
12585 self
12586 }
12587 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
12590 self.inner.payment_method = Some(payment_method.into());
12591 self
12592 }
12593 pub fn payment_method_configuration(
12595 mut self,
12596 payment_method_configuration: impl Into<String>,
12597 ) -> Self {
12598 self.inner.payment_method_configuration = Some(payment_method_configuration.into());
12599 self
12600 }
12601 pub fn payment_method_data(
12604 mut self,
12605 payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
12606 ) -> Self {
12607 self.inner.payment_method_data = Some(payment_method_data.into());
12608 self
12609 }
12610 pub fn payment_method_options(
12612 mut self,
12613 payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
12614 ) -> Self {
12615 self.inner.payment_method_options = Some(payment_method_options.into());
12616 self
12617 }
12618 pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
12622 self.inner.payment_method_types = Some(payment_method_types.into());
12623 self
12624 }
12625}
12626impl UpdateSetupIntent {
12627 pub async fn send<C: StripeClient>(
12629 &self,
12630 client: &C,
12631 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12632 self.customize().send(client).await
12633 }
12634
12635 pub fn send_blocking<C: StripeBlockingClient>(
12637 &self,
12638 client: &C,
12639 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12640 self.customize().send_blocking(client)
12641 }
12642}
12643
12644impl StripeRequest for UpdateSetupIntent {
12645 type Output = stripe_shared::SetupIntent;
12646
12647 fn build(&self) -> RequestBuilder {
12648 let intent = &self.intent;
12649 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
12650 .form(&self.inner)
12651 }
12652}
12653#[derive(Clone, Eq, PartialEq)]
12654#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12655#[derive(serde::Serialize)]
12656struct CancelSetupIntentBuilder {
12657 #[serde(skip_serializing_if = "Option::is_none")]
12658 cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
12659 #[serde(skip_serializing_if = "Option::is_none")]
12660 expand: Option<Vec<String>>,
12661}
12662#[cfg(feature = "redact-generated-debug")]
12663impl std::fmt::Debug for CancelSetupIntentBuilder {
12664 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12665 f.debug_struct("CancelSetupIntentBuilder").finish_non_exhaustive()
12666 }
12667}
12668impl CancelSetupIntentBuilder {
12669 fn new() -> Self {
12670 Self { cancellation_reason: None, expand: None }
12671 }
12672}
12673#[derive(Clone)]
12680#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12681#[derive(serde::Serialize)]
12682pub struct CancelSetupIntent {
12683 inner: CancelSetupIntentBuilder,
12684 intent: stripe_shared::SetupIntentId,
12685}
12686#[cfg(feature = "redact-generated-debug")]
12687impl std::fmt::Debug for CancelSetupIntent {
12688 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12689 f.debug_struct("CancelSetupIntent").finish_non_exhaustive()
12690 }
12691}
12692impl CancelSetupIntent {
12693 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12695 Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
12696 }
12697 pub fn cancellation_reason(
12700 mut self,
12701 cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
12702 ) -> Self {
12703 self.inner.cancellation_reason = Some(cancellation_reason.into());
12704 self
12705 }
12706 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12708 self.inner.expand = Some(expand.into());
12709 self
12710 }
12711}
12712impl CancelSetupIntent {
12713 pub async fn send<C: StripeClient>(
12715 &self,
12716 client: &C,
12717 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12718 self.customize().send(client).await
12719 }
12720
12721 pub fn send_blocking<C: StripeBlockingClient>(
12723 &self,
12724 client: &C,
12725 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12726 self.customize().send_blocking(client)
12727 }
12728}
12729
12730impl StripeRequest for CancelSetupIntent {
12731 type Output = stripe_shared::SetupIntent;
12732
12733 fn build(&self) -> RequestBuilder {
12734 let intent = &self.intent;
12735 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
12736 .form(&self.inner)
12737 }
12738}
12739#[derive(Clone)]
12740#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12741#[derive(serde::Serialize)]
12742struct ConfirmSetupIntentBuilder {
12743 #[serde(skip_serializing_if = "Option::is_none")]
12744 confirmation_token: Option<String>,
12745 #[serde(skip_serializing_if = "Option::is_none")]
12746 expand: Option<Vec<String>>,
12747 #[serde(skip_serializing_if = "Option::is_none")]
12748 mandate_data: Option<ConfirmSetupIntentMandateData>,
12749 #[serde(skip_serializing_if = "Option::is_none")]
12750 payment_method: Option<String>,
12751 #[serde(skip_serializing_if = "Option::is_none")]
12752 payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
12753 #[serde(skip_serializing_if = "Option::is_none")]
12754 payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
12755 #[serde(skip_serializing_if = "Option::is_none")]
12756 return_url: Option<String>,
12757 #[serde(skip_serializing_if = "Option::is_none")]
12758 use_stripe_sdk: Option<bool>,
12759}
12760#[cfg(feature = "redact-generated-debug")]
12761impl std::fmt::Debug for ConfirmSetupIntentBuilder {
12762 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12763 f.debug_struct("ConfirmSetupIntentBuilder").finish_non_exhaustive()
12764 }
12765}
12766impl ConfirmSetupIntentBuilder {
12767 fn new() -> Self {
12768 Self {
12769 confirmation_token: None,
12770 expand: None,
12771 mandate_data: None,
12772 payment_method: None,
12773 payment_method_data: None,
12774 payment_method_options: None,
12775 return_url: None,
12776 use_stripe_sdk: None,
12777 }
12778 }
12779}
12780#[derive(Clone)]
12781#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12782#[derive(serde::Serialize)]
12783#[serde(rename_all = "snake_case")]
12784pub enum ConfirmSetupIntentMandateData {
12785 #[serde(untagged)]
12786 SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
12787 #[serde(untagged)]
12788 ClientKeyParam(ConfirmSetupIntentClientKeyParam),
12789}
12790#[cfg(feature = "redact-generated-debug")]
12791impl std::fmt::Debug for ConfirmSetupIntentMandateData {
12792 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12793 f.debug_struct("ConfirmSetupIntentMandateData").finish_non_exhaustive()
12794 }
12795}
12796#[derive(Clone)]
12797#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12798#[derive(serde::Serialize)]
12799pub struct ConfirmSetupIntentSecretKeyParam {
12800 pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
12802}
12803#[cfg(feature = "redact-generated-debug")]
12804impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParam {
12805 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12806 f.debug_struct("ConfirmSetupIntentSecretKeyParam").finish_non_exhaustive()
12807 }
12808}
12809impl ConfirmSetupIntentSecretKeyParam {
12810 pub fn new(
12811 customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
12812 ) -> Self {
12813 Self { customer_acceptance: customer_acceptance.into() }
12814 }
12815}
12816#[derive(Clone)]
12818#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12819#[derive(serde::Serialize)]
12820pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
12821 #[serde(skip_serializing_if = "Option::is_none")]
12823 pub accepted_at: Option<stripe_types::Timestamp>,
12824 #[serde(skip_serializing_if = "Option::is_none")]
12826 #[serde(with = "stripe_types::with_serde_json_opt")]
12827 pub offline: Option<miniserde::json::Value>,
12828 #[serde(skip_serializing_if = "Option::is_none")]
12830 pub online: Option<OnlineParam>,
12831 #[serde(rename = "type")]
12834 pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
12835}
12836#[cfg(feature = "redact-generated-debug")]
12837impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
12838 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12839 f.debug_struct("ConfirmSetupIntentSecretKeyParamCustomerAcceptance").finish_non_exhaustive()
12840 }
12841}
12842impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
12843 pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
12844 Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
12845 }
12846}
12847#[derive(Clone, Eq, PartialEq)]
12850#[non_exhaustive]
12851pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12852 Offline,
12853 Online,
12854 Unknown(String),
12856}
12857impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12858 pub fn as_str(&self) -> &str {
12859 use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
12860 match self {
12861 Offline => "offline",
12862 Online => "online",
12863 Unknown(v) => v,
12864 }
12865 }
12866}
12867
12868impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12869 type Err = std::convert::Infallible;
12870 fn from_str(s: &str) -> Result<Self, Self::Err> {
12871 use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
12872 match s {
12873 "offline" => Ok(Offline),
12874 "online" => Ok(Online),
12875 v => {
12876 tracing::warn!(
12877 "Unknown value '{}' for enum '{}'",
12878 v,
12879 "ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType"
12880 );
12881 Ok(Unknown(v.to_owned()))
12882 }
12883 }
12884 }
12885}
12886impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12887 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12888 f.write_str(self.as_str())
12889 }
12890}
12891
12892#[cfg(not(feature = "redact-generated-debug"))]
12893impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12894 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12895 f.write_str(self.as_str())
12896 }
12897}
12898#[cfg(feature = "redact-generated-debug")]
12899impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12900 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12901 f.debug_struct(stringify!(ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType))
12902 .finish_non_exhaustive()
12903 }
12904}
12905impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12906 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12907 where
12908 S: serde::Serializer,
12909 {
12910 serializer.serialize_str(self.as_str())
12911 }
12912}
12913#[cfg(feature = "deserialize")]
12914impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
12915 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12916 use std::str::FromStr;
12917 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12918 Ok(Self::from_str(&s).expect("infallible"))
12919 }
12920}
12921#[derive(Clone, Eq, PartialEq)]
12922#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12923#[derive(serde::Serialize)]
12924pub struct ConfirmSetupIntentClientKeyParam {
12925 pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
12927}
12928#[cfg(feature = "redact-generated-debug")]
12929impl std::fmt::Debug for ConfirmSetupIntentClientKeyParam {
12930 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12931 f.debug_struct("ConfirmSetupIntentClientKeyParam").finish_non_exhaustive()
12932 }
12933}
12934impl ConfirmSetupIntentClientKeyParam {
12935 pub fn new(
12936 customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
12937 ) -> Self {
12938 Self { customer_acceptance: customer_acceptance.into() }
12939 }
12940}
12941#[derive(Clone, Eq, PartialEq)]
12943#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12944#[derive(serde::Serialize)]
12945pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
12946 pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
12948 #[serde(rename = "type")]
12950 pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
12951}
12952#[cfg(feature = "redact-generated-debug")]
12953impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptance {
12954 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12955 f.debug_struct("ConfirmSetupIntentClientKeyParamCustomerAcceptance").finish_non_exhaustive()
12956 }
12957}
12958impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
12959 pub fn new(
12960 online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
12961 type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
12962 ) -> Self {
12963 Self { online: online.into(), type_: type_.into() }
12964 }
12965}
12966#[derive(Clone, Eq, PartialEq)]
12968#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12969#[derive(serde::Serialize)]
12970pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
12971 #[serde(skip_serializing_if = "Option::is_none")]
12973 pub ip_address: Option<String>,
12974 #[serde(skip_serializing_if = "Option::is_none")]
12976 pub user_agent: Option<String>,
12977}
12978#[cfg(feature = "redact-generated-debug")]
12979impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
12980 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12981 f.debug_struct("ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline")
12982 .finish_non_exhaustive()
12983 }
12984}
12985impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
12986 pub fn new() -> Self {
12987 Self { ip_address: None, user_agent: None }
12988 }
12989}
12990impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
12991 fn default() -> Self {
12992 Self::new()
12993 }
12994}
12995#[derive(Clone, Eq, PartialEq)]
12997#[non_exhaustive]
12998pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
12999 Online,
13000 Unknown(String),
13002}
13003impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13004 pub fn as_str(&self) -> &str {
13005 use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
13006 match self {
13007 Online => "online",
13008 Unknown(v) => v,
13009 }
13010 }
13011}
13012
13013impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13014 type Err = std::convert::Infallible;
13015 fn from_str(s: &str) -> Result<Self, Self::Err> {
13016 use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
13017 match s {
13018 "online" => Ok(Online),
13019 v => {
13020 tracing::warn!(
13021 "Unknown value '{}' for enum '{}'",
13022 v,
13023 "ConfirmSetupIntentClientKeyParamCustomerAcceptanceType"
13024 );
13025 Ok(Unknown(v.to_owned()))
13026 }
13027 }
13028 }
13029}
13030impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13031 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13032 f.write_str(self.as_str())
13033 }
13034}
13035
13036#[cfg(not(feature = "redact-generated-debug"))]
13037impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13038 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13039 f.write_str(self.as_str())
13040 }
13041}
13042#[cfg(feature = "redact-generated-debug")]
13043impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13044 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13045 f.debug_struct(stringify!(ConfirmSetupIntentClientKeyParamCustomerAcceptanceType))
13046 .finish_non_exhaustive()
13047 }
13048}
13049impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13050 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13051 where
13052 S: serde::Serializer,
13053 {
13054 serializer.serialize_str(self.as_str())
13055 }
13056}
13057#[cfg(feature = "deserialize")]
13058impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
13059 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13060 use std::str::FromStr;
13061 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13062 Ok(Self::from_str(&s).expect("infallible"))
13063 }
13064}
13065#[derive(Clone)]
13068#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13069#[derive(serde::Serialize)]
13070pub struct ConfirmSetupIntentPaymentMethodData {
13071 #[serde(skip_serializing_if = "Option::is_none")]
13073 pub acss_debit: Option<PaymentMethodParam>,
13074 #[serde(skip_serializing_if = "Option::is_none")]
13076 #[serde(with = "stripe_types::with_serde_json_opt")]
13077 pub affirm: Option<miniserde::json::Value>,
13078 #[serde(skip_serializing_if = "Option::is_none")]
13080 #[serde(with = "stripe_types::with_serde_json_opt")]
13081 pub afterpay_clearpay: Option<miniserde::json::Value>,
13082 #[serde(skip_serializing_if = "Option::is_none")]
13084 #[serde(with = "stripe_types::with_serde_json_opt")]
13085 pub alipay: Option<miniserde::json::Value>,
13086 #[serde(skip_serializing_if = "Option::is_none")]
13090 pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
13091 #[serde(skip_serializing_if = "Option::is_none")]
13093 #[serde(with = "stripe_types::with_serde_json_opt")]
13094 pub alma: Option<miniserde::json::Value>,
13095 #[serde(skip_serializing_if = "Option::is_none")]
13097 #[serde(with = "stripe_types::with_serde_json_opt")]
13098 pub amazon_pay: Option<miniserde::json::Value>,
13099 #[serde(skip_serializing_if = "Option::is_none")]
13101 pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
13102 #[serde(skip_serializing_if = "Option::is_none")]
13104 pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
13105 #[serde(skip_serializing_if = "Option::is_none")]
13107 #[serde(with = "stripe_types::with_serde_json_opt")]
13108 pub bancontact: Option<miniserde::json::Value>,
13109 #[serde(skip_serializing_if = "Option::is_none")]
13111 #[serde(with = "stripe_types::with_serde_json_opt")]
13112 pub billie: Option<miniserde::json::Value>,
13113 #[serde(skip_serializing_if = "Option::is_none")]
13115 pub billing_details: Option<BillingDetailsInnerParams>,
13116 #[serde(skip_serializing_if = "Option::is_none")]
13118 #[serde(with = "stripe_types::with_serde_json_opt")]
13119 pub blik: Option<miniserde::json::Value>,
13120 #[serde(skip_serializing_if = "Option::is_none")]
13122 pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
13123 #[serde(skip_serializing_if = "Option::is_none")]
13125 #[serde(with = "stripe_types::with_serde_json_opt")]
13126 pub cashapp: Option<miniserde::json::Value>,
13127 #[serde(skip_serializing_if = "Option::is_none")]
13129 #[serde(with = "stripe_types::with_serde_json_opt")]
13130 pub crypto: Option<miniserde::json::Value>,
13131 #[serde(skip_serializing_if = "Option::is_none")]
13133 #[serde(with = "stripe_types::with_serde_json_opt")]
13134 pub customer_balance: Option<miniserde::json::Value>,
13135 #[serde(skip_serializing_if = "Option::is_none")]
13137 pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
13138 #[serde(skip_serializing_if = "Option::is_none")]
13140 pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
13141 #[serde(skip_serializing_if = "Option::is_none")]
13143 #[serde(with = "stripe_types::with_serde_json_opt")]
13144 pub giropay: Option<miniserde::json::Value>,
13145 #[serde(skip_serializing_if = "Option::is_none")]
13147 #[serde(with = "stripe_types::with_serde_json_opt")]
13148 pub grabpay: Option<miniserde::json::Value>,
13149 #[serde(skip_serializing_if = "Option::is_none")]
13151 pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
13152 #[serde(skip_serializing_if = "Option::is_none")]
13154 #[serde(with = "stripe_types::with_serde_json_opt")]
13155 pub interac_present: Option<miniserde::json::Value>,
13156 #[serde(skip_serializing_if = "Option::is_none")]
13158 #[serde(with = "stripe_types::with_serde_json_opt")]
13159 pub kakao_pay: Option<miniserde::json::Value>,
13160 #[serde(skip_serializing_if = "Option::is_none")]
13162 pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
13163 #[serde(skip_serializing_if = "Option::is_none")]
13165 #[serde(with = "stripe_types::with_serde_json_opt")]
13166 pub konbini: Option<miniserde::json::Value>,
13167 #[serde(skip_serializing_if = "Option::is_none")]
13169 #[serde(with = "stripe_types::with_serde_json_opt")]
13170 pub kr_card: Option<miniserde::json::Value>,
13171 #[serde(skip_serializing_if = "Option::is_none")]
13173 #[serde(with = "stripe_types::with_serde_json_opt")]
13174 pub link: Option<miniserde::json::Value>,
13175 #[serde(skip_serializing_if = "Option::is_none")]
13177 #[serde(with = "stripe_types::with_serde_json_opt")]
13178 pub mb_way: Option<miniserde::json::Value>,
13179 #[serde(skip_serializing_if = "Option::is_none")]
13184 pub metadata: Option<std::collections::HashMap<String, String>>,
13185 #[serde(skip_serializing_if = "Option::is_none")]
13187 #[serde(with = "stripe_types::with_serde_json_opt")]
13188 pub mobilepay: Option<miniserde::json::Value>,
13189 #[serde(skip_serializing_if = "Option::is_none")]
13191 #[serde(with = "stripe_types::with_serde_json_opt")]
13192 pub multibanco: Option<miniserde::json::Value>,
13193 #[serde(skip_serializing_if = "Option::is_none")]
13195 pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
13196 #[serde(skip_serializing_if = "Option::is_none")]
13198 pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
13199 #[serde(skip_serializing_if = "Option::is_none")]
13201 #[serde(with = "stripe_types::with_serde_json_opt")]
13202 pub oxxo: Option<miniserde::json::Value>,
13203 #[serde(skip_serializing_if = "Option::is_none")]
13205 pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
13206 #[serde(skip_serializing_if = "Option::is_none")]
13208 #[serde(with = "stripe_types::with_serde_json_opt")]
13209 pub pay_by_bank: Option<miniserde::json::Value>,
13210 #[serde(skip_serializing_if = "Option::is_none")]
13212 #[serde(with = "stripe_types::with_serde_json_opt")]
13213 pub payco: Option<miniserde::json::Value>,
13214 #[serde(skip_serializing_if = "Option::is_none")]
13216 #[serde(with = "stripe_types::with_serde_json_opt")]
13217 pub paynow: Option<miniserde::json::Value>,
13218 #[serde(skip_serializing_if = "Option::is_none")]
13220 #[serde(with = "stripe_types::with_serde_json_opt")]
13221 pub paypal: Option<miniserde::json::Value>,
13222 #[serde(skip_serializing_if = "Option::is_none")]
13224 pub payto: Option<ConfirmSetupIntentPaymentMethodDataPayto>,
13225 #[serde(skip_serializing_if = "Option::is_none")]
13227 #[serde(with = "stripe_types::with_serde_json_opt")]
13228 pub pix: Option<miniserde::json::Value>,
13229 #[serde(skip_serializing_if = "Option::is_none")]
13231 #[serde(with = "stripe_types::with_serde_json_opt")]
13232 pub promptpay: Option<miniserde::json::Value>,
13233 #[serde(skip_serializing_if = "Option::is_none")]
13236 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
13237 #[serde(skip_serializing_if = "Option::is_none")]
13239 #[serde(with = "stripe_types::with_serde_json_opt")]
13240 pub revolut_pay: Option<miniserde::json::Value>,
13241 #[serde(skip_serializing_if = "Option::is_none")]
13243 #[serde(with = "stripe_types::with_serde_json_opt")]
13244 pub samsung_pay: Option<miniserde::json::Value>,
13245 #[serde(skip_serializing_if = "Option::is_none")]
13247 #[serde(with = "stripe_types::with_serde_json_opt")]
13248 pub satispay: Option<miniserde::json::Value>,
13249 #[serde(skip_serializing_if = "Option::is_none")]
13251 pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
13252 #[serde(skip_serializing_if = "Option::is_none")]
13254 pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
13255 #[serde(skip_serializing_if = "Option::is_none")]
13257 #[serde(with = "stripe_types::with_serde_json_opt")]
13258 pub sunbit: Option<miniserde::json::Value>,
13259 #[serde(skip_serializing_if = "Option::is_none")]
13261 #[serde(with = "stripe_types::with_serde_json_opt")]
13262 pub swish: Option<miniserde::json::Value>,
13263 #[serde(skip_serializing_if = "Option::is_none")]
13265 #[serde(with = "stripe_types::with_serde_json_opt")]
13266 pub twint: Option<miniserde::json::Value>,
13267 #[serde(rename = "type")]
13271 pub type_: ConfirmSetupIntentPaymentMethodDataType,
13272 #[serde(skip_serializing_if = "Option::is_none")]
13274 pub upi: Option<ConfirmSetupIntentPaymentMethodDataUpi>,
13275 #[serde(skip_serializing_if = "Option::is_none")]
13277 pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
13278 #[serde(skip_serializing_if = "Option::is_none")]
13280 #[serde(with = "stripe_types::with_serde_json_opt")]
13281 pub wechat_pay: Option<miniserde::json::Value>,
13282 #[serde(skip_serializing_if = "Option::is_none")]
13284 #[serde(with = "stripe_types::with_serde_json_opt")]
13285 pub zip: Option<miniserde::json::Value>,
13286}
13287#[cfg(feature = "redact-generated-debug")]
13288impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodData {
13289 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13290 f.debug_struct("ConfirmSetupIntentPaymentMethodData").finish_non_exhaustive()
13291 }
13292}
13293impl ConfirmSetupIntentPaymentMethodData {
13294 pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
13295 Self {
13296 acss_debit: None,
13297 affirm: None,
13298 afterpay_clearpay: None,
13299 alipay: None,
13300 allow_redisplay: None,
13301 alma: None,
13302 amazon_pay: None,
13303 au_becs_debit: None,
13304 bacs_debit: None,
13305 bancontact: None,
13306 billie: None,
13307 billing_details: None,
13308 blik: None,
13309 boleto: None,
13310 cashapp: None,
13311 crypto: None,
13312 customer_balance: None,
13313 eps: None,
13314 fpx: None,
13315 giropay: None,
13316 grabpay: None,
13317 ideal: None,
13318 interac_present: None,
13319 kakao_pay: None,
13320 klarna: None,
13321 konbini: None,
13322 kr_card: None,
13323 link: None,
13324 mb_way: None,
13325 metadata: None,
13326 mobilepay: None,
13327 multibanco: None,
13328 naver_pay: None,
13329 nz_bank_account: None,
13330 oxxo: None,
13331 p24: None,
13332 pay_by_bank: None,
13333 payco: None,
13334 paynow: None,
13335 paypal: None,
13336 payto: None,
13337 pix: None,
13338 promptpay: None,
13339 radar_options: None,
13340 revolut_pay: None,
13341 samsung_pay: None,
13342 satispay: None,
13343 sepa_debit: None,
13344 sofort: None,
13345 sunbit: None,
13346 swish: None,
13347 twint: None,
13348 type_: type_.into(),
13349 upi: None,
13350 us_bank_account: None,
13351 wechat_pay: None,
13352 zip: None,
13353 }
13354 }
13355}
13356#[derive(Clone, Eq, PartialEq)]
13360#[non_exhaustive]
13361pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13362 Always,
13363 Limited,
13364 Unspecified,
13365 Unknown(String),
13367}
13368impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13369 pub fn as_str(&self) -> &str {
13370 use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
13371 match self {
13372 Always => "always",
13373 Limited => "limited",
13374 Unspecified => "unspecified",
13375 Unknown(v) => v,
13376 }
13377 }
13378}
13379
13380impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13381 type Err = std::convert::Infallible;
13382 fn from_str(s: &str) -> Result<Self, Self::Err> {
13383 use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
13384 match s {
13385 "always" => Ok(Always),
13386 "limited" => Ok(Limited),
13387 "unspecified" => Ok(Unspecified),
13388 v => {
13389 tracing::warn!(
13390 "Unknown value '{}' for enum '{}'",
13391 v,
13392 "ConfirmSetupIntentPaymentMethodDataAllowRedisplay"
13393 );
13394 Ok(Unknown(v.to_owned()))
13395 }
13396 }
13397 }
13398}
13399impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13400 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13401 f.write_str(self.as_str())
13402 }
13403}
13404
13405#[cfg(not(feature = "redact-generated-debug"))]
13406impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13407 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13408 f.write_str(self.as_str())
13409 }
13410}
13411#[cfg(feature = "redact-generated-debug")]
13412impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13413 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13414 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataAllowRedisplay))
13415 .finish_non_exhaustive()
13416 }
13417}
13418impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13419 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13420 where
13421 S: serde::Serializer,
13422 {
13423 serializer.serialize_str(self.as_str())
13424 }
13425}
13426#[cfg(feature = "deserialize")]
13427impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
13428 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13429 use std::str::FromStr;
13430 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13431 Ok(Self::from_str(&s).expect("infallible"))
13432 }
13433}
13434#[derive(Clone, Eq, PartialEq)]
13436#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13437#[derive(serde::Serialize)]
13438pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
13439 pub account_number: String,
13441 pub bsb_number: String,
13443}
13444#[cfg(feature = "redact-generated-debug")]
13445impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
13446 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13447 f.debug_struct("ConfirmSetupIntentPaymentMethodDataAuBecsDebit").finish_non_exhaustive()
13448 }
13449}
13450impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
13451 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
13452 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
13453 }
13454}
13455#[derive(Clone, Eq, PartialEq)]
13457#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13458#[derive(serde::Serialize)]
13459pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
13460 #[serde(skip_serializing_if = "Option::is_none")]
13462 pub account_number: Option<String>,
13463 #[serde(skip_serializing_if = "Option::is_none")]
13465 pub sort_code: Option<String>,
13466}
13467#[cfg(feature = "redact-generated-debug")]
13468impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataBacsDebit {
13469 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13470 f.debug_struct("ConfirmSetupIntentPaymentMethodDataBacsDebit").finish_non_exhaustive()
13471 }
13472}
13473impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
13474 pub fn new() -> Self {
13475 Self { account_number: None, sort_code: None }
13476 }
13477}
13478impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
13479 fn default() -> Self {
13480 Self::new()
13481 }
13482}
13483#[derive(Clone, Eq, PartialEq)]
13485#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13486#[derive(serde::Serialize)]
13487pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
13488 pub tax_id: String,
13490}
13491#[cfg(feature = "redact-generated-debug")]
13492impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataBoleto {
13493 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13494 f.debug_struct("ConfirmSetupIntentPaymentMethodDataBoleto").finish_non_exhaustive()
13495 }
13496}
13497impl ConfirmSetupIntentPaymentMethodDataBoleto {
13498 pub fn new(tax_id: impl Into<String>) -> Self {
13499 Self { tax_id: tax_id.into() }
13500 }
13501}
13502#[derive(Clone, Eq, PartialEq)]
13504#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13505#[derive(serde::Serialize)]
13506pub struct ConfirmSetupIntentPaymentMethodDataEps {
13507 #[serde(skip_serializing_if = "Option::is_none")]
13509 pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
13510}
13511#[cfg(feature = "redact-generated-debug")]
13512impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEps {
13513 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13514 f.debug_struct("ConfirmSetupIntentPaymentMethodDataEps").finish_non_exhaustive()
13515 }
13516}
13517impl ConfirmSetupIntentPaymentMethodDataEps {
13518 pub fn new() -> Self {
13519 Self { bank: None }
13520 }
13521}
13522impl Default for ConfirmSetupIntentPaymentMethodDataEps {
13523 fn default() -> Self {
13524 Self::new()
13525 }
13526}
13527#[derive(Clone, Eq, PartialEq)]
13529#[non_exhaustive]
13530pub enum ConfirmSetupIntentPaymentMethodDataEpsBank {
13531 ArzteUndApothekerBank,
13532 AustrianAnadiBankAg,
13533 BankAustria,
13534 BankhausCarlSpangler,
13535 BankhausSchelhammerUndSchatteraAg,
13536 BawagPskAg,
13537 BksBankAg,
13538 BrullKallmusBankAg,
13539 BtvVierLanderBank,
13540 CapitalBankGraweGruppeAg,
13541 DeutscheBankAg,
13542 Dolomitenbank,
13543 EasybankAg,
13544 ErsteBankUndSparkassen,
13545 HypoAlpeadriabankInternationalAg,
13546 HypoBankBurgenlandAktiengesellschaft,
13547 HypoNoeLbFurNiederosterreichUWien,
13548 HypoOberosterreichSalzburgSteiermark,
13549 HypoTirolBankAg,
13550 HypoVorarlbergBankAg,
13551 MarchfelderBank,
13552 OberbankAg,
13553 RaiffeisenBankengruppeOsterreich,
13554 SchoellerbankAg,
13555 SpardaBankWien,
13556 VolksbankGruppe,
13557 VolkskreditbankAg,
13558 VrBankBraunau,
13559 Unknown(String),
13561}
13562impl ConfirmSetupIntentPaymentMethodDataEpsBank {
13563 pub fn as_str(&self) -> &str {
13564 use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
13565 match self {
13566 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
13567 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
13568 BankAustria => "bank_austria",
13569 BankhausCarlSpangler => "bankhaus_carl_spangler",
13570 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
13571 BawagPskAg => "bawag_psk_ag",
13572 BksBankAg => "bks_bank_ag",
13573 BrullKallmusBankAg => "brull_kallmus_bank_ag",
13574 BtvVierLanderBank => "btv_vier_lander_bank",
13575 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
13576 DeutscheBankAg => "deutsche_bank_ag",
13577 Dolomitenbank => "dolomitenbank",
13578 EasybankAg => "easybank_ag",
13579 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
13580 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
13581 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
13582 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
13583 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
13584 HypoTirolBankAg => "hypo_tirol_bank_ag",
13585 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
13586 MarchfelderBank => "marchfelder_bank",
13587 OberbankAg => "oberbank_ag",
13588 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
13589 SchoellerbankAg => "schoellerbank_ag",
13590 SpardaBankWien => "sparda_bank_wien",
13591 VolksbankGruppe => "volksbank_gruppe",
13592 VolkskreditbankAg => "volkskreditbank_ag",
13593 VrBankBraunau => "vr_bank_braunau",
13594 Unknown(v) => v,
13595 }
13596 }
13597}
13598
13599impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
13600 type Err = std::convert::Infallible;
13601 fn from_str(s: &str) -> Result<Self, Self::Err> {
13602 use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
13603 match s {
13604 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
13605 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
13606 "bank_austria" => Ok(BankAustria),
13607 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
13608 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
13609 "bawag_psk_ag" => Ok(BawagPskAg),
13610 "bks_bank_ag" => Ok(BksBankAg),
13611 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
13612 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
13613 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
13614 "deutsche_bank_ag" => Ok(DeutscheBankAg),
13615 "dolomitenbank" => Ok(Dolomitenbank),
13616 "easybank_ag" => Ok(EasybankAg),
13617 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
13618 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
13619 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
13620 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
13621 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
13622 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
13623 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
13624 "marchfelder_bank" => Ok(MarchfelderBank),
13625 "oberbank_ag" => Ok(OberbankAg),
13626 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
13627 "schoellerbank_ag" => Ok(SchoellerbankAg),
13628 "sparda_bank_wien" => Ok(SpardaBankWien),
13629 "volksbank_gruppe" => Ok(VolksbankGruppe),
13630 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
13631 "vr_bank_braunau" => Ok(VrBankBraunau),
13632 v => {
13633 tracing::warn!(
13634 "Unknown value '{}' for enum '{}'",
13635 v,
13636 "ConfirmSetupIntentPaymentMethodDataEpsBank"
13637 );
13638 Ok(Unknown(v.to_owned()))
13639 }
13640 }
13641 }
13642}
13643impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
13644 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13645 f.write_str(self.as_str())
13646 }
13647}
13648
13649#[cfg(not(feature = "redact-generated-debug"))]
13650impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
13651 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13652 f.write_str(self.as_str())
13653 }
13654}
13655#[cfg(feature = "redact-generated-debug")]
13656impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
13657 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13658 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataEpsBank))
13659 .finish_non_exhaustive()
13660 }
13661}
13662impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
13663 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13664 where
13665 S: serde::Serializer,
13666 {
13667 serializer.serialize_str(self.as_str())
13668 }
13669}
13670#[cfg(feature = "deserialize")]
13671impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
13672 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13673 use std::str::FromStr;
13674 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13675 Ok(Self::from_str(&s).expect("infallible"))
13676 }
13677}
13678#[derive(Clone, Eq, PartialEq)]
13680#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13681#[derive(serde::Serialize)]
13682pub struct ConfirmSetupIntentPaymentMethodDataFpx {
13683 #[serde(skip_serializing_if = "Option::is_none")]
13685 pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
13686 pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
13688}
13689#[cfg(feature = "redact-generated-debug")]
13690impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpx {
13691 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13692 f.debug_struct("ConfirmSetupIntentPaymentMethodDataFpx").finish_non_exhaustive()
13693 }
13694}
13695impl ConfirmSetupIntentPaymentMethodDataFpx {
13696 pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
13697 Self { account_holder_type: None, bank: bank.into() }
13698 }
13699}
13700#[derive(Clone, Eq, PartialEq)]
13702#[non_exhaustive]
13703pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13704 Company,
13705 Individual,
13706 Unknown(String),
13708}
13709impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13710 pub fn as_str(&self) -> &str {
13711 use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
13712 match self {
13713 Company => "company",
13714 Individual => "individual",
13715 Unknown(v) => v,
13716 }
13717 }
13718}
13719
13720impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13721 type Err = std::convert::Infallible;
13722 fn from_str(s: &str) -> Result<Self, Self::Err> {
13723 use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
13724 match s {
13725 "company" => Ok(Company),
13726 "individual" => Ok(Individual),
13727 v => {
13728 tracing::warn!(
13729 "Unknown value '{}' for enum '{}'",
13730 v,
13731 "ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType"
13732 );
13733 Ok(Unknown(v.to_owned()))
13734 }
13735 }
13736 }
13737}
13738impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13739 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13740 f.write_str(self.as_str())
13741 }
13742}
13743
13744#[cfg(not(feature = "redact-generated-debug"))]
13745impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13746 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13747 f.write_str(self.as_str())
13748 }
13749}
13750#[cfg(feature = "redact-generated-debug")]
13751impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13752 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13753 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType))
13754 .finish_non_exhaustive()
13755 }
13756}
13757impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13758 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13759 where
13760 S: serde::Serializer,
13761 {
13762 serializer.serialize_str(self.as_str())
13763 }
13764}
13765#[cfg(feature = "deserialize")]
13766impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
13767 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13768 use std::str::FromStr;
13769 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13770 Ok(Self::from_str(&s).expect("infallible"))
13771 }
13772}
13773#[derive(Clone, Eq, PartialEq)]
13775#[non_exhaustive]
13776pub enum ConfirmSetupIntentPaymentMethodDataFpxBank {
13777 AffinBank,
13778 Agrobank,
13779 AllianceBank,
13780 Ambank,
13781 BankIslam,
13782 BankMuamalat,
13783 BankOfChina,
13784 BankRakyat,
13785 Bsn,
13786 Cimb,
13787 DeutscheBank,
13788 HongLeongBank,
13789 Hsbc,
13790 Kfh,
13791 Maybank2e,
13792 Maybank2u,
13793 Ocbc,
13794 PbEnterprise,
13795 PublicBank,
13796 Rhb,
13797 StandardChartered,
13798 Uob,
13799 Unknown(String),
13801}
13802impl ConfirmSetupIntentPaymentMethodDataFpxBank {
13803 pub fn as_str(&self) -> &str {
13804 use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
13805 match self {
13806 AffinBank => "affin_bank",
13807 Agrobank => "agrobank",
13808 AllianceBank => "alliance_bank",
13809 Ambank => "ambank",
13810 BankIslam => "bank_islam",
13811 BankMuamalat => "bank_muamalat",
13812 BankOfChina => "bank_of_china",
13813 BankRakyat => "bank_rakyat",
13814 Bsn => "bsn",
13815 Cimb => "cimb",
13816 DeutscheBank => "deutsche_bank",
13817 HongLeongBank => "hong_leong_bank",
13818 Hsbc => "hsbc",
13819 Kfh => "kfh",
13820 Maybank2e => "maybank2e",
13821 Maybank2u => "maybank2u",
13822 Ocbc => "ocbc",
13823 PbEnterprise => "pb_enterprise",
13824 PublicBank => "public_bank",
13825 Rhb => "rhb",
13826 StandardChartered => "standard_chartered",
13827 Uob => "uob",
13828 Unknown(v) => v,
13829 }
13830 }
13831}
13832
13833impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
13834 type Err = std::convert::Infallible;
13835 fn from_str(s: &str) -> Result<Self, Self::Err> {
13836 use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
13837 match s {
13838 "affin_bank" => Ok(AffinBank),
13839 "agrobank" => Ok(Agrobank),
13840 "alliance_bank" => Ok(AllianceBank),
13841 "ambank" => Ok(Ambank),
13842 "bank_islam" => Ok(BankIslam),
13843 "bank_muamalat" => Ok(BankMuamalat),
13844 "bank_of_china" => Ok(BankOfChina),
13845 "bank_rakyat" => Ok(BankRakyat),
13846 "bsn" => Ok(Bsn),
13847 "cimb" => Ok(Cimb),
13848 "deutsche_bank" => Ok(DeutscheBank),
13849 "hong_leong_bank" => Ok(HongLeongBank),
13850 "hsbc" => Ok(Hsbc),
13851 "kfh" => Ok(Kfh),
13852 "maybank2e" => Ok(Maybank2e),
13853 "maybank2u" => Ok(Maybank2u),
13854 "ocbc" => Ok(Ocbc),
13855 "pb_enterprise" => Ok(PbEnterprise),
13856 "public_bank" => Ok(PublicBank),
13857 "rhb" => Ok(Rhb),
13858 "standard_chartered" => Ok(StandardChartered),
13859 "uob" => Ok(Uob),
13860 v => {
13861 tracing::warn!(
13862 "Unknown value '{}' for enum '{}'",
13863 v,
13864 "ConfirmSetupIntentPaymentMethodDataFpxBank"
13865 );
13866 Ok(Unknown(v.to_owned()))
13867 }
13868 }
13869 }
13870}
13871impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
13872 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13873 f.write_str(self.as_str())
13874 }
13875}
13876
13877#[cfg(not(feature = "redact-generated-debug"))]
13878impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
13879 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13880 f.write_str(self.as_str())
13881 }
13882}
13883#[cfg(feature = "redact-generated-debug")]
13884impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
13885 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13886 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataFpxBank))
13887 .finish_non_exhaustive()
13888 }
13889}
13890impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
13891 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13892 where
13893 S: serde::Serializer,
13894 {
13895 serializer.serialize_str(self.as_str())
13896 }
13897}
13898#[cfg(feature = "deserialize")]
13899impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
13900 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13901 use std::str::FromStr;
13902 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13903 Ok(Self::from_str(&s).expect("infallible"))
13904 }
13905}
13906#[derive(Clone, Eq, PartialEq)]
13908#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13909#[derive(serde::Serialize)]
13910pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
13911 #[serde(skip_serializing_if = "Option::is_none")]
13915 pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
13916}
13917#[cfg(feature = "redact-generated-debug")]
13918impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdeal {
13919 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13920 f.debug_struct("ConfirmSetupIntentPaymentMethodDataIdeal").finish_non_exhaustive()
13921 }
13922}
13923impl ConfirmSetupIntentPaymentMethodDataIdeal {
13924 pub fn new() -> Self {
13925 Self { bank: None }
13926 }
13927}
13928impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
13929 fn default() -> Self {
13930 Self::new()
13931 }
13932}
13933#[derive(Clone, Eq, PartialEq)]
13937#[non_exhaustive]
13938pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
13939 AbnAmro,
13940 Adyen,
13941 AsnBank,
13942 Bunq,
13943 Buut,
13944 Finom,
13945 Handelsbanken,
13946 Ing,
13947 Knab,
13948 Mollie,
13949 Moneyou,
13950 N26,
13951 Nn,
13952 Rabobank,
13953 Regiobank,
13954 Revolut,
13955 SnsBank,
13956 TriodosBank,
13957 VanLanschot,
13958 Yoursafe,
13959 Unknown(String),
13961}
13962impl ConfirmSetupIntentPaymentMethodDataIdealBank {
13963 pub fn as_str(&self) -> &str {
13964 use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
13965 match self {
13966 AbnAmro => "abn_amro",
13967 Adyen => "adyen",
13968 AsnBank => "asn_bank",
13969 Bunq => "bunq",
13970 Buut => "buut",
13971 Finom => "finom",
13972 Handelsbanken => "handelsbanken",
13973 Ing => "ing",
13974 Knab => "knab",
13975 Mollie => "mollie",
13976 Moneyou => "moneyou",
13977 N26 => "n26",
13978 Nn => "nn",
13979 Rabobank => "rabobank",
13980 Regiobank => "regiobank",
13981 Revolut => "revolut",
13982 SnsBank => "sns_bank",
13983 TriodosBank => "triodos_bank",
13984 VanLanschot => "van_lanschot",
13985 Yoursafe => "yoursafe",
13986 Unknown(v) => v,
13987 }
13988 }
13989}
13990
13991impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
13992 type Err = std::convert::Infallible;
13993 fn from_str(s: &str) -> Result<Self, Self::Err> {
13994 use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
13995 match s {
13996 "abn_amro" => Ok(AbnAmro),
13997 "adyen" => Ok(Adyen),
13998 "asn_bank" => Ok(AsnBank),
13999 "bunq" => Ok(Bunq),
14000 "buut" => Ok(Buut),
14001 "finom" => Ok(Finom),
14002 "handelsbanken" => Ok(Handelsbanken),
14003 "ing" => Ok(Ing),
14004 "knab" => Ok(Knab),
14005 "mollie" => Ok(Mollie),
14006 "moneyou" => Ok(Moneyou),
14007 "n26" => Ok(N26),
14008 "nn" => Ok(Nn),
14009 "rabobank" => Ok(Rabobank),
14010 "regiobank" => Ok(Regiobank),
14011 "revolut" => Ok(Revolut),
14012 "sns_bank" => Ok(SnsBank),
14013 "triodos_bank" => Ok(TriodosBank),
14014 "van_lanschot" => Ok(VanLanschot),
14015 "yoursafe" => Ok(Yoursafe),
14016 v => {
14017 tracing::warn!(
14018 "Unknown value '{}' for enum '{}'",
14019 v,
14020 "ConfirmSetupIntentPaymentMethodDataIdealBank"
14021 );
14022 Ok(Unknown(v.to_owned()))
14023 }
14024 }
14025 }
14026}
14027impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
14028 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14029 f.write_str(self.as_str())
14030 }
14031}
14032
14033#[cfg(not(feature = "redact-generated-debug"))]
14034impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
14035 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14036 f.write_str(self.as_str())
14037 }
14038}
14039#[cfg(feature = "redact-generated-debug")]
14040impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
14041 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14042 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataIdealBank))
14043 .finish_non_exhaustive()
14044 }
14045}
14046impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
14047 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14048 where
14049 S: serde::Serializer,
14050 {
14051 serializer.serialize_str(self.as_str())
14052 }
14053}
14054#[cfg(feature = "deserialize")]
14055impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
14056 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14057 use std::str::FromStr;
14058 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14059 Ok(Self::from_str(&s).expect("infallible"))
14060 }
14061}
14062#[derive(Copy, Clone, Eq, PartialEq)]
14064#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14065#[derive(serde::Serialize)]
14066pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
14067 #[serde(skip_serializing_if = "Option::is_none")]
14069 pub dob: Option<DateOfBirth>,
14070}
14071#[cfg(feature = "redact-generated-debug")]
14072impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataKlarna {
14073 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14074 f.debug_struct("ConfirmSetupIntentPaymentMethodDataKlarna").finish_non_exhaustive()
14075 }
14076}
14077impl ConfirmSetupIntentPaymentMethodDataKlarna {
14078 pub fn new() -> Self {
14079 Self { dob: None }
14080 }
14081}
14082impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
14083 fn default() -> Self {
14084 Self::new()
14085 }
14086}
14087#[derive(Clone, Eq, PartialEq)]
14089#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14090#[derive(serde::Serialize)]
14091pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
14092 #[serde(skip_serializing_if = "Option::is_none")]
14095 pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
14096}
14097#[cfg(feature = "redact-generated-debug")]
14098impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPay {
14099 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14100 f.debug_struct("ConfirmSetupIntentPaymentMethodDataNaverPay").finish_non_exhaustive()
14101 }
14102}
14103impl ConfirmSetupIntentPaymentMethodDataNaverPay {
14104 pub fn new() -> Self {
14105 Self { funding: None }
14106 }
14107}
14108impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
14109 fn default() -> Self {
14110 Self::new()
14111 }
14112}
14113#[derive(Clone, Eq, PartialEq)]
14116#[non_exhaustive]
14117pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14118 Card,
14119 Points,
14120 Unknown(String),
14122}
14123impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14124 pub fn as_str(&self) -> &str {
14125 use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
14126 match self {
14127 Card => "card",
14128 Points => "points",
14129 Unknown(v) => v,
14130 }
14131 }
14132}
14133
14134impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14135 type Err = std::convert::Infallible;
14136 fn from_str(s: &str) -> Result<Self, Self::Err> {
14137 use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
14138 match s {
14139 "card" => Ok(Card),
14140 "points" => Ok(Points),
14141 v => {
14142 tracing::warn!(
14143 "Unknown value '{}' for enum '{}'",
14144 v,
14145 "ConfirmSetupIntentPaymentMethodDataNaverPayFunding"
14146 );
14147 Ok(Unknown(v.to_owned()))
14148 }
14149 }
14150 }
14151}
14152impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14153 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14154 f.write_str(self.as_str())
14155 }
14156}
14157
14158#[cfg(not(feature = "redact-generated-debug"))]
14159impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14160 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14161 f.write_str(self.as_str())
14162 }
14163}
14164#[cfg(feature = "redact-generated-debug")]
14165impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14166 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14167 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataNaverPayFunding))
14168 .finish_non_exhaustive()
14169 }
14170}
14171impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14172 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14173 where
14174 S: serde::Serializer,
14175 {
14176 serializer.serialize_str(self.as_str())
14177 }
14178}
14179#[cfg(feature = "deserialize")]
14180impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
14181 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14182 use std::str::FromStr;
14183 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14184 Ok(Self::from_str(&s).expect("infallible"))
14185 }
14186}
14187#[derive(Clone, Eq, PartialEq)]
14189#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14190#[derive(serde::Serialize)]
14191pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
14192 #[serde(skip_serializing_if = "Option::is_none")]
14195 pub account_holder_name: Option<String>,
14196 pub account_number: String,
14198 pub bank_code: String,
14200 pub branch_code: String,
14202 #[serde(skip_serializing_if = "Option::is_none")]
14203 pub reference: Option<String>,
14204 pub suffix: String,
14206}
14207#[cfg(feature = "redact-generated-debug")]
14208impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNzBankAccount {
14209 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14210 f.debug_struct("ConfirmSetupIntentPaymentMethodDataNzBankAccount").finish_non_exhaustive()
14211 }
14212}
14213impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
14214 pub fn new(
14215 account_number: impl Into<String>,
14216 bank_code: impl Into<String>,
14217 branch_code: impl Into<String>,
14218 suffix: impl Into<String>,
14219 ) -> Self {
14220 Self {
14221 account_holder_name: None,
14222 account_number: account_number.into(),
14223 bank_code: bank_code.into(),
14224 branch_code: branch_code.into(),
14225 reference: None,
14226 suffix: suffix.into(),
14227 }
14228 }
14229}
14230#[derive(Clone, Eq, PartialEq)]
14232#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14233#[derive(serde::Serialize)]
14234pub struct ConfirmSetupIntentPaymentMethodDataP24 {
14235 #[serde(skip_serializing_if = "Option::is_none")]
14237 pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
14238}
14239#[cfg(feature = "redact-generated-debug")]
14240impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24 {
14241 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14242 f.debug_struct("ConfirmSetupIntentPaymentMethodDataP24").finish_non_exhaustive()
14243 }
14244}
14245impl ConfirmSetupIntentPaymentMethodDataP24 {
14246 pub fn new() -> Self {
14247 Self { bank: None }
14248 }
14249}
14250impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
14251 fn default() -> Self {
14252 Self::new()
14253 }
14254}
14255#[derive(Clone, Eq, PartialEq)]
14257#[non_exhaustive]
14258pub enum ConfirmSetupIntentPaymentMethodDataP24Bank {
14259 AliorBank,
14260 BankMillennium,
14261 BankNowyBfgSa,
14262 BankPekaoSa,
14263 BankiSpbdzielcze,
14264 Blik,
14265 BnpParibas,
14266 Boz,
14267 CitiHandlowy,
14268 CreditAgricole,
14269 Envelobank,
14270 EtransferPocztowy24,
14271 GetinBank,
14272 Ideabank,
14273 Ing,
14274 Inteligo,
14275 MbankMtransfer,
14276 NestPrzelew,
14277 NoblePay,
14278 PbacZIpko,
14279 PlusBank,
14280 SantanderPrzelew24,
14281 TmobileUsbugiBankowe,
14282 ToyotaBank,
14283 Velobank,
14284 VolkswagenBank,
14285 Unknown(String),
14287}
14288impl ConfirmSetupIntentPaymentMethodDataP24Bank {
14289 pub fn as_str(&self) -> &str {
14290 use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
14291 match self {
14292 AliorBank => "alior_bank",
14293 BankMillennium => "bank_millennium",
14294 BankNowyBfgSa => "bank_nowy_bfg_sa",
14295 BankPekaoSa => "bank_pekao_sa",
14296 BankiSpbdzielcze => "banki_spbdzielcze",
14297 Blik => "blik",
14298 BnpParibas => "bnp_paribas",
14299 Boz => "boz",
14300 CitiHandlowy => "citi_handlowy",
14301 CreditAgricole => "credit_agricole",
14302 Envelobank => "envelobank",
14303 EtransferPocztowy24 => "etransfer_pocztowy24",
14304 GetinBank => "getin_bank",
14305 Ideabank => "ideabank",
14306 Ing => "ing",
14307 Inteligo => "inteligo",
14308 MbankMtransfer => "mbank_mtransfer",
14309 NestPrzelew => "nest_przelew",
14310 NoblePay => "noble_pay",
14311 PbacZIpko => "pbac_z_ipko",
14312 PlusBank => "plus_bank",
14313 SantanderPrzelew24 => "santander_przelew24",
14314 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
14315 ToyotaBank => "toyota_bank",
14316 Velobank => "velobank",
14317 VolkswagenBank => "volkswagen_bank",
14318 Unknown(v) => v,
14319 }
14320 }
14321}
14322
14323impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
14324 type Err = std::convert::Infallible;
14325 fn from_str(s: &str) -> Result<Self, Self::Err> {
14326 use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
14327 match s {
14328 "alior_bank" => Ok(AliorBank),
14329 "bank_millennium" => Ok(BankMillennium),
14330 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
14331 "bank_pekao_sa" => Ok(BankPekaoSa),
14332 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
14333 "blik" => Ok(Blik),
14334 "bnp_paribas" => Ok(BnpParibas),
14335 "boz" => Ok(Boz),
14336 "citi_handlowy" => Ok(CitiHandlowy),
14337 "credit_agricole" => Ok(CreditAgricole),
14338 "envelobank" => Ok(Envelobank),
14339 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
14340 "getin_bank" => Ok(GetinBank),
14341 "ideabank" => Ok(Ideabank),
14342 "ing" => Ok(Ing),
14343 "inteligo" => Ok(Inteligo),
14344 "mbank_mtransfer" => Ok(MbankMtransfer),
14345 "nest_przelew" => Ok(NestPrzelew),
14346 "noble_pay" => Ok(NoblePay),
14347 "pbac_z_ipko" => Ok(PbacZIpko),
14348 "plus_bank" => Ok(PlusBank),
14349 "santander_przelew24" => Ok(SantanderPrzelew24),
14350 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
14351 "toyota_bank" => Ok(ToyotaBank),
14352 "velobank" => Ok(Velobank),
14353 "volkswagen_bank" => Ok(VolkswagenBank),
14354 v => {
14355 tracing::warn!(
14356 "Unknown value '{}' for enum '{}'",
14357 v,
14358 "ConfirmSetupIntentPaymentMethodDataP24Bank"
14359 );
14360 Ok(Unknown(v.to_owned()))
14361 }
14362 }
14363 }
14364}
14365impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
14366 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14367 f.write_str(self.as_str())
14368 }
14369}
14370
14371#[cfg(not(feature = "redact-generated-debug"))]
14372impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
14373 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14374 f.write_str(self.as_str())
14375 }
14376}
14377#[cfg(feature = "redact-generated-debug")]
14378impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
14379 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14380 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataP24Bank))
14381 .finish_non_exhaustive()
14382 }
14383}
14384impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
14385 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14386 where
14387 S: serde::Serializer,
14388 {
14389 serializer.serialize_str(self.as_str())
14390 }
14391}
14392#[cfg(feature = "deserialize")]
14393impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
14394 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14395 use std::str::FromStr;
14396 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14397 Ok(Self::from_str(&s).expect("infallible"))
14398 }
14399}
14400#[derive(Clone, Eq, PartialEq)]
14402#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14403#[derive(serde::Serialize)]
14404pub struct ConfirmSetupIntentPaymentMethodDataPayto {
14405 #[serde(skip_serializing_if = "Option::is_none")]
14407 pub account_number: Option<String>,
14408 #[serde(skip_serializing_if = "Option::is_none")]
14410 pub bsb_number: Option<String>,
14411 #[serde(skip_serializing_if = "Option::is_none")]
14413 pub pay_id: Option<String>,
14414}
14415#[cfg(feature = "redact-generated-debug")]
14416impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataPayto {
14417 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14418 f.debug_struct("ConfirmSetupIntentPaymentMethodDataPayto").finish_non_exhaustive()
14419 }
14420}
14421impl ConfirmSetupIntentPaymentMethodDataPayto {
14422 pub fn new() -> Self {
14423 Self { account_number: None, bsb_number: None, pay_id: None }
14424 }
14425}
14426impl Default for ConfirmSetupIntentPaymentMethodDataPayto {
14427 fn default() -> Self {
14428 Self::new()
14429 }
14430}
14431#[derive(Clone, Eq, PartialEq)]
14433#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14434#[derive(serde::Serialize)]
14435pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
14436 pub iban: String,
14438}
14439#[cfg(feature = "redact-generated-debug")]
14440impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSepaDebit {
14441 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14442 f.debug_struct("ConfirmSetupIntentPaymentMethodDataSepaDebit").finish_non_exhaustive()
14443 }
14444}
14445impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
14446 pub fn new(iban: impl Into<String>) -> Self {
14447 Self { iban: iban.into() }
14448 }
14449}
14450#[derive(Clone, Eq, PartialEq)]
14452#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14453#[derive(serde::Serialize)]
14454pub struct ConfirmSetupIntentPaymentMethodDataSofort {
14455 pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
14457}
14458#[cfg(feature = "redact-generated-debug")]
14459impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofort {
14460 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14461 f.debug_struct("ConfirmSetupIntentPaymentMethodDataSofort").finish_non_exhaustive()
14462 }
14463}
14464impl ConfirmSetupIntentPaymentMethodDataSofort {
14465 pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
14466 Self { country: country.into() }
14467 }
14468}
14469#[derive(Clone, Eq, PartialEq)]
14471#[non_exhaustive]
14472pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
14473 At,
14474 Be,
14475 De,
14476 Es,
14477 It,
14478 Nl,
14479 Unknown(String),
14481}
14482impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
14483 pub fn as_str(&self) -> &str {
14484 use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
14485 match self {
14486 At => "AT",
14487 Be => "BE",
14488 De => "DE",
14489 Es => "ES",
14490 It => "IT",
14491 Nl => "NL",
14492 Unknown(v) => v,
14493 }
14494 }
14495}
14496
14497impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
14498 type Err = std::convert::Infallible;
14499 fn from_str(s: &str) -> Result<Self, Self::Err> {
14500 use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
14501 match s {
14502 "AT" => Ok(At),
14503 "BE" => Ok(Be),
14504 "DE" => Ok(De),
14505 "ES" => Ok(Es),
14506 "IT" => Ok(It),
14507 "NL" => Ok(Nl),
14508 v => {
14509 tracing::warn!(
14510 "Unknown value '{}' for enum '{}'",
14511 v,
14512 "ConfirmSetupIntentPaymentMethodDataSofortCountry"
14513 );
14514 Ok(Unknown(v.to_owned()))
14515 }
14516 }
14517 }
14518}
14519impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
14520 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14521 f.write_str(self.as_str())
14522 }
14523}
14524
14525#[cfg(not(feature = "redact-generated-debug"))]
14526impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
14527 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14528 f.write_str(self.as_str())
14529 }
14530}
14531#[cfg(feature = "redact-generated-debug")]
14532impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
14533 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14534 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataSofortCountry))
14535 .finish_non_exhaustive()
14536 }
14537}
14538impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
14539 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14540 where
14541 S: serde::Serializer,
14542 {
14543 serializer.serialize_str(self.as_str())
14544 }
14545}
14546#[cfg(feature = "deserialize")]
14547impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
14548 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14549 use std::str::FromStr;
14550 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14551 Ok(Self::from_str(&s).expect("infallible"))
14552 }
14553}
14554#[derive(Clone, Eq, PartialEq)]
14558#[non_exhaustive]
14559pub enum ConfirmSetupIntentPaymentMethodDataType {
14560 AcssDebit,
14561 Affirm,
14562 AfterpayClearpay,
14563 Alipay,
14564 Alma,
14565 AmazonPay,
14566 AuBecsDebit,
14567 BacsDebit,
14568 Bancontact,
14569 Billie,
14570 Blik,
14571 Boleto,
14572 Cashapp,
14573 Crypto,
14574 CustomerBalance,
14575 Eps,
14576 Fpx,
14577 Giropay,
14578 Grabpay,
14579 Ideal,
14580 KakaoPay,
14581 Klarna,
14582 Konbini,
14583 KrCard,
14584 Link,
14585 MbWay,
14586 Mobilepay,
14587 Multibanco,
14588 NaverPay,
14589 NzBankAccount,
14590 Oxxo,
14591 P24,
14592 PayByBank,
14593 Payco,
14594 Paynow,
14595 Paypal,
14596 Payto,
14597 Pix,
14598 Promptpay,
14599 RevolutPay,
14600 SamsungPay,
14601 Satispay,
14602 SepaDebit,
14603 Sofort,
14604 Sunbit,
14605 Swish,
14606 Twint,
14607 Upi,
14608 UsBankAccount,
14609 WechatPay,
14610 Zip,
14611 Unknown(String),
14613}
14614impl ConfirmSetupIntentPaymentMethodDataType {
14615 pub fn as_str(&self) -> &str {
14616 use ConfirmSetupIntentPaymentMethodDataType::*;
14617 match self {
14618 AcssDebit => "acss_debit",
14619 Affirm => "affirm",
14620 AfterpayClearpay => "afterpay_clearpay",
14621 Alipay => "alipay",
14622 Alma => "alma",
14623 AmazonPay => "amazon_pay",
14624 AuBecsDebit => "au_becs_debit",
14625 BacsDebit => "bacs_debit",
14626 Bancontact => "bancontact",
14627 Billie => "billie",
14628 Blik => "blik",
14629 Boleto => "boleto",
14630 Cashapp => "cashapp",
14631 Crypto => "crypto",
14632 CustomerBalance => "customer_balance",
14633 Eps => "eps",
14634 Fpx => "fpx",
14635 Giropay => "giropay",
14636 Grabpay => "grabpay",
14637 Ideal => "ideal",
14638 KakaoPay => "kakao_pay",
14639 Klarna => "klarna",
14640 Konbini => "konbini",
14641 KrCard => "kr_card",
14642 Link => "link",
14643 MbWay => "mb_way",
14644 Mobilepay => "mobilepay",
14645 Multibanco => "multibanco",
14646 NaverPay => "naver_pay",
14647 NzBankAccount => "nz_bank_account",
14648 Oxxo => "oxxo",
14649 P24 => "p24",
14650 PayByBank => "pay_by_bank",
14651 Payco => "payco",
14652 Paynow => "paynow",
14653 Paypal => "paypal",
14654 Payto => "payto",
14655 Pix => "pix",
14656 Promptpay => "promptpay",
14657 RevolutPay => "revolut_pay",
14658 SamsungPay => "samsung_pay",
14659 Satispay => "satispay",
14660 SepaDebit => "sepa_debit",
14661 Sofort => "sofort",
14662 Sunbit => "sunbit",
14663 Swish => "swish",
14664 Twint => "twint",
14665 Upi => "upi",
14666 UsBankAccount => "us_bank_account",
14667 WechatPay => "wechat_pay",
14668 Zip => "zip",
14669 Unknown(v) => v,
14670 }
14671 }
14672}
14673
14674impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
14675 type Err = std::convert::Infallible;
14676 fn from_str(s: &str) -> Result<Self, Self::Err> {
14677 use ConfirmSetupIntentPaymentMethodDataType::*;
14678 match s {
14679 "acss_debit" => Ok(AcssDebit),
14680 "affirm" => Ok(Affirm),
14681 "afterpay_clearpay" => Ok(AfterpayClearpay),
14682 "alipay" => Ok(Alipay),
14683 "alma" => Ok(Alma),
14684 "amazon_pay" => Ok(AmazonPay),
14685 "au_becs_debit" => Ok(AuBecsDebit),
14686 "bacs_debit" => Ok(BacsDebit),
14687 "bancontact" => Ok(Bancontact),
14688 "billie" => Ok(Billie),
14689 "blik" => Ok(Blik),
14690 "boleto" => Ok(Boleto),
14691 "cashapp" => Ok(Cashapp),
14692 "crypto" => Ok(Crypto),
14693 "customer_balance" => Ok(CustomerBalance),
14694 "eps" => Ok(Eps),
14695 "fpx" => Ok(Fpx),
14696 "giropay" => Ok(Giropay),
14697 "grabpay" => Ok(Grabpay),
14698 "ideal" => Ok(Ideal),
14699 "kakao_pay" => Ok(KakaoPay),
14700 "klarna" => Ok(Klarna),
14701 "konbini" => Ok(Konbini),
14702 "kr_card" => Ok(KrCard),
14703 "link" => Ok(Link),
14704 "mb_way" => Ok(MbWay),
14705 "mobilepay" => Ok(Mobilepay),
14706 "multibanco" => Ok(Multibanco),
14707 "naver_pay" => Ok(NaverPay),
14708 "nz_bank_account" => Ok(NzBankAccount),
14709 "oxxo" => Ok(Oxxo),
14710 "p24" => Ok(P24),
14711 "pay_by_bank" => Ok(PayByBank),
14712 "payco" => Ok(Payco),
14713 "paynow" => Ok(Paynow),
14714 "paypal" => Ok(Paypal),
14715 "payto" => Ok(Payto),
14716 "pix" => Ok(Pix),
14717 "promptpay" => Ok(Promptpay),
14718 "revolut_pay" => Ok(RevolutPay),
14719 "samsung_pay" => Ok(SamsungPay),
14720 "satispay" => Ok(Satispay),
14721 "sepa_debit" => Ok(SepaDebit),
14722 "sofort" => Ok(Sofort),
14723 "sunbit" => Ok(Sunbit),
14724 "swish" => Ok(Swish),
14725 "twint" => Ok(Twint),
14726 "upi" => Ok(Upi),
14727 "us_bank_account" => Ok(UsBankAccount),
14728 "wechat_pay" => Ok(WechatPay),
14729 "zip" => Ok(Zip),
14730 v => {
14731 tracing::warn!(
14732 "Unknown value '{}' for enum '{}'",
14733 v,
14734 "ConfirmSetupIntentPaymentMethodDataType"
14735 );
14736 Ok(Unknown(v.to_owned()))
14737 }
14738 }
14739 }
14740}
14741impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
14742 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14743 f.write_str(self.as_str())
14744 }
14745}
14746
14747#[cfg(not(feature = "redact-generated-debug"))]
14748impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
14749 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14750 f.write_str(self.as_str())
14751 }
14752}
14753#[cfg(feature = "redact-generated-debug")]
14754impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
14755 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14756 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataType)).finish_non_exhaustive()
14757 }
14758}
14759impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
14760 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14761 where
14762 S: serde::Serializer,
14763 {
14764 serializer.serialize_str(self.as_str())
14765 }
14766}
14767#[cfg(feature = "deserialize")]
14768impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
14769 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14770 use std::str::FromStr;
14771 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14772 Ok(Self::from_str(&s).expect("infallible"))
14773 }
14774}
14775#[derive(Clone, Eq, PartialEq)]
14777#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14778#[derive(serde::Serialize)]
14779pub struct ConfirmSetupIntentPaymentMethodDataUpi {
14780 #[serde(skip_serializing_if = "Option::is_none")]
14782 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodDataUpiMandateOptions>,
14783}
14784#[cfg(feature = "redact-generated-debug")]
14785impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpi {
14786 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14787 f.debug_struct("ConfirmSetupIntentPaymentMethodDataUpi").finish_non_exhaustive()
14788 }
14789}
14790impl ConfirmSetupIntentPaymentMethodDataUpi {
14791 pub fn new() -> Self {
14792 Self { mandate_options: None }
14793 }
14794}
14795impl Default for ConfirmSetupIntentPaymentMethodDataUpi {
14796 fn default() -> Self {
14797 Self::new()
14798 }
14799}
14800#[derive(Clone, Eq, PartialEq)]
14802#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14803#[derive(serde::Serialize)]
14804pub struct ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
14805 #[serde(skip_serializing_if = "Option::is_none")]
14807 pub amount: Option<i64>,
14808 #[serde(skip_serializing_if = "Option::is_none")]
14812 pub amount_type: Option<ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType>,
14813 #[serde(skip_serializing_if = "Option::is_none")]
14815 pub description: Option<String>,
14816 #[serde(skip_serializing_if = "Option::is_none")]
14818 pub end_date: Option<stripe_types::Timestamp>,
14819}
14820#[cfg(feature = "redact-generated-debug")]
14821impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
14822 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14823 f.debug_struct("ConfirmSetupIntentPaymentMethodDataUpiMandateOptions")
14824 .finish_non_exhaustive()
14825 }
14826}
14827impl ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
14828 pub fn new() -> Self {
14829 Self { amount: None, amount_type: None, description: None, end_date: None }
14830 }
14831}
14832impl Default for ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
14833 fn default() -> Self {
14834 Self::new()
14835 }
14836}
14837#[derive(Clone, Eq, PartialEq)]
14841#[non_exhaustive]
14842pub enum ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14843 Fixed,
14844 Maximum,
14845 Unknown(String),
14847}
14848impl ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14849 pub fn as_str(&self) -> &str {
14850 use ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
14851 match self {
14852 Fixed => "fixed",
14853 Maximum => "maximum",
14854 Unknown(v) => v,
14855 }
14856 }
14857}
14858
14859impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14860 type Err = std::convert::Infallible;
14861 fn from_str(s: &str) -> Result<Self, Self::Err> {
14862 use ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
14863 match s {
14864 "fixed" => Ok(Fixed),
14865 "maximum" => Ok(Maximum),
14866 v => {
14867 tracing::warn!(
14868 "Unknown value '{}' for enum '{}'",
14869 v,
14870 "ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType"
14871 );
14872 Ok(Unknown(v.to_owned()))
14873 }
14874 }
14875 }
14876}
14877impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14878 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14879 f.write_str(self.as_str())
14880 }
14881}
14882
14883#[cfg(not(feature = "redact-generated-debug"))]
14884impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14885 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14886 f.write_str(self.as_str())
14887 }
14888}
14889#[cfg(feature = "redact-generated-debug")]
14890impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14891 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14892 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType))
14893 .finish_non_exhaustive()
14894 }
14895}
14896impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
14897 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14898 where
14899 S: serde::Serializer,
14900 {
14901 serializer.serialize_str(self.as_str())
14902 }
14903}
14904#[cfg(feature = "deserialize")]
14905impl<'de> serde::Deserialize<'de>
14906 for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType
14907{
14908 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14909 use std::str::FromStr;
14910 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14911 Ok(Self::from_str(&s).expect("infallible"))
14912 }
14913}
14914#[derive(Clone, Eq, PartialEq)]
14916#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14917#[derive(serde::Serialize)]
14918pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
14919 #[serde(skip_serializing_if = "Option::is_none")]
14921 pub account_holder_type:
14922 Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
14923 #[serde(skip_serializing_if = "Option::is_none")]
14925 pub account_number: Option<String>,
14926 #[serde(skip_serializing_if = "Option::is_none")]
14928 pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
14929 #[serde(skip_serializing_if = "Option::is_none")]
14931 pub financial_connections_account: Option<String>,
14932 #[serde(skip_serializing_if = "Option::is_none")]
14934 pub routing_number: Option<String>,
14935}
14936#[cfg(feature = "redact-generated-debug")]
14937impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
14938 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14939 f.debug_struct("ConfirmSetupIntentPaymentMethodDataUsBankAccount").finish_non_exhaustive()
14940 }
14941}
14942impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
14943 pub fn new() -> Self {
14944 Self {
14945 account_holder_type: None,
14946 account_number: None,
14947 account_type: None,
14948 financial_connections_account: None,
14949 routing_number: None,
14950 }
14951 }
14952}
14953impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
14954 fn default() -> Self {
14955 Self::new()
14956 }
14957}
14958#[derive(Clone, Eq, PartialEq)]
14960#[non_exhaustive]
14961pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
14962 Company,
14963 Individual,
14964 Unknown(String),
14966}
14967impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
14968 pub fn as_str(&self) -> &str {
14969 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
14970 match self {
14971 Company => "company",
14972 Individual => "individual",
14973 Unknown(v) => v,
14974 }
14975 }
14976}
14977
14978impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
14979 type Err = std::convert::Infallible;
14980 fn from_str(s: &str) -> Result<Self, Self::Err> {
14981 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
14982 match s {
14983 "company" => Ok(Company),
14984 "individual" => Ok(Individual),
14985 v => {
14986 tracing::warn!(
14987 "Unknown value '{}' for enum '{}'",
14988 v,
14989 "ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
14990 );
14991 Ok(Unknown(v.to_owned()))
14992 }
14993 }
14994 }
14995}
14996impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
14997 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14998 f.write_str(self.as_str())
14999 }
15000}
15001
15002#[cfg(not(feature = "redact-generated-debug"))]
15003impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
15004 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15005 f.write_str(self.as_str())
15006 }
15007}
15008#[cfg(feature = "redact-generated-debug")]
15009impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
15010 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15011 f.debug_struct(stringify!(
15012 ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
15013 ))
15014 .finish_non_exhaustive()
15015 }
15016}
15017impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
15018 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15019 where
15020 S: serde::Serializer,
15021 {
15022 serializer.serialize_str(self.as_str())
15023 }
15024}
15025#[cfg(feature = "deserialize")]
15026impl<'de> serde::Deserialize<'de>
15027 for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
15028{
15029 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15030 use std::str::FromStr;
15031 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15032 Ok(Self::from_str(&s).expect("infallible"))
15033 }
15034}
15035#[derive(Clone, Eq, PartialEq)]
15037#[non_exhaustive]
15038pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15039 Checking,
15040 Savings,
15041 Unknown(String),
15043}
15044impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15045 pub fn as_str(&self) -> &str {
15046 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
15047 match self {
15048 Checking => "checking",
15049 Savings => "savings",
15050 Unknown(v) => v,
15051 }
15052 }
15053}
15054
15055impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15056 type Err = std::convert::Infallible;
15057 fn from_str(s: &str) -> Result<Self, Self::Err> {
15058 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
15059 match s {
15060 "checking" => Ok(Checking),
15061 "savings" => Ok(Savings),
15062 v => {
15063 tracing::warn!(
15064 "Unknown value '{}' for enum '{}'",
15065 v,
15066 "ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType"
15067 );
15068 Ok(Unknown(v.to_owned()))
15069 }
15070 }
15071 }
15072}
15073impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15074 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15075 f.write_str(self.as_str())
15076 }
15077}
15078
15079#[cfg(not(feature = "redact-generated-debug"))]
15080impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15081 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15082 f.write_str(self.as_str())
15083 }
15084}
15085#[cfg(feature = "redact-generated-debug")]
15086impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15087 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15088 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType))
15089 .finish_non_exhaustive()
15090 }
15091}
15092impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15093 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15094 where
15095 S: serde::Serializer,
15096 {
15097 serializer.serialize_str(self.as_str())
15098 }
15099}
15100#[cfg(feature = "deserialize")]
15101impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
15102 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15103 use std::str::FromStr;
15104 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15105 Ok(Self::from_str(&s).expect("infallible"))
15106 }
15107}
15108#[derive(Clone)]
15110#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15111#[derive(serde::Serialize)]
15112pub struct ConfirmSetupIntentPaymentMethodOptions {
15113 #[serde(skip_serializing_if = "Option::is_none")]
15115 pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
15116 #[serde(skip_serializing_if = "Option::is_none")]
15118 #[serde(with = "stripe_types::with_serde_json_opt")]
15119 pub amazon_pay: Option<miniserde::json::Value>,
15120 #[serde(skip_serializing_if = "Option::is_none")]
15122 pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
15123 #[serde(skip_serializing_if = "Option::is_none")]
15125 pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
15126 #[serde(skip_serializing_if = "Option::is_none")]
15128 #[serde(with = "stripe_types::with_serde_json_opt")]
15129 pub card_present: Option<miniserde::json::Value>,
15130 #[serde(skip_serializing_if = "Option::is_none")]
15132 pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
15133 #[serde(skip_serializing_if = "Option::is_none")]
15135 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
15136 #[serde(skip_serializing_if = "Option::is_none")]
15138 pub paypal: Option<PaymentMethodOptionsParam>,
15139 #[serde(skip_serializing_if = "Option::is_none")]
15141 pub payto: Option<ConfirmSetupIntentPaymentMethodOptionsPayto>,
15142 #[serde(skip_serializing_if = "Option::is_none")]
15144 pub pix: Option<ConfirmSetupIntentPaymentMethodOptionsPix>,
15145 #[serde(skip_serializing_if = "Option::is_none")]
15147 pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
15148 #[serde(skip_serializing_if = "Option::is_none")]
15150 pub upi: Option<ConfirmSetupIntentPaymentMethodOptionsUpi>,
15151 #[serde(skip_serializing_if = "Option::is_none")]
15153 pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
15154}
15155#[cfg(feature = "redact-generated-debug")]
15156impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptions {
15157 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15158 f.debug_struct("ConfirmSetupIntentPaymentMethodOptions").finish_non_exhaustive()
15159 }
15160}
15161impl ConfirmSetupIntentPaymentMethodOptions {
15162 pub fn new() -> Self {
15163 Self {
15164 acss_debit: None,
15165 amazon_pay: None,
15166 bacs_debit: None,
15167 card: None,
15168 card_present: None,
15169 klarna: None,
15170 link: None,
15171 paypal: None,
15172 payto: None,
15173 pix: None,
15174 sepa_debit: None,
15175 upi: None,
15176 us_bank_account: None,
15177 }
15178 }
15179}
15180impl Default for ConfirmSetupIntentPaymentMethodOptions {
15181 fn default() -> Self {
15182 Self::new()
15183 }
15184}
15185#[derive(Clone, Eq, PartialEq)]
15187#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15188#[derive(serde::Serialize)]
15189pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
15190 #[serde(skip_serializing_if = "Option::is_none")]
15193 pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
15194 #[serde(skip_serializing_if = "Option::is_none")]
15196 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
15197 #[serde(skip_serializing_if = "Option::is_none")]
15199 pub verification_method:
15200 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
15201}
15202#[cfg(feature = "redact-generated-debug")]
15203impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
15204 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15205 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
15206 }
15207}
15208impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
15209 pub fn new() -> Self {
15210 Self { currency: None, mandate_options: None, verification_method: None }
15211 }
15212}
15213impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
15214 fn default() -> Self {
15215 Self::new()
15216 }
15217}
15218#[derive(Clone, Eq, PartialEq)]
15221#[non_exhaustive]
15222pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15223 Cad,
15224 Usd,
15225 Unknown(String),
15227}
15228impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15229 pub fn as_str(&self) -> &str {
15230 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
15231 match self {
15232 Cad => "cad",
15233 Usd => "usd",
15234 Unknown(v) => v,
15235 }
15236 }
15237}
15238
15239impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15240 type Err = std::convert::Infallible;
15241 fn from_str(s: &str) -> Result<Self, Self::Err> {
15242 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
15243 match s {
15244 "cad" => Ok(Cad),
15245 "usd" => Ok(Usd),
15246 v => {
15247 tracing::warn!(
15248 "Unknown value '{}' for enum '{}'",
15249 v,
15250 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency"
15251 );
15252 Ok(Unknown(v.to_owned()))
15253 }
15254 }
15255 }
15256}
15257impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15258 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15259 f.write_str(self.as_str())
15260 }
15261}
15262
15263#[cfg(not(feature = "redact-generated-debug"))]
15264impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15265 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15266 f.write_str(self.as_str())
15267 }
15268}
15269#[cfg(feature = "redact-generated-debug")]
15270impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15271 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15272 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency))
15273 .finish_non_exhaustive()
15274 }
15275}
15276impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15277 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15278 where
15279 S: serde::Serializer,
15280 {
15281 serializer.serialize_str(self.as_str())
15282 }
15283}
15284#[cfg(feature = "deserialize")]
15285impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
15286 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15287 use std::str::FromStr;
15288 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15289 Ok(Self::from_str(&s).expect("infallible"))
15290 }
15291}
15292#[derive(Clone, Eq, PartialEq)]
15294#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15295#[derive(serde::Serialize)]
15296pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
15297 #[serde(skip_serializing_if = "Option::is_none")]
15301 pub custom_mandate_url: Option<String>,
15302 #[serde(skip_serializing_if = "Option::is_none")]
15304 pub default_for:
15305 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
15306 #[serde(skip_serializing_if = "Option::is_none")]
15309 pub interval_description: Option<String>,
15310 #[serde(skip_serializing_if = "Option::is_none")]
15312 pub payment_schedule:
15313 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
15314 #[serde(skip_serializing_if = "Option::is_none")]
15316 pub transaction_type:
15317 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
15318}
15319#[cfg(feature = "redact-generated-debug")]
15320impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
15321 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15322 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions")
15323 .finish_non_exhaustive()
15324 }
15325}
15326impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
15327 pub fn new() -> Self {
15328 Self {
15329 custom_mandate_url: None,
15330 default_for: None,
15331 interval_description: None,
15332 payment_schedule: None,
15333 transaction_type: None,
15334 }
15335 }
15336}
15337impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
15338 fn default() -> Self {
15339 Self::new()
15340 }
15341}
15342#[derive(Clone, Eq, PartialEq)]
15344#[non_exhaustive]
15345pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15346 Invoice,
15347 Subscription,
15348 Unknown(String),
15350}
15351impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15352 pub fn as_str(&self) -> &str {
15353 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
15354 match self {
15355 Invoice => "invoice",
15356 Subscription => "subscription",
15357 Unknown(v) => v,
15358 }
15359 }
15360}
15361
15362impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15363 type Err = std::convert::Infallible;
15364 fn from_str(s: &str) -> Result<Self, Self::Err> {
15365 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
15366 match s {
15367 "invoice" => Ok(Invoice),
15368 "subscription" => Ok(Subscription),
15369 v => {
15370 tracing::warn!(
15371 "Unknown value '{}' for enum '{}'",
15372 v,
15373 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
15374 );
15375 Ok(Unknown(v.to_owned()))
15376 }
15377 }
15378 }
15379}
15380impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15381 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15382 f.write_str(self.as_str())
15383 }
15384}
15385
15386#[cfg(not(feature = "redact-generated-debug"))]
15387impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15388 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15389 f.write_str(self.as_str())
15390 }
15391}
15392#[cfg(feature = "redact-generated-debug")]
15393impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15394 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15395 f.debug_struct(stringify!(
15396 ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
15397 ))
15398 .finish_non_exhaustive()
15399 }
15400}
15401impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
15402 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15403 where
15404 S: serde::Serializer,
15405 {
15406 serializer.serialize_str(self.as_str())
15407 }
15408}
15409#[cfg(feature = "deserialize")]
15410impl<'de> serde::Deserialize<'de>
15411 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
15412{
15413 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15414 use std::str::FromStr;
15415 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15416 Ok(Self::from_str(&s).expect("infallible"))
15417 }
15418}
15419#[derive(Clone, Eq, PartialEq)]
15421#[non_exhaustive]
15422pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
15423 Combined,
15424 Interval,
15425 Sporadic,
15426 Unknown(String),
15428}
15429impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
15430 pub fn as_str(&self) -> &str {
15431 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
15432 match self {
15433 Combined => "combined",
15434 Interval => "interval",
15435 Sporadic => "sporadic",
15436 Unknown(v) => v,
15437 }
15438 }
15439}
15440
15441impl std::str::FromStr
15442 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15443{
15444 type Err = std::convert::Infallible;
15445 fn from_str(s: &str) -> Result<Self, Self::Err> {
15446 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
15447 match s {
15448 "combined" => Ok(Combined),
15449 "interval" => Ok(Interval),
15450 "sporadic" => Ok(Sporadic),
15451 v => {
15452 tracing::warn!(
15453 "Unknown value '{}' for enum '{}'",
15454 v,
15455 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
15456 );
15457 Ok(Unknown(v.to_owned()))
15458 }
15459 }
15460 }
15461}
15462impl std::fmt::Display
15463 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15464{
15465 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15466 f.write_str(self.as_str())
15467 }
15468}
15469
15470#[cfg(not(feature = "redact-generated-debug"))]
15471impl std::fmt::Debug
15472 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15473{
15474 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15475 f.write_str(self.as_str())
15476 }
15477}
15478#[cfg(feature = "redact-generated-debug")]
15479impl std::fmt::Debug
15480 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15481{
15482 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15483 f.debug_struct(stringify!(
15484 ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15485 ))
15486 .finish_non_exhaustive()
15487 }
15488}
15489impl serde::Serialize
15490 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15491{
15492 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15493 where
15494 S: serde::Serializer,
15495 {
15496 serializer.serialize_str(self.as_str())
15497 }
15498}
15499#[cfg(feature = "deserialize")]
15500impl<'de> serde::Deserialize<'de>
15501 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15502{
15503 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15504 use std::str::FromStr;
15505 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15506 Ok(Self::from_str(&s).expect("infallible"))
15507 }
15508}
15509#[derive(Clone, Eq, PartialEq)]
15511#[non_exhaustive]
15512pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
15513 Business,
15514 Personal,
15515 Unknown(String),
15517}
15518impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
15519 pub fn as_str(&self) -> &str {
15520 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
15521 match self {
15522 Business => "business",
15523 Personal => "personal",
15524 Unknown(v) => v,
15525 }
15526 }
15527}
15528
15529impl std::str::FromStr
15530 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15531{
15532 type Err = std::convert::Infallible;
15533 fn from_str(s: &str) -> Result<Self, Self::Err> {
15534 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
15535 match s {
15536 "business" => Ok(Business),
15537 "personal" => Ok(Personal),
15538 v => {
15539 tracing::warn!(
15540 "Unknown value '{}' for enum '{}'",
15541 v,
15542 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
15543 );
15544 Ok(Unknown(v.to_owned()))
15545 }
15546 }
15547 }
15548}
15549impl std::fmt::Display
15550 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15551{
15552 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15553 f.write_str(self.as_str())
15554 }
15555}
15556
15557#[cfg(not(feature = "redact-generated-debug"))]
15558impl std::fmt::Debug
15559 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15560{
15561 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15562 f.write_str(self.as_str())
15563 }
15564}
15565#[cfg(feature = "redact-generated-debug")]
15566impl std::fmt::Debug
15567 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15568{
15569 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15570 f.debug_struct(stringify!(
15571 ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15572 ))
15573 .finish_non_exhaustive()
15574 }
15575}
15576impl serde::Serialize
15577 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15578{
15579 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15580 where
15581 S: serde::Serializer,
15582 {
15583 serializer.serialize_str(self.as_str())
15584 }
15585}
15586#[cfg(feature = "deserialize")]
15587impl<'de> serde::Deserialize<'de>
15588 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15589{
15590 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15591 use std::str::FromStr;
15592 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15593 Ok(Self::from_str(&s).expect("infallible"))
15594 }
15595}
15596#[derive(Clone, Eq, PartialEq)]
15598#[non_exhaustive]
15599pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15600 Automatic,
15601 Instant,
15602 Microdeposits,
15603 Unknown(String),
15605}
15606impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15607 pub fn as_str(&self) -> &str {
15608 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
15609 match self {
15610 Automatic => "automatic",
15611 Instant => "instant",
15612 Microdeposits => "microdeposits",
15613 Unknown(v) => v,
15614 }
15615 }
15616}
15617
15618impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15619 type Err = std::convert::Infallible;
15620 fn from_str(s: &str) -> Result<Self, Self::Err> {
15621 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
15622 match s {
15623 "automatic" => Ok(Automatic),
15624 "instant" => Ok(Instant),
15625 "microdeposits" => Ok(Microdeposits),
15626 v => {
15627 tracing::warn!(
15628 "Unknown value '{}' for enum '{}'",
15629 v,
15630 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
15631 );
15632 Ok(Unknown(v.to_owned()))
15633 }
15634 }
15635 }
15636}
15637impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15638 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15639 f.write_str(self.as_str())
15640 }
15641}
15642
15643#[cfg(not(feature = "redact-generated-debug"))]
15644impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15645 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15646 f.write_str(self.as_str())
15647 }
15648}
15649#[cfg(feature = "redact-generated-debug")]
15650impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15651 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15652 f.debug_struct(stringify!(
15653 ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
15654 ))
15655 .finish_non_exhaustive()
15656 }
15657}
15658impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15659 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15660 where
15661 S: serde::Serializer,
15662 {
15663 serializer.serialize_str(self.as_str())
15664 }
15665}
15666#[cfg(feature = "deserialize")]
15667impl<'de> serde::Deserialize<'de>
15668 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
15669{
15670 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15671 use std::str::FromStr;
15672 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15673 Ok(Self::from_str(&s).expect("infallible"))
15674 }
15675}
15676#[derive(Clone, Eq, PartialEq)]
15678#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15679#[derive(serde::Serialize)]
15680pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
15681 #[serde(skip_serializing_if = "Option::is_none")]
15683 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
15684}
15685#[cfg(feature = "redact-generated-debug")]
15686impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
15687 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15688 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
15689 }
15690}
15691impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
15692 pub fn new() -> Self {
15693 Self { mandate_options: None }
15694 }
15695}
15696impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
15697 fn default() -> Self {
15698 Self::new()
15699 }
15700}
15701#[derive(Clone, Eq, PartialEq)]
15703#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15704#[derive(serde::Serialize)]
15705pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
15706 #[serde(skip_serializing_if = "Option::is_none")]
15708 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
15709 #[serde(skip_serializing_if = "Option::is_none")]
15713 pub moto: Option<bool>,
15714 #[serde(skip_serializing_if = "Option::is_none")]
15718 pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
15719 #[serde(skip_serializing_if = "Option::is_none")]
15724 pub request_three_d_secure:
15725 Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
15726 #[serde(skip_serializing_if = "Option::is_none")]
15729 pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
15730}
15731#[cfg(feature = "redact-generated-debug")]
15732impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCard {
15733 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15734 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCard").finish_non_exhaustive()
15735 }
15736}
15737impl ConfirmSetupIntentPaymentMethodOptionsCard {
15738 pub fn new() -> Self {
15739 Self {
15740 mandate_options: None,
15741 moto: None,
15742 network: None,
15743 request_three_d_secure: None,
15744 three_d_secure: None,
15745 }
15746 }
15747}
15748impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
15749 fn default() -> Self {
15750 Self::new()
15751 }
15752}
15753#[derive(Clone, Eq, PartialEq)]
15755#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15756#[derive(serde::Serialize)]
15757pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
15758 pub amount: i64,
15760 pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
15764 pub currency: stripe_types::Currency,
15768 #[serde(skip_serializing_if = "Option::is_none")]
15770 pub description: Option<String>,
15771 #[serde(skip_serializing_if = "Option::is_none")]
15775 pub end_date: Option<stripe_types::Timestamp>,
15776 pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
15778 #[serde(skip_serializing_if = "Option::is_none")]
15783 pub interval_count: Option<u64>,
15784 pub reference: String,
15786 pub start_date: stripe_types::Timestamp,
15788 #[serde(skip_serializing_if = "Option::is_none")]
15790 pub supported_types:
15791 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
15792}
15793#[cfg(feature = "redact-generated-debug")]
15794impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
15795 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15796 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions")
15797 .finish_non_exhaustive()
15798 }
15799}
15800impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
15801 pub fn new(
15802 amount: impl Into<i64>,
15803 amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
15804 currency: impl Into<stripe_types::Currency>,
15805 interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
15806 reference: impl Into<String>,
15807 start_date: impl Into<stripe_types::Timestamp>,
15808 ) -> Self {
15809 Self {
15810 amount: amount.into(),
15811 amount_type: amount_type.into(),
15812 currency: currency.into(),
15813 description: None,
15814 end_date: None,
15815 interval: interval.into(),
15816 interval_count: None,
15817 reference: reference.into(),
15818 start_date: start_date.into(),
15819 supported_types: None,
15820 }
15821 }
15822}
15823#[derive(Clone, Eq, PartialEq)]
15827#[non_exhaustive]
15828pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15829 Fixed,
15830 Maximum,
15831 Unknown(String),
15833}
15834impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15835 pub fn as_str(&self) -> &str {
15836 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
15837 match self {
15838 Fixed => "fixed",
15839 Maximum => "maximum",
15840 Unknown(v) => v,
15841 }
15842 }
15843}
15844
15845impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15846 type Err = std::convert::Infallible;
15847 fn from_str(s: &str) -> Result<Self, Self::Err> {
15848 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
15849 match s {
15850 "fixed" => Ok(Fixed),
15851 "maximum" => Ok(Maximum),
15852 v => {
15853 tracing::warn!(
15854 "Unknown value '{}' for enum '{}'",
15855 v,
15856 "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
15857 );
15858 Ok(Unknown(v.to_owned()))
15859 }
15860 }
15861 }
15862}
15863impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15864 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15865 f.write_str(self.as_str())
15866 }
15867}
15868
15869#[cfg(not(feature = "redact-generated-debug"))]
15870impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15871 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15872 f.write_str(self.as_str())
15873 }
15874}
15875#[cfg(feature = "redact-generated-debug")]
15876impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15877 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15878 f.debug_struct(stringify!(
15879 ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
15880 ))
15881 .finish_non_exhaustive()
15882 }
15883}
15884impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15885 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15886 where
15887 S: serde::Serializer,
15888 {
15889 serializer.serialize_str(self.as_str())
15890 }
15891}
15892#[cfg(feature = "deserialize")]
15893impl<'de> serde::Deserialize<'de>
15894 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
15895{
15896 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15897 use std::str::FromStr;
15898 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15899 Ok(Self::from_str(&s).expect("infallible"))
15900 }
15901}
15902#[derive(Clone, Eq, PartialEq)]
15904#[non_exhaustive]
15905pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15906 Day,
15907 Month,
15908 Sporadic,
15909 Week,
15910 Year,
15911 Unknown(String),
15913}
15914impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15915 pub fn as_str(&self) -> &str {
15916 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
15917 match self {
15918 Day => "day",
15919 Month => "month",
15920 Sporadic => "sporadic",
15921 Week => "week",
15922 Year => "year",
15923 Unknown(v) => v,
15924 }
15925 }
15926}
15927
15928impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15929 type Err = std::convert::Infallible;
15930 fn from_str(s: &str) -> Result<Self, Self::Err> {
15931 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
15932 match s {
15933 "day" => Ok(Day),
15934 "month" => Ok(Month),
15935 "sporadic" => Ok(Sporadic),
15936 "week" => Ok(Week),
15937 "year" => Ok(Year),
15938 v => {
15939 tracing::warn!(
15940 "Unknown value '{}' for enum '{}'",
15941 v,
15942 "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
15943 );
15944 Ok(Unknown(v.to_owned()))
15945 }
15946 }
15947 }
15948}
15949impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15950 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15951 f.write_str(self.as_str())
15952 }
15953}
15954
15955#[cfg(not(feature = "redact-generated-debug"))]
15956impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15957 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15958 f.write_str(self.as_str())
15959 }
15960}
15961#[cfg(feature = "redact-generated-debug")]
15962impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15963 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15964 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval))
15965 .finish_non_exhaustive()
15966 }
15967}
15968impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
15969 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15970 where
15971 S: serde::Serializer,
15972 {
15973 serializer.serialize_str(self.as_str())
15974 }
15975}
15976#[cfg(feature = "deserialize")]
15977impl<'de> serde::Deserialize<'de>
15978 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
15979{
15980 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15981 use std::str::FromStr;
15982 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15983 Ok(Self::from_str(&s).expect("infallible"))
15984 }
15985}
15986#[derive(Clone, Eq, PartialEq)]
15988#[non_exhaustive]
15989pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15990 India,
15991 Unknown(String),
15993}
15994impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15995 pub fn as_str(&self) -> &str {
15996 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
15997 match self {
15998 India => "india",
15999 Unknown(v) => v,
16000 }
16001 }
16002}
16003
16004impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16005 type Err = std::convert::Infallible;
16006 fn from_str(s: &str) -> Result<Self, Self::Err> {
16007 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
16008 match s {
16009 "india" => Ok(India),
16010 v => {
16011 tracing::warn!(
16012 "Unknown value '{}' for enum '{}'",
16013 v,
16014 "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
16015 );
16016 Ok(Unknown(v.to_owned()))
16017 }
16018 }
16019 }
16020}
16021impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16022 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16023 f.write_str(self.as_str())
16024 }
16025}
16026
16027#[cfg(not(feature = "redact-generated-debug"))]
16028impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16029 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16030 f.write_str(self.as_str())
16031 }
16032}
16033#[cfg(feature = "redact-generated-debug")]
16034impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16035 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16036 f.debug_struct(stringify!(
16037 ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
16038 ))
16039 .finish_non_exhaustive()
16040 }
16041}
16042impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16043 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16044 where
16045 S: serde::Serializer,
16046 {
16047 serializer.serialize_str(self.as_str())
16048 }
16049}
16050#[cfg(feature = "deserialize")]
16051impl<'de> serde::Deserialize<'de>
16052 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
16053{
16054 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16055 use std::str::FromStr;
16056 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16057 Ok(Self::from_str(&s).expect("infallible"))
16058 }
16059}
16060#[derive(Clone, Eq, PartialEq)]
16064#[non_exhaustive]
16065pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16066 Amex,
16067 CartesBancaires,
16068 Diners,
16069 Discover,
16070 EftposAu,
16071 Girocard,
16072 Interac,
16073 Jcb,
16074 Link,
16075 Mastercard,
16076 Unionpay,
16077 Unknown,
16078 Visa,
16079 _Unknown(String),
16082}
16083impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16084 pub fn as_str(&self) -> &str {
16085 use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
16086 match self {
16087 Amex => "amex",
16088 CartesBancaires => "cartes_bancaires",
16089 Diners => "diners",
16090 Discover => "discover",
16091 EftposAu => "eftpos_au",
16092 Girocard => "girocard",
16093 Interac => "interac",
16094 Jcb => "jcb",
16095 Link => "link",
16096 Mastercard => "mastercard",
16097 Unionpay => "unionpay",
16098 Unknown => "unknown",
16099 Visa => "visa",
16100 _Unknown(v) => v,
16101 }
16102 }
16103}
16104
16105impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16106 type Err = std::convert::Infallible;
16107 fn from_str(s: &str) -> Result<Self, Self::Err> {
16108 use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
16109 match s {
16110 "amex" => Ok(Amex),
16111 "cartes_bancaires" => Ok(CartesBancaires),
16112 "diners" => Ok(Diners),
16113 "discover" => Ok(Discover),
16114 "eftpos_au" => Ok(EftposAu),
16115 "girocard" => Ok(Girocard),
16116 "interac" => Ok(Interac),
16117 "jcb" => Ok(Jcb),
16118 "link" => Ok(Link),
16119 "mastercard" => Ok(Mastercard),
16120 "unionpay" => Ok(Unionpay),
16121 "unknown" => Ok(Unknown),
16122 "visa" => Ok(Visa),
16123 v => {
16124 tracing::warn!(
16125 "Unknown value '{}' for enum '{}'",
16126 v,
16127 "ConfirmSetupIntentPaymentMethodOptionsCardNetwork"
16128 );
16129 Ok(_Unknown(v.to_owned()))
16130 }
16131 }
16132 }
16133}
16134impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16135 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16136 f.write_str(self.as_str())
16137 }
16138}
16139
16140#[cfg(not(feature = "redact-generated-debug"))]
16141impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16142 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16143 f.write_str(self.as_str())
16144 }
16145}
16146#[cfg(feature = "redact-generated-debug")]
16147impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16148 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16149 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardNetwork))
16150 .finish_non_exhaustive()
16151 }
16152}
16153impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16154 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16155 where
16156 S: serde::Serializer,
16157 {
16158 serializer.serialize_str(self.as_str())
16159 }
16160}
16161#[cfg(feature = "deserialize")]
16162impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
16163 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16164 use std::str::FromStr;
16165 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16166 Ok(Self::from_str(&s).expect("infallible"))
16167 }
16168}
16169#[derive(Clone, Eq, PartialEq)]
16174#[non_exhaustive]
16175pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16176 Any,
16177 Automatic,
16178 Challenge,
16179 Unknown(String),
16181}
16182impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16183 pub fn as_str(&self) -> &str {
16184 use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
16185 match self {
16186 Any => "any",
16187 Automatic => "automatic",
16188 Challenge => "challenge",
16189 Unknown(v) => v,
16190 }
16191 }
16192}
16193
16194impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16195 type Err = std::convert::Infallible;
16196 fn from_str(s: &str) -> Result<Self, Self::Err> {
16197 use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
16198 match s {
16199 "any" => Ok(Any),
16200 "automatic" => Ok(Automatic),
16201 "challenge" => Ok(Challenge),
16202 v => {
16203 tracing::warn!(
16204 "Unknown value '{}' for enum '{}'",
16205 v,
16206 "ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
16207 );
16208 Ok(Unknown(v.to_owned()))
16209 }
16210 }
16211 }
16212}
16213impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16214 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16215 f.write_str(self.as_str())
16216 }
16217}
16218
16219#[cfg(not(feature = "redact-generated-debug"))]
16220impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16221 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16222 f.write_str(self.as_str())
16223 }
16224}
16225#[cfg(feature = "redact-generated-debug")]
16226impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16227 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16228 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure))
16229 .finish_non_exhaustive()
16230 }
16231}
16232impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
16233 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16234 where
16235 S: serde::Serializer,
16236 {
16237 serializer.serialize_str(self.as_str())
16238 }
16239}
16240#[cfg(feature = "deserialize")]
16241impl<'de> serde::Deserialize<'de>
16242 for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
16243{
16244 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16245 use std::str::FromStr;
16246 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16247 Ok(Self::from_str(&s).expect("infallible"))
16248 }
16249}
16250#[derive(Clone, Eq, PartialEq)]
16253#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16254#[derive(serde::Serialize)]
16255pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
16256 #[serde(skip_serializing_if = "Option::is_none")]
16258 pub ares_trans_status:
16259 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
16260 #[serde(skip_serializing_if = "Option::is_none")]
16265 pub cryptogram: Option<String>,
16266 #[serde(skip_serializing_if = "Option::is_none")]
16269 pub electronic_commerce_indicator:
16270 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
16271 #[serde(skip_serializing_if = "Option::is_none")]
16275 pub network_options:
16276 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
16277 #[serde(skip_serializing_if = "Option::is_none")]
16280 pub requestor_challenge_indicator: Option<String>,
16281 #[serde(skip_serializing_if = "Option::is_none")]
16284 pub transaction_id: Option<String>,
16285 #[serde(skip_serializing_if = "Option::is_none")]
16287 pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
16288}
16289#[cfg(feature = "redact-generated-debug")]
16290impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
16291 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16292 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure")
16293 .finish_non_exhaustive()
16294 }
16295}
16296impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
16297 pub fn new() -> Self {
16298 Self {
16299 ares_trans_status: None,
16300 cryptogram: None,
16301 electronic_commerce_indicator: None,
16302 network_options: None,
16303 requestor_challenge_indicator: None,
16304 transaction_id: None,
16305 version: None,
16306 }
16307 }
16308}
16309impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
16310 fn default() -> Self {
16311 Self::new()
16312 }
16313}
16314#[derive(Clone, Eq, PartialEq)]
16316#[non_exhaustive]
16317pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16318 A,
16319 C,
16320 I,
16321 N,
16322 R,
16323 U,
16324 Y,
16325 Unknown(String),
16327}
16328impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16329 pub fn as_str(&self) -> &str {
16330 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16331 match self {
16332 A => "A",
16333 C => "C",
16334 I => "I",
16335 N => "N",
16336 R => "R",
16337 U => "U",
16338 Y => "Y",
16339 Unknown(v) => v,
16340 }
16341 }
16342}
16343
16344impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16345 type Err = std::convert::Infallible;
16346 fn from_str(s: &str) -> Result<Self, Self::Err> {
16347 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16348 match s {
16349 "A" => Ok(A),
16350 "C" => Ok(C),
16351 "I" => Ok(I),
16352 "N" => Ok(N),
16353 "R" => Ok(R),
16354 "U" => Ok(U),
16355 "Y" => Ok(Y),
16356 v => {
16357 tracing::warn!(
16358 "Unknown value '{}' for enum '{}'",
16359 v,
16360 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
16361 );
16362 Ok(Unknown(v.to_owned()))
16363 }
16364 }
16365 }
16366}
16367impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16368 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16369 f.write_str(self.as_str())
16370 }
16371}
16372
16373#[cfg(not(feature = "redact-generated-debug"))]
16374impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16375 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16376 f.write_str(self.as_str())
16377 }
16378}
16379#[cfg(feature = "redact-generated-debug")]
16380impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16381 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16382 f.debug_struct(stringify!(
16383 ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
16384 ))
16385 .finish_non_exhaustive()
16386 }
16387}
16388impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16389 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16390 where
16391 S: serde::Serializer,
16392 {
16393 serializer.serialize_str(self.as_str())
16394 }
16395}
16396#[cfg(feature = "deserialize")]
16397impl<'de> serde::Deserialize<'de>
16398 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
16399{
16400 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16401 use std::str::FromStr;
16402 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16403 Ok(Self::from_str(&s).expect("infallible"))
16404 }
16405}
16406#[derive(Clone, Eq, PartialEq)]
16409#[non_exhaustive]
16410pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16411 V01,
16412 V02,
16413 V05,
16414 V06,
16415 V07,
16416 Unknown(String),
16418}
16419impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16420 pub fn as_str(&self) -> &str {
16421 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16422 match self {
16423 V01 => "01",
16424 V02 => "02",
16425 V05 => "05",
16426 V06 => "06",
16427 V07 => "07",
16428 Unknown(v) => v,
16429 }
16430 }
16431}
16432
16433impl std::str::FromStr
16434 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16435{
16436 type Err = std::convert::Infallible;
16437 fn from_str(s: &str) -> Result<Self, Self::Err> {
16438 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16439 match s {
16440 "01" => Ok(V01),
16441 "02" => Ok(V02),
16442 "05" => Ok(V05),
16443 "06" => Ok(V06),
16444 "07" => Ok(V07),
16445 v => {
16446 tracing::warn!(
16447 "Unknown value '{}' for enum '{}'",
16448 v,
16449 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
16450 );
16451 Ok(Unknown(v.to_owned()))
16452 }
16453 }
16454 }
16455}
16456impl std::fmt::Display
16457 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16458{
16459 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16460 f.write_str(self.as_str())
16461 }
16462}
16463
16464#[cfg(not(feature = "redact-generated-debug"))]
16465impl std::fmt::Debug
16466 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16467{
16468 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16469 f.write_str(self.as_str())
16470 }
16471}
16472#[cfg(feature = "redact-generated-debug")]
16473impl std::fmt::Debug
16474 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16475{
16476 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16477 f.debug_struct(stringify!(
16478 ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16479 ))
16480 .finish_non_exhaustive()
16481 }
16482}
16483impl serde::Serialize
16484 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16485{
16486 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16487 where
16488 S: serde::Serializer,
16489 {
16490 serializer.serialize_str(self.as_str())
16491 }
16492}
16493#[cfg(feature = "deserialize")]
16494impl<'de> serde::Deserialize<'de>
16495 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16496{
16497 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16498 use std::str::FromStr;
16499 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16500 Ok(Self::from_str(&s).expect("infallible"))
16501 }
16502}
16503#[derive(Clone, Eq, PartialEq)]
16507#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16508#[derive(serde::Serialize)]
16509pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16510 #[serde(skip_serializing_if = "Option::is_none")]
16512 pub cartes_bancaires:
16513 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
16514}
16515#[cfg(feature = "redact-generated-debug")]
16516impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16517 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16518 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions")
16519 .finish_non_exhaustive()
16520 }
16521}
16522impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16523 pub fn new() -> Self {
16524 Self { cartes_bancaires: None }
16525 }
16526}
16527impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16528 fn default() -> Self {
16529 Self::new()
16530 }
16531}
16532#[derive(Clone, Eq, PartialEq)]
16534#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16535#[derive(serde::Serialize)]
16536pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16537 pub cb_avalgo:
16541 ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
16542 #[serde(skip_serializing_if = "Option::is_none")]
16547 pub cb_exemption: Option<String>,
16548 #[serde(skip_serializing_if = "Option::is_none")]
16551 pub cb_score: Option<i64>,
16552}
16553#[cfg(feature = "redact-generated-debug")]
16554impl std::fmt::Debug
16555 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires
16556{
16557 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16558 f.debug_struct(
16559 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires",
16560 )
16561 .finish_non_exhaustive()
16562 }
16563}
16564impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16565 pub fn new(
16566 cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
16567 ) -> Self {
16568 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
16569 }
16570}
16571#[derive(Clone, Eq, PartialEq)]
16575#[non_exhaustive]
16576pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16577{
16578 V0,
16579 V1,
16580 V2,
16581 V3,
16582 V4,
16583 A,
16584 Unknown(String),
16586}
16587impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
16588 pub fn as_str(&self) -> &str {
16589 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16590 match self {
16591 V0 => "0",
16592 V1 => "1",
16593 V2 => "2",
16594 V3 => "3",
16595 V4 => "4",
16596 A => "A",
16597 Unknown(v) => v,
16598 }
16599 }
16600}
16601
16602impl std::str::FromStr
16603 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16604{
16605 type Err = std::convert::Infallible;
16606 fn from_str(s: &str) -> Result<Self, Self::Err> {
16607 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16608 match s {
16609 "0" => Ok(V0),
16610 "1" => Ok(V1),
16611 "2" => Ok(V2),
16612 "3" => Ok(V3),
16613 "4" => Ok(V4),
16614 "A" => Ok(A),
16615 v => {
16616 tracing::warn!(
16617 "Unknown value '{}' for enum '{}'",
16618 v,
16619 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
16620 );
16621 Ok(Unknown(v.to_owned()))
16622 }
16623 }
16624 }
16625}
16626impl std::fmt::Display
16627 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16628{
16629 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16630 f.write_str(self.as_str())
16631 }
16632}
16633
16634#[cfg(not(feature = "redact-generated-debug"))]
16635impl std::fmt::Debug
16636 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16637{
16638 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16639 f.write_str(self.as_str())
16640 }
16641}
16642#[cfg(feature = "redact-generated-debug")]
16643impl std::fmt::Debug
16644 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16645{
16646 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16647 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo)).finish_non_exhaustive()
16648 }
16649}
16650impl serde::Serialize
16651 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16652{
16653 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16654 where
16655 S: serde::Serializer,
16656 {
16657 serializer.serialize_str(self.as_str())
16658 }
16659}
16660#[cfg(feature = "deserialize")]
16661impl<'de> serde::Deserialize<'de>
16662 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16663{
16664 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16665 use std::str::FromStr;
16666 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16667 Ok(Self::from_str(&s).expect("infallible"))
16668 }
16669}
16670#[derive(Clone, Eq, PartialEq)]
16672#[non_exhaustive]
16673pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16674 V1_0_2,
16675 V2_1_0,
16676 V2_2_0,
16677 V2_3_0,
16678 V2_3_1,
16679 Unknown(String),
16681}
16682impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16683 pub fn as_str(&self) -> &str {
16684 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
16685 match self {
16686 V1_0_2 => "1.0.2",
16687 V2_1_0 => "2.1.0",
16688 V2_2_0 => "2.2.0",
16689 V2_3_0 => "2.3.0",
16690 V2_3_1 => "2.3.1",
16691 Unknown(v) => v,
16692 }
16693 }
16694}
16695
16696impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16697 type Err = std::convert::Infallible;
16698 fn from_str(s: &str) -> Result<Self, Self::Err> {
16699 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
16700 match s {
16701 "1.0.2" => Ok(V1_0_2),
16702 "2.1.0" => Ok(V2_1_0),
16703 "2.2.0" => Ok(V2_2_0),
16704 "2.3.0" => Ok(V2_3_0),
16705 "2.3.1" => Ok(V2_3_1),
16706 v => {
16707 tracing::warn!(
16708 "Unknown value '{}' for enum '{}'",
16709 v,
16710 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
16711 );
16712 Ok(Unknown(v.to_owned()))
16713 }
16714 }
16715 }
16716}
16717impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16718 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16719 f.write_str(self.as_str())
16720 }
16721}
16722
16723#[cfg(not(feature = "redact-generated-debug"))]
16724impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16725 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16726 f.write_str(self.as_str())
16727 }
16728}
16729#[cfg(feature = "redact-generated-debug")]
16730impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16731 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16732 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion))
16733 .finish_non_exhaustive()
16734 }
16735}
16736impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
16737 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16738 where
16739 S: serde::Serializer,
16740 {
16741 serializer.serialize_str(self.as_str())
16742 }
16743}
16744#[cfg(feature = "deserialize")]
16745impl<'de> serde::Deserialize<'de>
16746 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
16747{
16748 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16749 use std::str::FromStr;
16750 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16751 Ok(Self::from_str(&s).expect("infallible"))
16752 }
16753}
16754#[derive(Clone, Eq, PartialEq)]
16756#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16757#[derive(serde::Serialize)]
16758pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
16759 #[serde(skip_serializing_if = "Option::is_none")]
16761 pub currency: Option<stripe_types::Currency>,
16762 #[serde(skip_serializing_if = "Option::is_none")]
16764 pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
16765 #[serde(skip_serializing_if = "Option::is_none")]
16767 pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
16768 #[serde(skip_serializing_if = "Option::is_none")]
16770 pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
16771}
16772#[cfg(feature = "redact-generated-debug")]
16773impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarna {
16774 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16775 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsKlarna").finish_non_exhaustive()
16776 }
16777}
16778impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
16779 pub fn new() -> Self {
16780 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
16781 }
16782}
16783impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
16784 fn default() -> Self {
16785 Self::new()
16786 }
16787}
16788#[derive(Clone, Eq, PartialEq)]
16790#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16791#[derive(serde::Serialize)]
16792pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
16793 #[serde(skip_serializing_if = "Option::is_none")]
16796 pub average_amount: Option<i64>,
16797 #[serde(skip_serializing_if = "Option::is_none")]
16800 pub maximum_amount: Option<i64>,
16801 #[serde(skip_serializing_if = "Option::is_none")]
16804 pub minimum_amount: Option<i64>,
16805 #[serde(skip_serializing_if = "Option::is_none")]
16807 pub purchase_interval:
16808 Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
16809 #[serde(skip_serializing_if = "Option::is_none")]
16811 pub purchase_interval_count: Option<u64>,
16812}
16813#[cfg(feature = "redact-generated-debug")]
16814impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
16815 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16816 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand")
16817 .finish_non_exhaustive()
16818 }
16819}
16820impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
16821 pub fn new() -> Self {
16822 Self {
16823 average_amount: None,
16824 maximum_amount: None,
16825 minimum_amount: None,
16826 purchase_interval: None,
16827 purchase_interval_count: None,
16828 }
16829 }
16830}
16831impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
16832 fn default() -> Self {
16833 Self::new()
16834 }
16835}
16836#[derive(Clone, Eq, PartialEq)]
16838#[non_exhaustive]
16839pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16840 Day,
16841 Month,
16842 Week,
16843 Year,
16844 Unknown(String),
16846}
16847impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16848 pub fn as_str(&self) -> &str {
16849 use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
16850 match self {
16851 Day => "day",
16852 Month => "month",
16853 Week => "week",
16854 Year => "year",
16855 Unknown(v) => v,
16856 }
16857 }
16858}
16859
16860impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16861 type Err = std::convert::Infallible;
16862 fn from_str(s: &str) -> Result<Self, Self::Err> {
16863 use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
16864 match s {
16865 "day" => Ok(Day),
16866 "month" => Ok(Month),
16867 "week" => Ok(Week),
16868 "year" => Ok(Year),
16869 v => {
16870 tracing::warn!(
16871 "Unknown value '{}' for enum '{}'",
16872 v,
16873 "ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
16874 );
16875 Ok(Unknown(v.to_owned()))
16876 }
16877 }
16878 }
16879}
16880impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16881 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16882 f.write_str(self.as_str())
16883 }
16884}
16885
16886#[cfg(not(feature = "redact-generated-debug"))]
16887impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16888 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16889 f.write_str(self.as_str())
16890 }
16891}
16892#[cfg(feature = "redact-generated-debug")]
16893impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16894 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16895 f.debug_struct(stringify!(
16896 ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
16897 ))
16898 .finish_non_exhaustive()
16899 }
16900}
16901impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
16902 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16903 where
16904 S: serde::Serializer,
16905 {
16906 serializer.serialize_str(self.as_str())
16907 }
16908}
16909#[cfg(feature = "deserialize")]
16910impl<'de> serde::Deserialize<'de>
16911 for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
16912{
16913 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16914 use std::str::FromStr;
16915 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16916 Ok(Self::from_str(&s).expect("infallible"))
16917 }
16918}
16919#[derive(Clone, Eq, PartialEq)]
16921#[non_exhaustive]
16922pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
16923 CsMinusCz,
16924 DaMinusDk,
16925 DeMinusAt,
16926 DeMinusCh,
16927 DeMinusDe,
16928 ElMinusGr,
16929 EnMinusAt,
16930 EnMinusAu,
16931 EnMinusBe,
16932 EnMinusCa,
16933 EnMinusCh,
16934 EnMinusCz,
16935 EnMinusDe,
16936 EnMinusDk,
16937 EnMinusEs,
16938 EnMinusFi,
16939 EnMinusFr,
16940 EnMinusGb,
16941 EnMinusGr,
16942 EnMinusIe,
16943 EnMinusIt,
16944 EnMinusNl,
16945 EnMinusNo,
16946 EnMinusNz,
16947 EnMinusPl,
16948 EnMinusPt,
16949 EnMinusRo,
16950 EnMinusSe,
16951 EnMinusUs,
16952 EsMinusEs,
16953 EsMinusUs,
16954 FiMinusFi,
16955 FrMinusBe,
16956 FrMinusCa,
16957 FrMinusCh,
16958 FrMinusFr,
16959 ItMinusCh,
16960 ItMinusIt,
16961 NbMinusNo,
16962 NlMinusBe,
16963 NlMinusNl,
16964 PlMinusPl,
16965 PtMinusPt,
16966 RoMinusRo,
16967 SvMinusFi,
16968 SvMinusSe,
16969 Unknown(String),
16971}
16972impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
16973 pub fn as_str(&self) -> &str {
16974 use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
16975 match self {
16976 CsMinusCz => "cs-CZ",
16977 DaMinusDk => "da-DK",
16978 DeMinusAt => "de-AT",
16979 DeMinusCh => "de-CH",
16980 DeMinusDe => "de-DE",
16981 ElMinusGr => "el-GR",
16982 EnMinusAt => "en-AT",
16983 EnMinusAu => "en-AU",
16984 EnMinusBe => "en-BE",
16985 EnMinusCa => "en-CA",
16986 EnMinusCh => "en-CH",
16987 EnMinusCz => "en-CZ",
16988 EnMinusDe => "en-DE",
16989 EnMinusDk => "en-DK",
16990 EnMinusEs => "en-ES",
16991 EnMinusFi => "en-FI",
16992 EnMinusFr => "en-FR",
16993 EnMinusGb => "en-GB",
16994 EnMinusGr => "en-GR",
16995 EnMinusIe => "en-IE",
16996 EnMinusIt => "en-IT",
16997 EnMinusNl => "en-NL",
16998 EnMinusNo => "en-NO",
16999 EnMinusNz => "en-NZ",
17000 EnMinusPl => "en-PL",
17001 EnMinusPt => "en-PT",
17002 EnMinusRo => "en-RO",
17003 EnMinusSe => "en-SE",
17004 EnMinusUs => "en-US",
17005 EsMinusEs => "es-ES",
17006 EsMinusUs => "es-US",
17007 FiMinusFi => "fi-FI",
17008 FrMinusBe => "fr-BE",
17009 FrMinusCa => "fr-CA",
17010 FrMinusCh => "fr-CH",
17011 FrMinusFr => "fr-FR",
17012 ItMinusCh => "it-CH",
17013 ItMinusIt => "it-IT",
17014 NbMinusNo => "nb-NO",
17015 NlMinusBe => "nl-BE",
17016 NlMinusNl => "nl-NL",
17017 PlMinusPl => "pl-PL",
17018 PtMinusPt => "pt-PT",
17019 RoMinusRo => "ro-RO",
17020 SvMinusFi => "sv-FI",
17021 SvMinusSe => "sv-SE",
17022 Unknown(v) => v,
17023 }
17024 }
17025}
17026
17027impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
17028 type Err = std::convert::Infallible;
17029 fn from_str(s: &str) -> Result<Self, Self::Err> {
17030 use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
17031 match s {
17032 "cs-CZ" => Ok(CsMinusCz),
17033 "da-DK" => Ok(DaMinusDk),
17034 "de-AT" => Ok(DeMinusAt),
17035 "de-CH" => Ok(DeMinusCh),
17036 "de-DE" => Ok(DeMinusDe),
17037 "el-GR" => Ok(ElMinusGr),
17038 "en-AT" => Ok(EnMinusAt),
17039 "en-AU" => Ok(EnMinusAu),
17040 "en-BE" => Ok(EnMinusBe),
17041 "en-CA" => Ok(EnMinusCa),
17042 "en-CH" => Ok(EnMinusCh),
17043 "en-CZ" => Ok(EnMinusCz),
17044 "en-DE" => Ok(EnMinusDe),
17045 "en-DK" => Ok(EnMinusDk),
17046 "en-ES" => Ok(EnMinusEs),
17047 "en-FI" => Ok(EnMinusFi),
17048 "en-FR" => Ok(EnMinusFr),
17049 "en-GB" => Ok(EnMinusGb),
17050 "en-GR" => Ok(EnMinusGr),
17051 "en-IE" => Ok(EnMinusIe),
17052 "en-IT" => Ok(EnMinusIt),
17053 "en-NL" => Ok(EnMinusNl),
17054 "en-NO" => Ok(EnMinusNo),
17055 "en-NZ" => Ok(EnMinusNz),
17056 "en-PL" => Ok(EnMinusPl),
17057 "en-PT" => Ok(EnMinusPt),
17058 "en-RO" => Ok(EnMinusRo),
17059 "en-SE" => Ok(EnMinusSe),
17060 "en-US" => Ok(EnMinusUs),
17061 "es-ES" => Ok(EsMinusEs),
17062 "es-US" => Ok(EsMinusUs),
17063 "fi-FI" => Ok(FiMinusFi),
17064 "fr-BE" => Ok(FrMinusBe),
17065 "fr-CA" => Ok(FrMinusCa),
17066 "fr-CH" => Ok(FrMinusCh),
17067 "fr-FR" => Ok(FrMinusFr),
17068 "it-CH" => Ok(ItMinusCh),
17069 "it-IT" => Ok(ItMinusIt),
17070 "nb-NO" => Ok(NbMinusNo),
17071 "nl-BE" => Ok(NlMinusBe),
17072 "nl-NL" => Ok(NlMinusNl),
17073 "pl-PL" => Ok(PlMinusPl),
17074 "pt-PT" => Ok(PtMinusPt),
17075 "ro-RO" => Ok(RoMinusRo),
17076 "sv-FI" => Ok(SvMinusFi),
17077 "sv-SE" => Ok(SvMinusSe),
17078 v => {
17079 tracing::warn!(
17080 "Unknown value '{}' for enum '{}'",
17081 v,
17082 "ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
17083 );
17084 Ok(Unknown(v.to_owned()))
17085 }
17086 }
17087 }
17088}
17089impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
17090 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17091 f.write_str(self.as_str())
17092 }
17093}
17094
17095#[cfg(not(feature = "redact-generated-debug"))]
17096impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
17097 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17098 f.write_str(self.as_str())
17099 }
17100}
17101#[cfg(feature = "redact-generated-debug")]
17102impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
17103 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17104 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale))
17105 .finish_non_exhaustive()
17106 }
17107}
17108impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
17109 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17110 where
17111 S: serde::Serializer,
17112 {
17113 serializer.serialize_str(self.as_str())
17114 }
17115}
17116#[cfg(feature = "deserialize")]
17117impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
17118 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17119 use std::str::FromStr;
17120 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17121 Ok(Self::from_str(&s).expect("infallible"))
17122 }
17123}
17124#[derive(Clone, Eq, PartialEq)]
17126#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17127#[derive(serde::Serialize)]
17128pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
17129 pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
17131 #[serde(skip_serializing_if = "Option::is_none")]
17134 pub interval_count: Option<u64>,
17135 #[serde(skip_serializing_if = "Option::is_none")]
17137 pub name: Option<String>,
17138 pub next_billing: SubscriptionNextBillingParam,
17140 pub reference: String,
17143}
17144#[cfg(feature = "redact-generated-debug")]
17145impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
17146 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17147 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions")
17148 .finish_non_exhaustive()
17149 }
17150}
17151impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
17152 pub fn new(
17153 interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
17154 next_billing: impl Into<SubscriptionNextBillingParam>,
17155 reference: impl Into<String>,
17156 ) -> Self {
17157 Self {
17158 interval: interval.into(),
17159 interval_count: None,
17160 name: None,
17161 next_billing: next_billing.into(),
17162 reference: reference.into(),
17163 }
17164 }
17165}
17166#[derive(Clone, Eq, PartialEq)]
17168#[non_exhaustive]
17169pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17170 Day,
17171 Month,
17172 Week,
17173 Year,
17174 Unknown(String),
17176}
17177impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17178 pub fn as_str(&self) -> &str {
17179 use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
17180 match self {
17181 Day => "day",
17182 Month => "month",
17183 Week => "week",
17184 Year => "year",
17185 Unknown(v) => v,
17186 }
17187 }
17188}
17189
17190impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17191 type Err = std::convert::Infallible;
17192 fn from_str(s: &str) -> Result<Self, Self::Err> {
17193 use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
17194 match s {
17195 "day" => Ok(Day),
17196 "month" => Ok(Month),
17197 "week" => Ok(Week),
17198 "year" => Ok(Year),
17199 v => {
17200 tracing::warn!(
17201 "Unknown value '{}' for enum '{}'",
17202 v,
17203 "ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
17204 );
17205 Ok(Unknown(v.to_owned()))
17206 }
17207 }
17208 }
17209}
17210impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17211 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17212 f.write_str(self.as_str())
17213 }
17214}
17215
17216#[cfg(not(feature = "redact-generated-debug"))]
17217impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17218 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17219 f.write_str(self.as_str())
17220 }
17221}
17222#[cfg(feature = "redact-generated-debug")]
17223impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17224 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17225 f.debug_struct(stringify!(
17226 ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
17227 ))
17228 .finish_non_exhaustive()
17229 }
17230}
17231impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
17232 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17233 where
17234 S: serde::Serializer,
17235 {
17236 serializer.serialize_str(self.as_str())
17237 }
17238}
17239#[cfg(feature = "deserialize")]
17240impl<'de> serde::Deserialize<'de>
17241 for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
17242{
17243 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17244 use std::str::FromStr;
17245 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17246 Ok(Self::from_str(&s).expect("infallible"))
17247 }
17248}
17249#[derive(Clone, Eq, PartialEq)]
17251#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17252#[derive(serde::Serialize)]
17253pub struct ConfirmSetupIntentPaymentMethodOptionsPayto {
17254 #[serde(skip_serializing_if = "Option::is_none")]
17256 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
17257}
17258#[cfg(feature = "redact-generated-debug")]
17259impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPayto {
17260 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17261 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsPayto").finish_non_exhaustive()
17262 }
17263}
17264impl ConfirmSetupIntentPaymentMethodOptionsPayto {
17265 pub fn new() -> Self {
17266 Self { mandate_options: None }
17267 }
17268}
17269impl Default for ConfirmSetupIntentPaymentMethodOptionsPayto {
17270 fn default() -> Self {
17271 Self::new()
17272 }
17273}
17274#[derive(Clone, Eq, PartialEq)]
17276#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17277#[derive(serde::Serialize)]
17278pub struct ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
17279 #[serde(skip_serializing_if = "Option::is_none")]
17281 pub amount: Option<i64>,
17282 #[serde(skip_serializing_if = "Option::is_none")]
17286 pub amount_type: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
17287 #[serde(skip_serializing_if = "Option::is_none")]
17289 pub end_date: Option<String>,
17290 #[serde(skip_serializing_if = "Option::is_none")]
17292 pub payment_schedule:
17293 Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
17294 #[serde(skip_serializing_if = "Option::is_none")]
17298 pub payments_per_period: Option<i64>,
17299 #[serde(skip_serializing_if = "Option::is_none")]
17301 pub purpose: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
17302 #[serde(skip_serializing_if = "Option::is_none")]
17304 pub start_date: Option<String>,
17305}
17306#[cfg(feature = "redact-generated-debug")]
17307impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
17308 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17309 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions")
17310 .finish_non_exhaustive()
17311 }
17312}
17313impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
17314 pub fn new() -> Self {
17315 Self {
17316 amount: None,
17317 amount_type: None,
17318 end_date: None,
17319 payment_schedule: None,
17320 payments_per_period: None,
17321 purpose: None,
17322 start_date: None,
17323 }
17324 }
17325}
17326impl Default for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
17327 fn default() -> Self {
17328 Self::new()
17329 }
17330}
17331#[derive(Clone, Eq, PartialEq)]
17335#[non_exhaustive]
17336pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17337 Fixed,
17338 Maximum,
17339 Unknown(String),
17341}
17342impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17343 pub fn as_str(&self) -> &str {
17344 use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
17345 match self {
17346 Fixed => "fixed",
17347 Maximum => "maximum",
17348 Unknown(v) => v,
17349 }
17350 }
17351}
17352
17353impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17354 type Err = std::convert::Infallible;
17355 fn from_str(s: &str) -> Result<Self, Self::Err> {
17356 use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
17357 match s {
17358 "fixed" => Ok(Fixed),
17359 "maximum" => Ok(Maximum),
17360 v => {
17361 tracing::warn!(
17362 "Unknown value '{}' for enum '{}'",
17363 v,
17364 "ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
17365 );
17366 Ok(Unknown(v.to_owned()))
17367 }
17368 }
17369 }
17370}
17371impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17372 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17373 f.write_str(self.as_str())
17374 }
17375}
17376
17377#[cfg(not(feature = "redact-generated-debug"))]
17378impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17379 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17380 f.write_str(self.as_str())
17381 }
17382}
17383#[cfg(feature = "redact-generated-debug")]
17384impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17385 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17386 f.debug_struct(stringify!(
17387 ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
17388 ))
17389 .finish_non_exhaustive()
17390 }
17391}
17392impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
17393 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17394 where
17395 S: serde::Serializer,
17396 {
17397 serializer.serialize_str(self.as_str())
17398 }
17399}
17400#[cfg(feature = "deserialize")]
17401impl<'de> serde::Deserialize<'de>
17402 for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
17403{
17404 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17405 use std::str::FromStr;
17406 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17407 Ok(Self::from_str(&s).expect("infallible"))
17408 }
17409}
17410#[derive(Clone, Eq, PartialEq)]
17412#[non_exhaustive]
17413pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
17414 Adhoc,
17415 Annual,
17416 Daily,
17417 Fortnightly,
17418 Monthly,
17419 Quarterly,
17420 SemiAnnual,
17421 Weekly,
17422 Unknown(String),
17424}
17425impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
17426 pub fn as_str(&self) -> &str {
17427 use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
17428 match self {
17429 Adhoc => "adhoc",
17430 Annual => "annual",
17431 Daily => "daily",
17432 Fortnightly => "fortnightly",
17433 Monthly => "monthly",
17434 Quarterly => "quarterly",
17435 SemiAnnual => "semi_annual",
17436 Weekly => "weekly",
17437 Unknown(v) => v,
17438 }
17439 }
17440}
17441
17442impl std::str::FromStr
17443 for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
17444{
17445 type Err = std::convert::Infallible;
17446 fn from_str(s: &str) -> Result<Self, Self::Err> {
17447 use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
17448 match s {
17449 "adhoc" => Ok(Adhoc),
17450 "annual" => Ok(Annual),
17451 "daily" => Ok(Daily),
17452 "fortnightly" => Ok(Fortnightly),
17453 "monthly" => Ok(Monthly),
17454 "quarterly" => Ok(Quarterly),
17455 "semi_annual" => Ok(SemiAnnual),
17456 "weekly" => Ok(Weekly),
17457 v => {
17458 tracing::warn!(
17459 "Unknown value '{}' for enum '{}'",
17460 v,
17461 "ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
17462 );
17463 Ok(Unknown(v.to_owned()))
17464 }
17465 }
17466 }
17467}
17468impl std::fmt::Display
17469 for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
17470{
17471 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17472 f.write_str(self.as_str())
17473 }
17474}
17475
17476#[cfg(not(feature = "redact-generated-debug"))]
17477impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
17478 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17479 f.write_str(self.as_str())
17480 }
17481}
17482#[cfg(feature = "redact-generated-debug")]
17483impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
17484 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17485 f.debug_struct(stringify!(
17486 ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
17487 ))
17488 .finish_non_exhaustive()
17489 }
17490}
17491impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
17492 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17493 where
17494 S: serde::Serializer,
17495 {
17496 serializer.serialize_str(self.as_str())
17497 }
17498}
17499#[cfg(feature = "deserialize")]
17500impl<'de> serde::Deserialize<'de>
17501 for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
17502{
17503 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17504 use std::str::FromStr;
17505 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17506 Ok(Self::from_str(&s).expect("infallible"))
17507 }
17508}
17509#[derive(Clone, Eq, PartialEq)]
17511#[non_exhaustive]
17512pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17513 DependantSupport,
17514 Government,
17515 Loan,
17516 Mortgage,
17517 Other,
17518 Pension,
17519 Personal,
17520 Retail,
17521 Salary,
17522 Tax,
17523 Utility,
17524 Unknown(String),
17526}
17527impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17528 pub fn as_str(&self) -> &str {
17529 use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
17530 match self {
17531 DependantSupport => "dependant_support",
17532 Government => "government",
17533 Loan => "loan",
17534 Mortgage => "mortgage",
17535 Other => "other",
17536 Pension => "pension",
17537 Personal => "personal",
17538 Retail => "retail",
17539 Salary => "salary",
17540 Tax => "tax",
17541 Utility => "utility",
17542 Unknown(v) => v,
17543 }
17544 }
17545}
17546
17547impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17548 type Err = std::convert::Infallible;
17549 fn from_str(s: &str) -> Result<Self, Self::Err> {
17550 use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
17551 match s {
17552 "dependant_support" => Ok(DependantSupport),
17553 "government" => Ok(Government),
17554 "loan" => Ok(Loan),
17555 "mortgage" => Ok(Mortgage),
17556 "other" => Ok(Other),
17557 "pension" => Ok(Pension),
17558 "personal" => Ok(Personal),
17559 "retail" => Ok(Retail),
17560 "salary" => Ok(Salary),
17561 "tax" => Ok(Tax),
17562 "utility" => Ok(Utility),
17563 v => {
17564 tracing::warn!(
17565 "Unknown value '{}' for enum '{}'",
17566 v,
17567 "ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
17568 );
17569 Ok(Unknown(v.to_owned()))
17570 }
17571 }
17572 }
17573}
17574impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17575 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17576 f.write_str(self.as_str())
17577 }
17578}
17579
17580#[cfg(not(feature = "redact-generated-debug"))]
17581impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17582 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17583 f.write_str(self.as_str())
17584 }
17585}
17586#[cfg(feature = "redact-generated-debug")]
17587impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17588 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17589 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose))
17590 .finish_non_exhaustive()
17591 }
17592}
17593impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
17594 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17595 where
17596 S: serde::Serializer,
17597 {
17598 serializer.serialize_str(self.as_str())
17599 }
17600}
17601#[cfg(feature = "deserialize")]
17602impl<'de> serde::Deserialize<'de>
17603 for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
17604{
17605 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17606 use std::str::FromStr;
17607 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17608 Ok(Self::from_str(&s).expect("infallible"))
17609 }
17610}
17611#[derive(Clone, Eq, PartialEq)]
17613#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17614#[derive(serde::Serialize)]
17615pub struct ConfirmSetupIntentPaymentMethodOptionsPix {
17616 #[serde(skip_serializing_if = "Option::is_none")]
17618 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsPixMandateOptions>,
17619}
17620#[cfg(feature = "redact-generated-debug")]
17621impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPix {
17622 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17623 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsPix").finish_non_exhaustive()
17624 }
17625}
17626impl ConfirmSetupIntentPaymentMethodOptionsPix {
17627 pub fn new() -> Self {
17628 Self { mandate_options: None }
17629 }
17630}
17631impl Default for ConfirmSetupIntentPaymentMethodOptionsPix {
17632 fn default() -> Self {
17633 Self::new()
17634 }
17635}
17636#[derive(Clone, Eq, PartialEq)]
17638#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17639#[derive(serde::Serialize)]
17640pub struct ConfirmSetupIntentPaymentMethodOptionsPixMandateOptions {
17641 #[serde(skip_serializing_if = "Option::is_none")]
17645 pub amount: Option<i64>,
17646 #[serde(skip_serializing_if = "Option::is_none")]
17648 pub amount_includes_iof:
17649 Option<ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof>,
17650 #[serde(skip_serializing_if = "Option::is_none")]
17652 pub amount_type: Option<ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType>,
17653 #[serde(skip_serializing_if = "Option::is_none")]
17656 pub currency: Option<stripe_types::Currency>,
17657 #[serde(skip_serializing_if = "Option::is_none")]
17661 pub end_date: Option<String>,
17662 #[serde(skip_serializing_if = "Option::is_none")]
17664 pub payment_schedule:
17665 Option<ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule>,
17666 #[serde(skip_serializing_if = "Option::is_none")]
17668 pub reference: Option<String>,
17669 #[serde(skip_serializing_if = "Option::is_none")]
17673 pub start_date: Option<String>,
17674}
17675#[cfg(feature = "redact-generated-debug")]
17676impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptions {
17677 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17678 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsPixMandateOptions")
17679 .finish_non_exhaustive()
17680 }
17681}
17682impl ConfirmSetupIntentPaymentMethodOptionsPixMandateOptions {
17683 pub fn new() -> Self {
17684 Self {
17685 amount: None,
17686 amount_includes_iof: None,
17687 amount_type: None,
17688 currency: None,
17689 end_date: None,
17690 payment_schedule: None,
17691 reference: None,
17692 start_date: None,
17693 }
17694 }
17695}
17696impl Default for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptions {
17697 fn default() -> Self {
17698 Self::new()
17699 }
17700}
17701#[derive(Clone, Eq, PartialEq)]
17703#[non_exhaustive]
17704pub enum ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
17705 Always,
17706 Never,
17707 Unknown(String),
17709}
17710impl ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
17711 pub fn as_str(&self) -> &str {
17712 use ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
17713 match self {
17714 Always => "always",
17715 Never => "never",
17716 Unknown(v) => v,
17717 }
17718 }
17719}
17720
17721impl std::str::FromStr
17722 for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
17723{
17724 type Err = std::convert::Infallible;
17725 fn from_str(s: &str) -> Result<Self, Self::Err> {
17726 use ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
17727 match s {
17728 "always" => Ok(Always),
17729 "never" => Ok(Never),
17730 v => {
17731 tracing::warn!(
17732 "Unknown value '{}' for enum '{}'",
17733 v,
17734 "ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof"
17735 );
17736 Ok(Unknown(v.to_owned()))
17737 }
17738 }
17739 }
17740}
17741impl std::fmt::Display
17742 for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
17743{
17744 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17745 f.write_str(self.as_str())
17746 }
17747}
17748
17749#[cfg(not(feature = "redact-generated-debug"))]
17750impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
17751 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17752 f.write_str(self.as_str())
17753 }
17754}
17755#[cfg(feature = "redact-generated-debug")]
17756impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
17757 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17758 f.debug_struct(stringify!(
17759 ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
17760 ))
17761 .finish_non_exhaustive()
17762 }
17763}
17764impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
17765 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17766 where
17767 S: serde::Serializer,
17768 {
17769 serializer.serialize_str(self.as_str())
17770 }
17771}
17772#[cfg(feature = "deserialize")]
17773impl<'de> serde::Deserialize<'de>
17774 for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
17775{
17776 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17777 use std::str::FromStr;
17778 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17779 Ok(Self::from_str(&s).expect("infallible"))
17780 }
17781}
17782#[derive(Clone, Eq, PartialEq)]
17784#[non_exhaustive]
17785pub enum ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17786 Fixed,
17787 Maximum,
17788 Unknown(String),
17790}
17791impl ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17792 pub fn as_str(&self) -> &str {
17793 use ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType::*;
17794 match self {
17795 Fixed => "fixed",
17796 Maximum => "maximum",
17797 Unknown(v) => v,
17798 }
17799 }
17800}
17801
17802impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17803 type Err = std::convert::Infallible;
17804 fn from_str(s: &str) -> Result<Self, Self::Err> {
17805 use ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType::*;
17806 match s {
17807 "fixed" => Ok(Fixed),
17808 "maximum" => Ok(Maximum),
17809 v => {
17810 tracing::warn!(
17811 "Unknown value '{}' for enum '{}'",
17812 v,
17813 "ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType"
17814 );
17815 Ok(Unknown(v.to_owned()))
17816 }
17817 }
17818 }
17819}
17820impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17821 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17822 f.write_str(self.as_str())
17823 }
17824}
17825
17826#[cfg(not(feature = "redact-generated-debug"))]
17827impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17828 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17829 f.write_str(self.as_str())
17830 }
17831}
17832#[cfg(feature = "redact-generated-debug")]
17833impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17834 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17835 f.debug_struct(stringify!(
17836 ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType
17837 ))
17838 .finish_non_exhaustive()
17839 }
17840}
17841impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType {
17842 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17843 where
17844 S: serde::Serializer,
17845 {
17846 serializer.serialize_str(self.as_str())
17847 }
17848}
17849#[cfg(feature = "deserialize")]
17850impl<'de> serde::Deserialize<'de>
17851 for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsAmountType
17852{
17853 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17854 use std::str::FromStr;
17855 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17856 Ok(Self::from_str(&s).expect("infallible"))
17857 }
17858}
17859#[derive(Clone, Eq, PartialEq)]
17861#[non_exhaustive]
17862pub enum ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17863 Halfyearly,
17864 Monthly,
17865 Quarterly,
17866 Weekly,
17867 Yearly,
17868 Unknown(String),
17870}
17871impl ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17872 pub fn as_str(&self) -> &str {
17873 use ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
17874 match self {
17875 Halfyearly => "halfyearly",
17876 Monthly => "monthly",
17877 Quarterly => "quarterly",
17878 Weekly => "weekly",
17879 Yearly => "yearly",
17880 Unknown(v) => v,
17881 }
17882 }
17883}
17884
17885impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17886 type Err = std::convert::Infallible;
17887 fn from_str(s: &str) -> Result<Self, Self::Err> {
17888 use ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
17889 match s {
17890 "halfyearly" => Ok(Halfyearly),
17891 "monthly" => Ok(Monthly),
17892 "quarterly" => Ok(Quarterly),
17893 "weekly" => Ok(Weekly),
17894 "yearly" => Ok(Yearly),
17895 v => {
17896 tracing::warn!(
17897 "Unknown value '{}' for enum '{}'",
17898 v,
17899 "ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule"
17900 );
17901 Ok(Unknown(v.to_owned()))
17902 }
17903 }
17904 }
17905}
17906impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17907 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17908 f.write_str(self.as_str())
17909 }
17910}
17911
17912#[cfg(not(feature = "redact-generated-debug"))]
17913impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17914 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17915 f.write_str(self.as_str())
17916 }
17917}
17918#[cfg(feature = "redact-generated-debug")]
17919impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17920 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17921 f.debug_struct(stringify!(
17922 ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule
17923 ))
17924 .finish_non_exhaustive()
17925 }
17926}
17927impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
17928 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17929 where
17930 S: serde::Serializer,
17931 {
17932 serializer.serialize_str(self.as_str())
17933 }
17934}
17935#[cfg(feature = "deserialize")]
17936impl<'de> serde::Deserialize<'de>
17937 for ConfirmSetupIntentPaymentMethodOptionsPixMandateOptionsPaymentSchedule
17938{
17939 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17940 use std::str::FromStr;
17941 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17942 Ok(Self::from_str(&s).expect("infallible"))
17943 }
17944}
17945#[derive(Clone, Eq, PartialEq)]
17947#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17948#[derive(serde::Serialize)]
17949pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
17950 #[serde(skip_serializing_if = "Option::is_none")]
17952 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
17953}
17954#[cfg(feature = "redact-generated-debug")]
17955impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
17956 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17957 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
17958 }
17959}
17960impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
17961 pub fn new() -> Self {
17962 Self { mandate_options: None }
17963 }
17964}
17965impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
17966 fn default() -> Self {
17967 Self::new()
17968 }
17969}
17970#[derive(Clone, Eq, PartialEq)]
17972#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17973#[derive(serde::Serialize)]
17974pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
17975 #[serde(skip_serializing_if = "Option::is_none")]
17980 pub reference_prefix: Option<String>,
17981}
17982#[cfg(feature = "redact-generated-debug")]
17983impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
17984 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17985 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions")
17986 .finish_non_exhaustive()
17987 }
17988}
17989impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
17990 pub fn new() -> Self {
17991 Self { reference_prefix: None }
17992 }
17993}
17994impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
17995 fn default() -> Self {
17996 Self::new()
17997 }
17998}
17999#[derive(Clone, Eq, PartialEq)]
18001#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18002#[derive(serde::Serialize)]
18003pub struct ConfirmSetupIntentPaymentMethodOptionsUpi {
18004 #[serde(skip_serializing_if = "Option::is_none")]
18006 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions>,
18007 #[serde(skip_serializing_if = "Option::is_none")]
18008 pub setup_future_usage: Option<ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage>,
18009}
18010#[cfg(feature = "redact-generated-debug")]
18011impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpi {
18012 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18013 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUpi").finish_non_exhaustive()
18014 }
18015}
18016impl ConfirmSetupIntentPaymentMethodOptionsUpi {
18017 pub fn new() -> Self {
18018 Self { mandate_options: None, setup_future_usage: None }
18019 }
18020}
18021impl Default for ConfirmSetupIntentPaymentMethodOptionsUpi {
18022 fn default() -> Self {
18023 Self::new()
18024 }
18025}
18026#[derive(Clone, Eq, PartialEq)]
18028#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18029#[derive(serde::Serialize)]
18030pub struct ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
18031 #[serde(skip_serializing_if = "Option::is_none")]
18033 pub amount: Option<i64>,
18034 #[serde(skip_serializing_if = "Option::is_none")]
18038 pub amount_type: Option<ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType>,
18039 #[serde(skip_serializing_if = "Option::is_none")]
18041 pub description: Option<String>,
18042 #[serde(skip_serializing_if = "Option::is_none")]
18044 pub end_date: Option<stripe_types::Timestamp>,
18045}
18046#[cfg(feature = "redact-generated-debug")]
18047impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
18048 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18049 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions")
18050 .finish_non_exhaustive()
18051 }
18052}
18053impl ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
18054 pub fn new() -> Self {
18055 Self { amount: None, amount_type: None, description: None, end_date: None }
18056 }
18057}
18058impl Default for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
18059 fn default() -> Self {
18060 Self::new()
18061 }
18062}
18063#[derive(Clone, Eq, PartialEq)]
18067#[non_exhaustive]
18068pub enum ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18069 Fixed,
18070 Maximum,
18071 Unknown(String),
18073}
18074impl ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18075 pub fn as_str(&self) -> &str {
18076 use ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
18077 match self {
18078 Fixed => "fixed",
18079 Maximum => "maximum",
18080 Unknown(v) => v,
18081 }
18082 }
18083}
18084
18085impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18086 type Err = std::convert::Infallible;
18087 fn from_str(s: &str) -> Result<Self, Self::Err> {
18088 use ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
18089 match s {
18090 "fixed" => Ok(Fixed),
18091 "maximum" => Ok(Maximum),
18092 v => {
18093 tracing::warn!(
18094 "Unknown value '{}' for enum '{}'",
18095 v,
18096 "ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType"
18097 );
18098 Ok(Unknown(v.to_owned()))
18099 }
18100 }
18101 }
18102}
18103impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18104 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18105 f.write_str(self.as_str())
18106 }
18107}
18108
18109#[cfg(not(feature = "redact-generated-debug"))]
18110impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18111 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18112 f.write_str(self.as_str())
18113 }
18114}
18115#[cfg(feature = "redact-generated-debug")]
18116impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18117 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18118 f.debug_struct(stringify!(
18119 ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
18120 ))
18121 .finish_non_exhaustive()
18122 }
18123}
18124impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
18125 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18126 where
18127 S: serde::Serializer,
18128 {
18129 serializer.serialize_str(self.as_str())
18130 }
18131}
18132#[cfg(feature = "deserialize")]
18133impl<'de> serde::Deserialize<'de>
18134 for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
18135{
18136 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18137 use std::str::FromStr;
18138 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18139 Ok(Self::from_str(&s).expect("infallible"))
18140 }
18141}
18142#[derive(Clone, Eq, PartialEq)]
18143#[non_exhaustive]
18144pub enum ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18145 None,
18146 OffSession,
18147 OnSession,
18148 Unknown(String),
18150}
18151impl ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18152 pub fn as_str(&self) -> &str {
18153 use ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
18154 match self {
18155 None => "none",
18156 OffSession => "off_session",
18157 OnSession => "on_session",
18158 Unknown(v) => v,
18159 }
18160 }
18161}
18162
18163impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18164 type Err = std::convert::Infallible;
18165 fn from_str(s: &str) -> Result<Self, Self::Err> {
18166 use ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
18167 match s {
18168 "none" => Ok(None),
18169 "off_session" => Ok(OffSession),
18170 "on_session" => Ok(OnSession),
18171 v => {
18172 tracing::warn!(
18173 "Unknown value '{}' for enum '{}'",
18174 v,
18175 "ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage"
18176 );
18177 Ok(Unknown(v.to_owned()))
18178 }
18179 }
18180 }
18181}
18182impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18183 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18184 f.write_str(self.as_str())
18185 }
18186}
18187
18188#[cfg(not(feature = "redact-generated-debug"))]
18189impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18190 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18191 f.write_str(self.as_str())
18192 }
18193}
18194#[cfg(feature = "redact-generated-debug")]
18195impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18196 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18197 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage))
18198 .finish_non_exhaustive()
18199 }
18200}
18201impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18202 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18203 where
18204 S: serde::Serializer,
18205 {
18206 serializer.serialize_str(self.as_str())
18207 }
18208}
18209#[cfg(feature = "deserialize")]
18210impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
18211 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18212 use std::str::FromStr;
18213 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18214 Ok(Self::from_str(&s).expect("infallible"))
18215 }
18216}
18217#[derive(Clone, Eq, PartialEq)]
18219#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18220#[derive(serde::Serialize)]
18221pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
18222 #[serde(skip_serializing_if = "Option::is_none")]
18224 pub financial_connections:
18225 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
18226 #[serde(skip_serializing_if = "Option::is_none")]
18228 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
18229 #[serde(skip_serializing_if = "Option::is_none")]
18231 pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
18232 #[serde(skip_serializing_if = "Option::is_none")]
18234 pub verification_method:
18235 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
18236}
18237#[cfg(feature = "redact-generated-debug")]
18238impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
18239 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18240 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccount")
18241 .finish_non_exhaustive()
18242 }
18243}
18244impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
18245 pub fn new() -> Self {
18246 Self {
18247 financial_connections: None,
18248 mandate_options: None,
18249 networks: None,
18250 verification_method: None,
18251 }
18252 }
18253}
18254impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
18255 fn default() -> Self {
18256 Self::new()
18257 }
18258}
18259#[derive(Clone, Eq, PartialEq)]
18261#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18262#[derive(serde::Serialize)]
18263pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
18264 #[serde(skip_serializing_if = "Option::is_none")]
18266 pub filters:
18267 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
18268 #[serde(skip_serializing_if = "Option::is_none")]
18272 pub permissions: Option<
18273 Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
18274 >,
18275 #[serde(skip_serializing_if = "Option::is_none")]
18277 pub prefetch: Option<
18278 Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
18279 >,
18280 #[serde(skip_serializing_if = "Option::is_none")]
18283 pub return_url: Option<String>,
18284}
18285#[cfg(feature = "redact-generated-debug")]
18286impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
18287 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18288 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections")
18289 .finish_non_exhaustive()
18290 }
18291}
18292impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
18293 pub fn new() -> Self {
18294 Self { filters: None, permissions: None, prefetch: None, return_url: None }
18295 }
18296}
18297impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
18298 fn default() -> Self {
18299 Self::new()
18300 }
18301}
18302#[derive(Clone, Eq, PartialEq)]
18304#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18305#[derive(serde::Serialize)]
18306pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
18307 #[serde(skip_serializing_if = "Option::is_none")]
18310pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
18311
18312}
18313#[cfg(feature = "redact-generated-debug")]
18314impl std::fmt::Debug
18315 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
18316{
18317 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18318 f.debug_struct(
18319 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters",
18320 )
18321 .finish_non_exhaustive()
18322 }
18323}
18324impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
18325 pub fn new() -> Self {
18326 Self { account_subcategories: None }
18327 }
18328}
18329impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
18330 fn default() -> Self {
18331 Self::new()
18332 }
18333}
18334#[derive(Clone, Eq, PartialEq)]
18337#[non_exhaustive]
18338pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
18339{
18340 Checking,
18341 Savings,
18342 Unknown(String),
18344}
18345impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18346 pub fn as_str(&self) -> &str {
18347 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
18348 match self {
18349Checking => "checking",
18350Savings => "savings",
18351Unknown(v) => v,
18352
18353 }
18354 }
18355}
18356
18357impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18358 type Err = std::convert::Infallible;
18359 fn from_str(s: &str) -> Result<Self, Self::Err> {
18360 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
18361 match s {
18362 "checking" => Ok(Checking),
18363"savings" => Ok(Savings),
18364v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
18365
18366 }
18367 }
18368}
18369impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18370 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18371 f.write_str(self.as_str())
18372 }
18373}
18374
18375#[cfg(not(feature = "redact-generated-debug"))]
18376impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18377 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18378 f.write_str(self.as_str())
18379 }
18380}
18381#[cfg(feature = "redact-generated-debug")]
18382impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18383 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18384 f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories)).finish_non_exhaustive()
18385 }
18386}
18387impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18388 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
18389 serializer.serialize_str(self.as_str())
18390 }
18391}
18392#[cfg(feature = "deserialize")]
18393impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
18394 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18395 use std::str::FromStr;
18396 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18397 Ok(Self::from_str(&s).expect("infallible"))
18398 }
18399}
18400#[derive(Clone, Eq, PartialEq)]
18404#[non_exhaustive]
18405pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
18406 Balances,
18407 Ownership,
18408 PaymentMethod,
18409 Transactions,
18410 Unknown(String),
18412}
18413impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
18414 pub fn as_str(&self) -> &str {
18415 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
18416 match self {
18417 Balances => "balances",
18418 Ownership => "ownership",
18419 PaymentMethod => "payment_method",
18420 Transactions => "transactions",
18421 Unknown(v) => v,
18422 }
18423 }
18424}
18425
18426impl std::str::FromStr
18427 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18428{
18429 type Err = std::convert::Infallible;
18430 fn from_str(s: &str) -> Result<Self, Self::Err> {
18431 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
18432 match s {
18433 "balances" => Ok(Balances),
18434 "ownership" => Ok(Ownership),
18435 "payment_method" => Ok(PaymentMethod),
18436 "transactions" => Ok(Transactions),
18437 v => {
18438 tracing::warn!(
18439 "Unknown value '{}' for enum '{}'",
18440 v,
18441 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
18442 );
18443 Ok(Unknown(v.to_owned()))
18444 }
18445 }
18446 }
18447}
18448impl std::fmt::Display
18449 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18450{
18451 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18452 f.write_str(self.as_str())
18453 }
18454}
18455
18456#[cfg(not(feature = "redact-generated-debug"))]
18457impl std::fmt::Debug
18458 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18459{
18460 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18461 f.write_str(self.as_str())
18462 }
18463}
18464#[cfg(feature = "redact-generated-debug")]
18465impl std::fmt::Debug
18466 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18467{
18468 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18469 f.debug_struct(stringify!(
18470 ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18471 ))
18472 .finish_non_exhaustive()
18473 }
18474}
18475impl serde::Serialize
18476 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18477{
18478 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18479 where
18480 S: serde::Serializer,
18481 {
18482 serializer.serialize_str(self.as_str())
18483 }
18484}
18485#[cfg(feature = "deserialize")]
18486impl<'de> serde::Deserialize<'de>
18487 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
18488{
18489 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18490 use std::str::FromStr;
18491 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18492 Ok(Self::from_str(&s).expect("infallible"))
18493 }
18494}
18495#[derive(Clone, Eq, PartialEq)]
18497#[non_exhaustive]
18498pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
18499 Balances,
18500 Ownership,
18501 Transactions,
18502 Unknown(String),
18504}
18505impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
18506 pub fn as_str(&self) -> &str {
18507 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
18508 match self {
18509 Balances => "balances",
18510 Ownership => "ownership",
18511 Transactions => "transactions",
18512 Unknown(v) => v,
18513 }
18514 }
18515}
18516
18517impl std::str::FromStr
18518 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18519{
18520 type Err = std::convert::Infallible;
18521 fn from_str(s: &str) -> Result<Self, Self::Err> {
18522 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
18523 match s {
18524 "balances" => Ok(Balances),
18525 "ownership" => Ok(Ownership),
18526 "transactions" => Ok(Transactions),
18527 v => {
18528 tracing::warn!(
18529 "Unknown value '{}' for enum '{}'",
18530 v,
18531 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
18532 );
18533 Ok(Unknown(v.to_owned()))
18534 }
18535 }
18536 }
18537}
18538impl std::fmt::Display
18539 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18540{
18541 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18542 f.write_str(self.as_str())
18543 }
18544}
18545
18546#[cfg(not(feature = "redact-generated-debug"))]
18547impl std::fmt::Debug
18548 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18549{
18550 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18551 f.write_str(self.as_str())
18552 }
18553}
18554#[cfg(feature = "redact-generated-debug")]
18555impl std::fmt::Debug
18556 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18557{
18558 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18559 f.debug_struct(stringify!(
18560 ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18561 ))
18562 .finish_non_exhaustive()
18563 }
18564}
18565impl serde::Serialize
18566 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18567{
18568 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18569 where
18570 S: serde::Serializer,
18571 {
18572 serializer.serialize_str(self.as_str())
18573 }
18574}
18575#[cfg(feature = "deserialize")]
18576impl<'de> serde::Deserialize<'de>
18577 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
18578{
18579 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18580 use std::str::FromStr;
18581 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18582 Ok(Self::from_str(&s).expect("infallible"))
18583 }
18584}
18585#[derive(Clone, Eq, PartialEq)]
18587#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18588#[derive(serde::Serialize)]
18589pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
18590 #[serde(skip_serializing_if = "Option::is_none")]
18592 pub collection_method:
18593 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
18594}
18595#[cfg(feature = "redact-generated-debug")]
18596impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
18597 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18598 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions")
18599 .finish_non_exhaustive()
18600 }
18601}
18602impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
18603 pub fn new() -> Self {
18604 Self { collection_method: None }
18605 }
18606}
18607impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
18608 fn default() -> Self {
18609 Self::new()
18610 }
18611}
18612#[derive(Clone, Eq, PartialEq)]
18614#[non_exhaustive]
18615pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
18616 Paper,
18617 Unknown(String),
18619}
18620impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
18621 pub fn as_str(&self) -> &str {
18622 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
18623 match self {
18624 Paper => "paper",
18625 Unknown(v) => v,
18626 }
18627 }
18628}
18629
18630impl std::str::FromStr
18631 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18632{
18633 type Err = std::convert::Infallible;
18634 fn from_str(s: &str) -> Result<Self, Self::Err> {
18635 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
18636 match s {
18637 "paper" => Ok(Paper),
18638 v => {
18639 tracing::warn!(
18640 "Unknown value '{}' for enum '{}'",
18641 v,
18642 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
18643 );
18644 Ok(Unknown(v.to_owned()))
18645 }
18646 }
18647 }
18648}
18649impl std::fmt::Display
18650 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18651{
18652 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18653 f.write_str(self.as_str())
18654 }
18655}
18656
18657#[cfg(not(feature = "redact-generated-debug"))]
18658impl std::fmt::Debug
18659 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18660{
18661 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18662 f.write_str(self.as_str())
18663 }
18664}
18665#[cfg(feature = "redact-generated-debug")]
18666impl std::fmt::Debug
18667 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18668{
18669 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18670 f.debug_struct(stringify!(
18671 ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18672 ))
18673 .finish_non_exhaustive()
18674 }
18675}
18676impl serde::Serialize
18677 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18678{
18679 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18680 where
18681 S: serde::Serializer,
18682 {
18683 serializer.serialize_str(self.as_str())
18684 }
18685}
18686#[cfg(feature = "deserialize")]
18687impl<'de> serde::Deserialize<'de>
18688 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
18689{
18690 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18691 use std::str::FromStr;
18692 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18693 Ok(Self::from_str(&s).expect("infallible"))
18694 }
18695}
18696#[derive(Clone, Eq, PartialEq)]
18698#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18699#[derive(serde::Serialize)]
18700pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
18701 #[serde(skip_serializing_if = "Option::is_none")]
18703 pub requested:
18704 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
18705}
18706#[cfg(feature = "redact-generated-debug")]
18707impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
18708 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18709 f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks")
18710 .finish_non_exhaustive()
18711 }
18712}
18713impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
18714 pub fn new() -> Self {
18715 Self { requested: None }
18716 }
18717}
18718impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
18719 fn default() -> Self {
18720 Self::new()
18721 }
18722}
18723#[derive(Clone, Eq, PartialEq)]
18725#[non_exhaustive]
18726pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18727 Ach,
18728 UsDomesticWire,
18729 Unknown(String),
18731}
18732impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18733 pub fn as_str(&self) -> &str {
18734 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
18735 match self {
18736 Ach => "ach",
18737 UsDomesticWire => "us_domestic_wire",
18738 Unknown(v) => v,
18739 }
18740 }
18741}
18742
18743impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18744 type Err = std::convert::Infallible;
18745 fn from_str(s: &str) -> Result<Self, Self::Err> {
18746 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
18747 match s {
18748 "ach" => Ok(Ach),
18749 "us_domestic_wire" => Ok(UsDomesticWire),
18750 v => {
18751 tracing::warn!(
18752 "Unknown value '{}' for enum '{}'",
18753 v,
18754 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
18755 );
18756 Ok(Unknown(v.to_owned()))
18757 }
18758 }
18759 }
18760}
18761impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18762 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18763 f.write_str(self.as_str())
18764 }
18765}
18766
18767#[cfg(not(feature = "redact-generated-debug"))]
18768impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18769 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18770 f.write_str(self.as_str())
18771 }
18772}
18773#[cfg(feature = "redact-generated-debug")]
18774impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18775 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18776 f.debug_struct(stringify!(
18777 ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
18778 ))
18779 .finish_non_exhaustive()
18780 }
18781}
18782impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
18783 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18784 where
18785 S: serde::Serializer,
18786 {
18787 serializer.serialize_str(self.as_str())
18788 }
18789}
18790#[cfg(feature = "deserialize")]
18791impl<'de> serde::Deserialize<'de>
18792 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
18793{
18794 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18795 use std::str::FromStr;
18796 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18797 Ok(Self::from_str(&s).expect("infallible"))
18798 }
18799}
18800#[derive(Clone, Eq, PartialEq)]
18802#[non_exhaustive]
18803pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18804 Automatic,
18805 Instant,
18806 Microdeposits,
18807 Unknown(String),
18809}
18810impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18811 pub fn as_str(&self) -> &str {
18812 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
18813 match self {
18814 Automatic => "automatic",
18815 Instant => "instant",
18816 Microdeposits => "microdeposits",
18817 Unknown(v) => v,
18818 }
18819 }
18820}
18821
18822impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18823 type Err = std::convert::Infallible;
18824 fn from_str(s: &str) -> Result<Self, Self::Err> {
18825 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
18826 match s {
18827 "automatic" => Ok(Automatic),
18828 "instant" => Ok(Instant),
18829 "microdeposits" => Ok(Microdeposits),
18830 v => {
18831 tracing::warn!(
18832 "Unknown value '{}' for enum '{}'",
18833 v,
18834 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
18835 );
18836 Ok(Unknown(v.to_owned()))
18837 }
18838 }
18839 }
18840}
18841impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18842 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18843 f.write_str(self.as_str())
18844 }
18845}
18846
18847#[cfg(not(feature = "redact-generated-debug"))]
18848impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18849 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18850 f.write_str(self.as_str())
18851 }
18852}
18853#[cfg(feature = "redact-generated-debug")]
18854impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18855 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18856 f.debug_struct(stringify!(
18857 ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
18858 ))
18859 .finish_non_exhaustive()
18860 }
18861}
18862impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
18863 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18864 where
18865 S: serde::Serializer,
18866 {
18867 serializer.serialize_str(self.as_str())
18868 }
18869}
18870#[cfg(feature = "deserialize")]
18871impl<'de> serde::Deserialize<'de>
18872 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
18873{
18874 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18875 use std::str::FromStr;
18876 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18877 Ok(Self::from_str(&s).expect("infallible"))
18878 }
18879}
18880#[derive(Clone)]
18895#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18896#[derive(serde::Serialize)]
18897pub struct ConfirmSetupIntent {
18898 inner: ConfirmSetupIntentBuilder,
18899 intent: stripe_shared::SetupIntentId,
18900}
18901#[cfg(feature = "redact-generated-debug")]
18902impl std::fmt::Debug for ConfirmSetupIntent {
18903 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18904 f.debug_struct("ConfirmSetupIntent").finish_non_exhaustive()
18905 }
18906}
18907impl ConfirmSetupIntent {
18908 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
18910 Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
18911 }
18912 pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
18916 self.inner.confirmation_token = Some(confirmation_token.into());
18917 self
18918 }
18919 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
18921 self.inner.expand = Some(expand.into());
18922 self
18923 }
18924 pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
18925 self.inner.mandate_data = Some(mandate_data.into());
18926 self
18927 }
18928 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
18930 self.inner.payment_method = Some(payment_method.into());
18931 self
18932 }
18933 pub fn payment_method_data(
18936 mut self,
18937 payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
18938 ) -> Self {
18939 self.inner.payment_method_data = Some(payment_method_data.into());
18940 self
18941 }
18942 pub fn payment_method_options(
18944 mut self,
18945 payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
18946 ) -> Self {
18947 self.inner.payment_method_options = Some(payment_method_options.into());
18948 self
18949 }
18950 pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
18954 self.inner.return_url = Some(return_url.into());
18955 self
18956 }
18957 pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
18959 self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
18960 self
18961 }
18962}
18963impl ConfirmSetupIntent {
18964 pub async fn send<C: StripeClient>(
18966 &self,
18967 client: &C,
18968 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
18969 self.customize().send(client).await
18970 }
18971
18972 pub fn send_blocking<C: StripeBlockingClient>(
18974 &self,
18975 client: &C,
18976 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
18977 self.customize().send_blocking(client)
18978 }
18979}
18980
18981impl StripeRequest for ConfirmSetupIntent {
18982 type Output = stripe_shared::SetupIntent;
18983
18984 fn build(&self) -> RequestBuilder {
18985 let intent = &self.intent;
18986 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
18987 .form(&self.inner)
18988 }
18989}
18990#[derive(Clone, Eq, PartialEq)]
18991#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18992#[derive(serde::Serialize)]
18993struct VerifyMicrodepositsSetupIntentBuilder {
18994 #[serde(skip_serializing_if = "Option::is_none")]
18995 amounts: Option<Vec<i64>>,
18996 #[serde(skip_serializing_if = "Option::is_none")]
18997 descriptor_code: Option<String>,
18998 #[serde(skip_serializing_if = "Option::is_none")]
18999 expand: Option<Vec<String>>,
19000}
19001#[cfg(feature = "redact-generated-debug")]
19002impl std::fmt::Debug for VerifyMicrodepositsSetupIntentBuilder {
19003 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19004 f.debug_struct("VerifyMicrodepositsSetupIntentBuilder").finish_non_exhaustive()
19005 }
19006}
19007impl VerifyMicrodepositsSetupIntentBuilder {
19008 fn new() -> Self {
19009 Self { amounts: None, descriptor_code: None, expand: None }
19010 }
19011}
19012#[derive(Clone)]
19014#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19015#[derive(serde::Serialize)]
19016pub struct VerifyMicrodepositsSetupIntent {
19017 inner: VerifyMicrodepositsSetupIntentBuilder,
19018 intent: stripe_shared::SetupIntentId,
19019}
19020#[cfg(feature = "redact-generated-debug")]
19021impl std::fmt::Debug for VerifyMicrodepositsSetupIntent {
19022 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19023 f.debug_struct("VerifyMicrodepositsSetupIntent").finish_non_exhaustive()
19024 }
19025}
19026impl VerifyMicrodepositsSetupIntent {
19027 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
19029 Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
19030 }
19031 pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
19033 self.inner.amounts = Some(amounts.into());
19034 self
19035 }
19036 pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
19038 self.inner.descriptor_code = Some(descriptor_code.into());
19039 self
19040 }
19041 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
19043 self.inner.expand = Some(expand.into());
19044 self
19045 }
19046}
19047impl VerifyMicrodepositsSetupIntent {
19048 pub async fn send<C: StripeClient>(
19050 &self,
19051 client: &C,
19052 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
19053 self.customize().send(client).await
19054 }
19055
19056 pub fn send_blocking<C: StripeBlockingClient>(
19058 &self,
19059 client: &C,
19060 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
19061 self.customize().send_blocking(client)
19062 }
19063}
19064
19065impl StripeRequest for VerifyMicrodepositsSetupIntent {
19066 type Output = stripe_shared::SetupIntent;
19067
19068 fn build(&self) -> RequestBuilder {
19069 let intent = &self.intent;
19070 RequestBuilder::new(
19071 StripeMethod::Post,
19072 format!("/setup_intents/{intent}/verify_microdeposits"),
19073 )
19074 .form(&self.inner)
19075 }
19076}
19077
19078#[derive(Clone, Eq, PartialEq)]
19079#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19080#[derive(serde::Serialize)]
19081pub struct OnlineParam {
19082 pub ip_address: String,
19084 pub user_agent: String,
19086}
19087#[cfg(feature = "redact-generated-debug")]
19088impl std::fmt::Debug for OnlineParam {
19089 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19090 f.debug_struct("OnlineParam").finish_non_exhaustive()
19091 }
19092}
19093impl OnlineParam {
19094 pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
19095 Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
19096 }
19097}
19098#[derive(Clone, Eq, PartialEq)]
19099#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19100#[derive(serde::Serialize)]
19101pub struct PaymentMethodParam {
19102 pub account_number: String,
19104 pub institution_number: String,
19106 pub transit_number: String,
19108}
19109#[cfg(feature = "redact-generated-debug")]
19110impl std::fmt::Debug for PaymentMethodParam {
19111 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19112 f.debug_struct("PaymentMethodParam").finish_non_exhaustive()
19113 }
19114}
19115impl PaymentMethodParam {
19116 pub fn new(
19117 account_number: impl Into<String>,
19118 institution_number: impl Into<String>,
19119 transit_number: impl Into<String>,
19120 ) -> Self {
19121 Self {
19122 account_number: account_number.into(),
19123 institution_number: institution_number.into(),
19124 transit_number: transit_number.into(),
19125 }
19126 }
19127}
19128#[derive(Clone, Eq, PartialEq)]
19129#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19130#[derive(serde::Serialize)]
19131pub struct BillingDetailsAddress {
19132 #[serde(skip_serializing_if = "Option::is_none")]
19134 pub city: Option<String>,
19135 #[serde(skip_serializing_if = "Option::is_none")]
19137 pub country: Option<String>,
19138 #[serde(skip_serializing_if = "Option::is_none")]
19140 pub line1: Option<String>,
19141 #[serde(skip_serializing_if = "Option::is_none")]
19143 pub line2: Option<String>,
19144 #[serde(skip_serializing_if = "Option::is_none")]
19146 pub postal_code: Option<String>,
19147 #[serde(skip_serializing_if = "Option::is_none")]
19149 pub state: Option<String>,
19150}
19151#[cfg(feature = "redact-generated-debug")]
19152impl std::fmt::Debug for BillingDetailsAddress {
19153 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19154 f.debug_struct("BillingDetailsAddress").finish_non_exhaustive()
19155 }
19156}
19157impl BillingDetailsAddress {
19158 pub fn new() -> Self {
19159 Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
19160 }
19161}
19162impl Default for BillingDetailsAddress {
19163 fn default() -> Self {
19164 Self::new()
19165 }
19166}
19167#[derive(Copy, Clone, Eq, PartialEq)]
19168#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19169#[derive(serde::Serialize)]
19170pub struct DateOfBirth {
19171 pub day: i64,
19173 pub month: i64,
19175 pub year: i64,
19177}
19178#[cfg(feature = "redact-generated-debug")]
19179impl std::fmt::Debug for DateOfBirth {
19180 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19181 f.debug_struct("DateOfBirth").finish_non_exhaustive()
19182 }
19183}
19184impl DateOfBirth {
19185 pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
19186 Self { day: day.into(), month: month.into(), year: year.into() }
19187 }
19188}
19189#[derive(Clone, Eq, PartialEq)]
19190#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19191#[derive(serde::Serialize)]
19192pub struct RadarOptionsWithHiddenOptions {
19193 #[serde(skip_serializing_if = "Option::is_none")]
19195 pub session: Option<String>,
19196}
19197#[cfg(feature = "redact-generated-debug")]
19198impl std::fmt::Debug for RadarOptionsWithHiddenOptions {
19199 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19200 f.debug_struct("RadarOptionsWithHiddenOptions").finish_non_exhaustive()
19201 }
19202}
19203impl RadarOptionsWithHiddenOptions {
19204 pub fn new() -> Self {
19205 Self { session: None }
19206 }
19207}
19208impl Default for RadarOptionsWithHiddenOptions {
19209 fn default() -> Self {
19210 Self::new()
19211 }
19212}
19213#[derive(Clone, Eq, PartialEq)]
19214#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19215#[derive(serde::Serialize)]
19216pub struct PaymentMethodOptionsMandateOptionsParam {
19217 #[serde(skip_serializing_if = "Option::is_none")]
19222 pub reference_prefix: Option<String>,
19223}
19224#[cfg(feature = "redact-generated-debug")]
19225impl std::fmt::Debug for PaymentMethodOptionsMandateOptionsParam {
19226 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19227 f.debug_struct("PaymentMethodOptionsMandateOptionsParam").finish_non_exhaustive()
19228 }
19229}
19230impl PaymentMethodOptionsMandateOptionsParam {
19231 pub fn new() -> Self {
19232 Self { reference_prefix: None }
19233 }
19234}
19235impl Default for PaymentMethodOptionsMandateOptionsParam {
19236 fn default() -> Self {
19237 Self::new()
19238 }
19239}
19240#[derive(Clone, Eq, PartialEq)]
19241#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19242#[derive(serde::Serialize)]
19243pub struct SubscriptionNextBillingParam {
19244 pub amount: i64,
19246 pub date: String,
19248}
19249#[cfg(feature = "redact-generated-debug")]
19250impl std::fmt::Debug for SubscriptionNextBillingParam {
19251 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19252 f.debug_struct("SubscriptionNextBillingParam").finish_non_exhaustive()
19253 }
19254}
19255impl SubscriptionNextBillingParam {
19256 pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
19257 Self { amount: amount.into(), date: date.into() }
19258 }
19259}
19260#[derive(Clone, Eq, PartialEq)]
19261#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19262#[derive(serde::Serialize)]
19263pub struct SetupIntentPaymentMethodOptionsParam {
19264 #[serde(skip_serializing_if = "Option::is_none")]
19266 pub persistent_token: Option<String>,
19267}
19268#[cfg(feature = "redact-generated-debug")]
19269impl std::fmt::Debug for SetupIntentPaymentMethodOptionsParam {
19270 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19271 f.debug_struct("SetupIntentPaymentMethodOptionsParam").finish_non_exhaustive()
19272 }
19273}
19274impl SetupIntentPaymentMethodOptionsParam {
19275 pub fn new() -> Self {
19276 Self { persistent_token: None }
19277 }
19278}
19279impl Default for SetupIntentPaymentMethodOptionsParam {
19280 fn default() -> Self {
19281 Self::new()
19282 }
19283}
19284#[derive(Clone, Eq, PartialEq)]
19285#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19286#[derive(serde::Serialize)]
19287pub struct PaymentMethodOptionsParam {
19288 #[serde(skip_serializing_if = "Option::is_none")]
19291 pub billing_agreement_id: Option<String>,
19292}
19293#[cfg(feature = "redact-generated-debug")]
19294impl std::fmt::Debug for PaymentMethodOptionsParam {
19295 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19296 f.debug_struct("PaymentMethodOptionsParam").finish_non_exhaustive()
19297 }
19298}
19299impl PaymentMethodOptionsParam {
19300 pub fn new() -> Self {
19301 Self { billing_agreement_id: None }
19302 }
19303}
19304impl Default for PaymentMethodOptionsParam {
19305 fn default() -> Self {
19306 Self::new()
19307 }
19308}
19309#[derive(Clone, Eq, PartialEq)]
19310#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
19311#[derive(serde::Serialize)]
19312pub struct BillingDetailsInnerParams {
19313 #[serde(skip_serializing_if = "Option::is_none")]
19315 pub address: Option<BillingDetailsAddress>,
19316 #[serde(skip_serializing_if = "Option::is_none")]
19318 pub email: Option<String>,
19319 #[serde(skip_serializing_if = "Option::is_none")]
19321 pub name: Option<String>,
19322 #[serde(skip_serializing_if = "Option::is_none")]
19324 pub phone: Option<String>,
19325 #[serde(skip_serializing_if = "Option::is_none")]
19328 pub tax_id: Option<String>,
19329}
19330#[cfg(feature = "redact-generated-debug")]
19331impl std::fmt::Debug for BillingDetailsInnerParams {
19332 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19333 f.debug_struct("BillingDetailsInnerParams").finish_non_exhaustive()
19334 }
19335}
19336impl BillingDetailsInnerParams {
19337 pub fn new() -> Self {
19338 Self { address: None, email: None, name: None, phone: None, tax_id: None }
19339 }
19340}
19341impl Default for BillingDetailsInnerParams {
19342 fn default() -> Self {
19343 Self::new()
19344 }
19345}