Skip to main content

stripe_connect/account_session/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone)]
6#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7#[derive(serde::Serialize)]
8struct CreateAccountSessionBuilder {
9    account: String,
10    components: CreateAccountSessionComponents,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    expand: Option<Vec<String>>,
13}
14#[cfg(feature = "redact-generated-debug")]
15impl std::fmt::Debug for CreateAccountSessionBuilder {
16    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17        f.debug_struct("CreateAccountSessionBuilder").finish_non_exhaustive()
18    }
19}
20impl CreateAccountSessionBuilder {
21    fn new(
22        account: impl Into<String>,
23        components: impl Into<CreateAccountSessionComponents>,
24    ) -> Self {
25        Self { account: account.into(), components: components.into(), expand: None }
26    }
27}
28/// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g.
29/// whether it has been enabled or not).
30#[derive(Clone)]
31#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
32#[derive(serde::Serialize)]
33pub struct CreateAccountSessionComponents {
34    /// Configuration for the [account management](/connect/supported-embedded-components/account-management/) embedded component.
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub account_management: Option<AccountConfigParam>,
37    /// Configuration for the [account onboarding](/connect/supported-embedded-components/account-onboarding/) embedded component.
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub account_onboarding: Option<AccountConfigParam>,
40    /// Configuration for the [balances](/connect/supported-embedded-components/balances/) embedded component.
41    #[serde(skip_serializing_if = "Option::is_none")]
42    pub balances: Option<PayoutsConfigParam>,
43    /// Configuration for the [disputes list](/connect/supported-embedded-components/disputes-list/) embedded component.
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub disputes_list: Option<CreateAccountSessionComponentsDisputesList>,
46    /// Configuration for the [documents](/connect/supported-embedded-components/documents/) embedded component.
47    #[serde(skip_serializing_if = "Option::is_none")]
48    pub documents: Option<BaseConfigParam>,
49    /// Configuration for the [financial account](/connect/supported-embedded-components/financial-account/) embedded component.
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub financial_account: Option<CreateAccountSessionComponentsFinancialAccount>,
52    /// Configuration for the [financial account transactions](/connect/supported-embedded-components/financial-account-transactions/) embedded component.
53    #[serde(skip_serializing_if = "Option::is_none")]
54    pub financial_account_transactions:
55        Option<CreateAccountSessionComponentsFinancialAccountTransactions>,
56    /// Configuration for the [instant payouts promotion](/connect/supported-embedded-components/instant-payouts-promotion/) embedded component.
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub instant_payouts_promotion: Option<CreateAccountSessionComponentsInstantPayoutsPromotion>,
59    /// Configuration for the [issuing card](/connect/supported-embedded-components/issuing-card/) embedded component.
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub issuing_card: Option<CreateAccountSessionComponentsIssuingCard>,
62    /// Configuration for the [issuing cards list](/connect/supported-embedded-components/issuing-cards-list/) embedded component.
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub issuing_cards_list: Option<CreateAccountSessionComponentsIssuingCardsList>,
65    /// Configuration for the [notification banner](/connect/supported-embedded-components/notification-banner/) embedded component.
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub notification_banner: Option<AccountConfigParam>,
68    /// Configuration for the [payment details](/connect/supported-embedded-components/payment-details/) embedded component.
69    #[serde(skip_serializing_if = "Option::is_none")]
70    pub payment_details: Option<CreateAccountSessionComponentsPaymentDetails>,
71    /// Configuration for the [payment disputes](/connect/supported-embedded-components/payment-disputes/) embedded component.
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub payment_disputes: Option<CreateAccountSessionComponentsPaymentDisputes>,
74    /// Configuration for the [payments](/connect/supported-embedded-components/payments/) embedded component.
75    #[serde(skip_serializing_if = "Option::is_none")]
76    pub payments: Option<CreateAccountSessionComponentsPayments>,
77    /// Configuration for the [payout details](/connect/supported-embedded-components/payout-details/) embedded component.
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub payout_details: Option<BaseConfigParam>,
80    /// Configuration for the [payouts](/connect/supported-embedded-components/payouts/) embedded component.
81    #[serde(skip_serializing_if = "Option::is_none")]
82    pub payouts: Option<PayoutsConfigParam>,
83    /// Configuration for the [payouts list](/connect/supported-embedded-components/payouts-list/) embedded component.
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub payouts_list: Option<BaseConfigParam>,
86    /// Configuration for the [tax registrations](/connect/supported-embedded-components/tax-registrations/) embedded component.
87    #[serde(skip_serializing_if = "Option::is_none")]
88    pub tax_registrations: Option<BaseConfigParam>,
89    /// Configuration for the [tax settings](/connect/supported-embedded-components/tax-settings/) embedded component.
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub tax_settings: Option<BaseConfigParam>,
92}
93#[cfg(feature = "redact-generated-debug")]
94impl std::fmt::Debug for CreateAccountSessionComponents {
95    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
96        f.debug_struct("CreateAccountSessionComponents").finish_non_exhaustive()
97    }
98}
99impl CreateAccountSessionComponents {
100    pub fn new() -> Self {
101        Self {
102            account_management: None,
103            account_onboarding: None,
104            balances: None,
105            disputes_list: None,
106            documents: None,
107            financial_account: None,
108            financial_account_transactions: None,
109            instant_payouts_promotion: None,
110            issuing_card: None,
111            issuing_cards_list: None,
112            notification_banner: None,
113            payment_details: None,
114            payment_disputes: None,
115            payments: None,
116            payout_details: None,
117            payouts: None,
118            payouts_list: None,
119            tax_registrations: None,
120            tax_settings: None,
121        }
122    }
123}
124impl Default for CreateAccountSessionComponents {
125    fn default() -> Self {
126        Self::new()
127    }
128}
129/// Configuration for the [disputes list](/connect/supported-embedded-components/disputes-list/) embedded component.
130#[derive(Copy, Clone, Eq, PartialEq)]
131#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
132#[derive(serde::Serialize)]
133pub struct CreateAccountSessionComponentsDisputesList {
134    /// Whether the embedded component is enabled.
135    pub enabled: bool,
136    /// The list of features enabled in the embedded component.
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub features: Option<CreateAccountSessionComponentsDisputesListFeatures>,
139}
140#[cfg(feature = "redact-generated-debug")]
141impl std::fmt::Debug for CreateAccountSessionComponentsDisputesList {
142    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
143        f.debug_struct("CreateAccountSessionComponentsDisputesList").finish_non_exhaustive()
144    }
145}
146impl CreateAccountSessionComponentsDisputesList {
147    pub fn new(enabled: impl Into<bool>) -> Self {
148        Self { enabled: enabled.into(), features: None }
149    }
150}
151/// The list of features enabled in the embedded component.
152#[derive(Copy, Clone, Eq, PartialEq)]
153#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
154#[derive(serde::Serialize)]
155pub struct CreateAccountSessionComponentsDisputesListFeatures {
156    /// Whether to allow capturing and cancelling payment intents. This is `true` by default.
157    #[serde(skip_serializing_if = "Option::is_none")]
158    pub capture_payments: Option<bool>,
159    /// Whether connected accounts can manage destination charges that are created on behalf of them.
160    /// This is `false` by default.
161    #[serde(skip_serializing_if = "Option::is_none")]
162    pub destination_on_behalf_of_charge_management: Option<bool>,
163    /// Whether responding to disputes is enabled, including submitting evidence and accepting disputes.
164    /// This is `true` by default.
165    #[serde(skip_serializing_if = "Option::is_none")]
166    pub dispute_management: Option<bool>,
167    /// Whether sending refunds is enabled. This is `true` by default.
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub refund_management: Option<bool>,
170}
171#[cfg(feature = "redact-generated-debug")]
172impl std::fmt::Debug for CreateAccountSessionComponentsDisputesListFeatures {
173    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
174        f.debug_struct("CreateAccountSessionComponentsDisputesListFeatures").finish_non_exhaustive()
175    }
176}
177impl CreateAccountSessionComponentsDisputesListFeatures {
178    pub fn new() -> Self {
179        Self {
180            capture_payments: None,
181            destination_on_behalf_of_charge_management: None,
182            dispute_management: None,
183            refund_management: None,
184        }
185    }
186}
187impl Default for CreateAccountSessionComponentsDisputesListFeatures {
188    fn default() -> Self {
189        Self::new()
190    }
191}
192/// Configuration for the [financial account](/connect/supported-embedded-components/financial-account/) embedded component.
193#[derive(Copy, Clone, Eq, PartialEq)]
194#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
195#[derive(serde::Serialize)]
196pub struct CreateAccountSessionComponentsFinancialAccount {
197    /// Whether the embedded component is enabled.
198    pub enabled: bool,
199    /// The list of features enabled in the embedded component.
200    #[serde(skip_serializing_if = "Option::is_none")]
201    pub features: Option<CreateAccountSessionComponentsFinancialAccountFeatures>,
202}
203#[cfg(feature = "redact-generated-debug")]
204impl std::fmt::Debug for CreateAccountSessionComponentsFinancialAccount {
205    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
206        f.debug_struct("CreateAccountSessionComponentsFinancialAccount").finish_non_exhaustive()
207    }
208}
209impl CreateAccountSessionComponentsFinancialAccount {
210    pub fn new(enabled: impl Into<bool>) -> Self {
211        Self { enabled: enabled.into(), features: None }
212    }
213}
214/// The list of features enabled in the embedded component.
215#[derive(Copy, Clone, Eq, PartialEq)]
216#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
217#[derive(serde::Serialize)]
218pub struct CreateAccountSessionComponentsFinancialAccountFeatures {
219    /// Whether Stripe user authentication is disabled.
220    /// This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account.
221    /// The default value is the opposite of the `external_account_collection` value.
222    /// For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`.
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub disable_stripe_user_authentication: Option<bool>,
225    /// Whether external account collection is enabled.
226    /// This feature can only be `false` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts.
227    /// The default value for this feature is `true`.
228    #[serde(skip_serializing_if = "Option::is_none")]
229    pub external_account_collection: Option<bool>,
230    /// Whether to allow sending money.
231    #[serde(skip_serializing_if = "Option::is_none")]
232    pub send_money: Option<bool>,
233    /// Whether to allow transferring balance.
234    #[serde(skip_serializing_if = "Option::is_none")]
235    pub transfer_balance: Option<bool>,
236}
237#[cfg(feature = "redact-generated-debug")]
238impl std::fmt::Debug for CreateAccountSessionComponentsFinancialAccountFeatures {
239    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
240        f.debug_struct("CreateAccountSessionComponentsFinancialAccountFeatures")
241            .finish_non_exhaustive()
242    }
243}
244impl CreateAccountSessionComponentsFinancialAccountFeatures {
245    pub fn new() -> Self {
246        Self {
247            disable_stripe_user_authentication: None,
248            external_account_collection: None,
249            send_money: None,
250            transfer_balance: None,
251        }
252    }
253}
254impl Default for CreateAccountSessionComponentsFinancialAccountFeatures {
255    fn default() -> Self {
256        Self::new()
257    }
258}
259/// Configuration for the [financial account transactions](/connect/supported-embedded-components/financial-account-transactions/) embedded component.
260#[derive(Copy, Clone, Eq, PartialEq)]
261#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
262#[derive(serde::Serialize)]
263pub struct CreateAccountSessionComponentsFinancialAccountTransactions {
264    /// Whether the embedded component is enabled.
265    pub enabled: bool,
266    /// The list of features enabled in the embedded component.
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub features: Option<CreateAccountSessionComponentsFinancialAccountTransactionsFeatures>,
269}
270#[cfg(feature = "redact-generated-debug")]
271impl std::fmt::Debug for CreateAccountSessionComponentsFinancialAccountTransactions {
272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
273        f.debug_struct("CreateAccountSessionComponentsFinancialAccountTransactions")
274            .finish_non_exhaustive()
275    }
276}
277impl CreateAccountSessionComponentsFinancialAccountTransactions {
278    pub fn new(enabled: impl Into<bool>) -> Self {
279        Self { enabled: enabled.into(), features: None }
280    }
281}
282/// The list of features enabled in the embedded component.
283#[derive(Copy, Clone, Eq, PartialEq)]
284#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
285#[derive(serde::Serialize)]
286pub struct CreateAccountSessionComponentsFinancialAccountTransactionsFeatures {
287    /// Whether to allow card spend dispute management features.
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub card_spend_dispute_management: Option<bool>,
290}
291#[cfg(feature = "redact-generated-debug")]
292impl std::fmt::Debug for CreateAccountSessionComponentsFinancialAccountTransactionsFeatures {
293    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
294        f.debug_struct("CreateAccountSessionComponentsFinancialAccountTransactionsFeatures")
295            .finish_non_exhaustive()
296    }
297}
298impl CreateAccountSessionComponentsFinancialAccountTransactionsFeatures {
299    pub fn new() -> Self {
300        Self { card_spend_dispute_management: None }
301    }
302}
303impl Default for CreateAccountSessionComponentsFinancialAccountTransactionsFeatures {
304    fn default() -> Self {
305        Self::new()
306    }
307}
308/// Configuration for the [instant payouts promotion](/connect/supported-embedded-components/instant-payouts-promotion/) embedded component.
309#[derive(Copy, Clone, Eq, PartialEq)]
310#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
311#[derive(serde::Serialize)]
312pub struct CreateAccountSessionComponentsInstantPayoutsPromotion {
313    /// Whether the embedded component is enabled.
314    pub enabled: bool,
315    /// The list of features enabled in the embedded component.
316    #[serde(skip_serializing_if = "Option::is_none")]
317    pub features: Option<CreateAccountSessionComponentsInstantPayoutsPromotionFeatures>,
318}
319#[cfg(feature = "redact-generated-debug")]
320impl std::fmt::Debug for CreateAccountSessionComponentsInstantPayoutsPromotion {
321    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
322        f.debug_struct("CreateAccountSessionComponentsInstantPayoutsPromotion")
323            .finish_non_exhaustive()
324    }
325}
326impl CreateAccountSessionComponentsInstantPayoutsPromotion {
327    pub fn new(enabled: impl Into<bool>) -> Self {
328        Self { enabled: enabled.into(), features: None }
329    }
330}
331/// The list of features enabled in the embedded component.
332#[derive(Copy, Clone, Eq, PartialEq)]
333#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
334#[derive(serde::Serialize)]
335pub struct CreateAccountSessionComponentsInstantPayoutsPromotionFeatures {
336    /// Whether Stripe user authentication is disabled.
337    /// This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account.
338    /// The default value is the opposite of the `external_account_collection` value.
339    /// For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`.
340    #[serde(skip_serializing_if = "Option::is_none")]
341    pub disable_stripe_user_authentication: Option<bool>,
342    /// Whether external account collection is enabled.
343    /// This feature can only be `false` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts.
344    /// The default value for this feature is `true`.
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub external_account_collection: Option<bool>,
347    /// Whether instant payouts are enabled for this component.
348    #[serde(skip_serializing_if = "Option::is_none")]
349    pub instant_payouts: Option<bool>,
350}
351#[cfg(feature = "redact-generated-debug")]
352impl std::fmt::Debug for CreateAccountSessionComponentsInstantPayoutsPromotionFeatures {
353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
354        f.debug_struct("CreateAccountSessionComponentsInstantPayoutsPromotionFeatures")
355            .finish_non_exhaustive()
356    }
357}
358impl CreateAccountSessionComponentsInstantPayoutsPromotionFeatures {
359    pub fn new() -> Self {
360        Self {
361            disable_stripe_user_authentication: None,
362            external_account_collection: None,
363            instant_payouts: None,
364        }
365    }
366}
367impl Default for CreateAccountSessionComponentsInstantPayoutsPromotionFeatures {
368    fn default() -> Self {
369        Self::new()
370    }
371}
372/// Configuration for the [issuing card](/connect/supported-embedded-components/issuing-card/) embedded component.
373#[derive(Copy, Clone, Eq, PartialEq)]
374#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
375#[derive(serde::Serialize)]
376pub struct CreateAccountSessionComponentsIssuingCard {
377    /// Whether the embedded component is enabled.
378    pub enabled: bool,
379    /// The list of features enabled in the embedded component.
380    #[serde(skip_serializing_if = "Option::is_none")]
381    pub features: Option<CreateAccountSessionComponentsIssuingCardFeatures>,
382}
383#[cfg(feature = "redact-generated-debug")]
384impl std::fmt::Debug for CreateAccountSessionComponentsIssuingCard {
385    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
386        f.debug_struct("CreateAccountSessionComponentsIssuingCard").finish_non_exhaustive()
387    }
388}
389impl CreateAccountSessionComponentsIssuingCard {
390    pub fn new(enabled: impl Into<bool>) -> Self {
391        Self { enabled: enabled.into(), features: None }
392    }
393}
394/// The list of features enabled in the embedded component.
395#[derive(Copy, Clone, Eq, PartialEq)]
396#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
397#[derive(serde::Serialize)]
398pub struct CreateAccountSessionComponentsIssuingCardFeatures {
399    /// Whether to allow card management features.
400    #[serde(skip_serializing_if = "Option::is_none")]
401    pub card_management: Option<bool>,
402    /// Whether to allow card spend dispute management features.
403    #[serde(skip_serializing_if = "Option::is_none")]
404    pub card_spend_dispute_management: Option<bool>,
405    /// Whether to allow cardholder management features.
406    #[serde(skip_serializing_if = "Option::is_none")]
407    pub cardholder_management: Option<bool>,
408    /// Whether to allow spend control management features.
409    #[serde(skip_serializing_if = "Option::is_none")]
410    pub spend_control_management: Option<bool>,
411}
412#[cfg(feature = "redact-generated-debug")]
413impl std::fmt::Debug for CreateAccountSessionComponentsIssuingCardFeatures {
414    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
415        f.debug_struct("CreateAccountSessionComponentsIssuingCardFeatures").finish_non_exhaustive()
416    }
417}
418impl CreateAccountSessionComponentsIssuingCardFeatures {
419    pub fn new() -> Self {
420        Self {
421            card_management: None,
422            card_spend_dispute_management: None,
423            cardholder_management: None,
424            spend_control_management: None,
425        }
426    }
427}
428impl Default for CreateAccountSessionComponentsIssuingCardFeatures {
429    fn default() -> Self {
430        Self::new()
431    }
432}
433/// Configuration for the [issuing cards list](/connect/supported-embedded-components/issuing-cards-list/) embedded component.
434#[derive(Copy, Clone, Eq, PartialEq)]
435#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
436#[derive(serde::Serialize)]
437pub struct CreateAccountSessionComponentsIssuingCardsList {
438    /// Whether the embedded component is enabled.
439    pub enabled: bool,
440    /// The list of features enabled in the embedded component.
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub features: Option<CreateAccountSessionComponentsIssuingCardsListFeatures>,
443}
444#[cfg(feature = "redact-generated-debug")]
445impl std::fmt::Debug for CreateAccountSessionComponentsIssuingCardsList {
446    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
447        f.debug_struct("CreateAccountSessionComponentsIssuingCardsList").finish_non_exhaustive()
448    }
449}
450impl CreateAccountSessionComponentsIssuingCardsList {
451    pub fn new(enabled: impl Into<bool>) -> Self {
452        Self { enabled: enabled.into(), features: None }
453    }
454}
455/// The list of features enabled in the embedded component.
456#[derive(Copy, Clone, Eq, PartialEq)]
457#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
458#[derive(serde::Serialize)]
459pub struct CreateAccountSessionComponentsIssuingCardsListFeatures {
460    /// Whether to allow card management features.
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub card_management: Option<bool>,
463    /// Whether to allow card spend dispute management features.
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub card_spend_dispute_management: Option<bool>,
466    /// Whether to allow cardholder management features.
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub cardholder_management: Option<bool>,
469    /// Whether Stripe user authentication is disabled.
470    /// This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account.
471    /// The default value is the opposite of the `external_account_collection` value.
472    /// For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`.
473    #[serde(skip_serializing_if = "Option::is_none")]
474    pub disable_stripe_user_authentication: Option<bool>,
475    /// Whether to allow spend control management features.
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub spend_control_management: Option<bool>,
478}
479#[cfg(feature = "redact-generated-debug")]
480impl std::fmt::Debug for CreateAccountSessionComponentsIssuingCardsListFeatures {
481    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
482        f.debug_struct("CreateAccountSessionComponentsIssuingCardsListFeatures")
483            .finish_non_exhaustive()
484    }
485}
486impl CreateAccountSessionComponentsIssuingCardsListFeatures {
487    pub fn new() -> Self {
488        Self {
489            card_management: None,
490            card_spend_dispute_management: None,
491            cardholder_management: None,
492            disable_stripe_user_authentication: None,
493            spend_control_management: None,
494        }
495    }
496}
497impl Default for CreateAccountSessionComponentsIssuingCardsListFeatures {
498    fn default() -> Self {
499        Self::new()
500    }
501}
502/// Configuration for the [payment details](/connect/supported-embedded-components/payment-details/) embedded component.
503#[derive(Copy, Clone, Eq, PartialEq)]
504#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
505#[derive(serde::Serialize)]
506pub struct CreateAccountSessionComponentsPaymentDetails {
507    /// Whether the embedded component is enabled.
508    pub enabled: bool,
509    /// The list of features enabled in the embedded component.
510    #[serde(skip_serializing_if = "Option::is_none")]
511    pub features: Option<CreateAccountSessionComponentsPaymentDetailsFeatures>,
512}
513#[cfg(feature = "redact-generated-debug")]
514impl std::fmt::Debug for CreateAccountSessionComponentsPaymentDetails {
515    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
516        f.debug_struct("CreateAccountSessionComponentsPaymentDetails").finish_non_exhaustive()
517    }
518}
519impl CreateAccountSessionComponentsPaymentDetails {
520    pub fn new(enabled: impl Into<bool>) -> Self {
521        Self { enabled: enabled.into(), features: None }
522    }
523}
524/// The list of features enabled in the embedded component.
525#[derive(Copy, Clone, Eq, PartialEq)]
526#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
527#[derive(serde::Serialize)]
528pub struct CreateAccountSessionComponentsPaymentDetailsFeatures {
529    /// Whether to allow capturing and cancelling payment intents. This is `true` by default.
530    #[serde(skip_serializing_if = "Option::is_none")]
531    pub capture_payments: Option<bool>,
532    /// Whether connected accounts can manage destination charges that are created on behalf of them.
533    /// This is `false` by default.
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub destination_on_behalf_of_charge_management: Option<bool>,
536    /// Whether responding to disputes is enabled, including submitting evidence and accepting disputes.
537    /// This is `true` by default.
538    #[serde(skip_serializing_if = "Option::is_none")]
539    pub dispute_management: Option<bool>,
540    /// Whether sending refunds is enabled. This is `true` by default.
541    #[serde(skip_serializing_if = "Option::is_none")]
542    pub refund_management: Option<bool>,
543}
544#[cfg(feature = "redact-generated-debug")]
545impl std::fmt::Debug for CreateAccountSessionComponentsPaymentDetailsFeatures {
546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
547        f.debug_struct("CreateAccountSessionComponentsPaymentDetailsFeatures")
548            .finish_non_exhaustive()
549    }
550}
551impl CreateAccountSessionComponentsPaymentDetailsFeatures {
552    pub fn new() -> Self {
553        Self {
554            capture_payments: None,
555            destination_on_behalf_of_charge_management: None,
556            dispute_management: None,
557            refund_management: None,
558        }
559    }
560}
561impl Default for CreateAccountSessionComponentsPaymentDetailsFeatures {
562    fn default() -> Self {
563        Self::new()
564    }
565}
566/// Configuration for the [payment disputes](/connect/supported-embedded-components/payment-disputes/) embedded component.
567#[derive(Copy, Clone, Eq, PartialEq)]
568#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
569#[derive(serde::Serialize)]
570pub struct CreateAccountSessionComponentsPaymentDisputes {
571    /// Whether the embedded component is enabled.
572    pub enabled: bool,
573    /// The list of features enabled in the embedded component.
574    #[serde(skip_serializing_if = "Option::is_none")]
575    pub features: Option<CreateAccountSessionComponentsPaymentDisputesFeatures>,
576}
577#[cfg(feature = "redact-generated-debug")]
578impl std::fmt::Debug for CreateAccountSessionComponentsPaymentDisputes {
579    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
580        f.debug_struct("CreateAccountSessionComponentsPaymentDisputes").finish_non_exhaustive()
581    }
582}
583impl CreateAccountSessionComponentsPaymentDisputes {
584    pub fn new(enabled: impl Into<bool>) -> Self {
585        Self { enabled: enabled.into(), features: None }
586    }
587}
588/// The list of features enabled in the embedded component.
589#[derive(Copy, Clone, Eq, PartialEq)]
590#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
591#[derive(serde::Serialize)]
592pub struct CreateAccountSessionComponentsPaymentDisputesFeatures {
593    /// Whether connected accounts can manage destination charges that are created on behalf of them.
594    /// This is `false` by default.
595    #[serde(skip_serializing_if = "Option::is_none")]
596    pub destination_on_behalf_of_charge_management: Option<bool>,
597    /// Whether responding to disputes is enabled, including submitting evidence and accepting disputes.
598    /// This is `true` by default.
599    #[serde(skip_serializing_if = "Option::is_none")]
600    pub dispute_management: Option<bool>,
601    /// Whether sending refunds is enabled. This is `true` by default.
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub refund_management: Option<bool>,
604}
605#[cfg(feature = "redact-generated-debug")]
606impl std::fmt::Debug for CreateAccountSessionComponentsPaymentDisputesFeatures {
607    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
608        f.debug_struct("CreateAccountSessionComponentsPaymentDisputesFeatures")
609            .finish_non_exhaustive()
610    }
611}
612impl CreateAccountSessionComponentsPaymentDisputesFeatures {
613    pub fn new() -> Self {
614        Self {
615            destination_on_behalf_of_charge_management: None,
616            dispute_management: None,
617            refund_management: None,
618        }
619    }
620}
621impl Default for CreateAccountSessionComponentsPaymentDisputesFeatures {
622    fn default() -> Self {
623        Self::new()
624    }
625}
626/// Configuration for the [payments](/connect/supported-embedded-components/payments/) embedded component.
627#[derive(Copy, Clone, Eq, PartialEq)]
628#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
629#[derive(serde::Serialize)]
630pub struct CreateAccountSessionComponentsPayments {
631    /// Whether the embedded component is enabled.
632    pub enabled: bool,
633    /// The list of features enabled in the embedded component.
634    #[serde(skip_serializing_if = "Option::is_none")]
635    pub features: Option<CreateAccountSessionComponentsPaymentsFeatures>,
636}
637#[cfg(feature = "redact-generated-debug")]
638impl std::fmt::Debug for CreateAccountSessionComponentsPayments {
639    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
640        f.debug_struct("CreateAccountSessionComponentsPayments").finish_non_exhaustive()
641    }
642}
643impl CreateAccountSessionComponentsPayments {
644    pub fn new(enabled: impl Into<bool>) -> Self {
645        Self { enabled: enabled.into(), features: None }
646    }
647}
648/// The list of features enabled in the embedded component.
649#[derive(Copy, Clone, Eq, PartialEq)]
650#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
651#[derive(serde::Serialize)]
652pub struct CreateAccountSessionComponentsPaymentsFeatures {
653    /// Whether to allow capturing and cancelling payment intents. This is `true` by default.
654    #[serde(skip_serializing_if = "Option::is_none")]
655    pub capture_payments: Option<bool>,
656    /// Whether connected accounts can manage destination charges that are created on behalf of them.
657    /// This is `false` by default.
658    #[serde(skip_serializing_if = "Option::is_none")]
659    pub destination_on_behalf_of_charge_management: Option<bool>,
660    /// Whether responding to disputes is enabled, including submitting evidence and accepting disputes.
661    /// This is `true` by default.
662    #[serde(skip_serializing_if = "Option::is_none")]
663    pub dispute_management: Option<bool>,
664    /// Whether sending refunds is enabled. This is `true` by default.
665    #[serde(skip_serializing_if = "Option::is_none")]
666    pub refund_management: Option<bool>,
667}
668#[cfg(feature = "redact-generated-debug")]
669impl std::fmt::Debug for CreateAccountSessionComponentsPaymentsFeatures {
670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
671        f.debug_struct("CreateAccountSessionComponentsPaymentsFeatures").finish_non_exhaustive()
672    }
673}
674impl CreateAccountSessionComponentsPaymentsFeatures {
675    pub fn new() -> Self {
676        Self {
677            capture_payments: None,
678            destination_on_behalf_of_charge_management: None,
679            dispute_management: None,
680            refund_management: None,
681        }
682    }
683}
684impl Default for CreateAccountSessionComponentsPaymentsFeatures {
685    fn default() -> Self {
686        Self::new()
687    }
688}
689/// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
690#[derive(Clone)]
691#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
692#[derive(serde::Serialize)]
693pub struct CreateAccountSession {
694    inner: CreateAccountSessionBuilder,
695}
696#[cfg(feature = "redact-generated-debug")]
697impl std::fmt::Debug for CreateAccountSession {
698    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
699        f.debug_struct("CreateAccountSession").finish_non_exhaustive()
700    }
701}
702impl CreateAccountSession {
703    /// Construct a new `CreateAccountSession`.
704    pub fn new(
705        account: impl Into<String>,
706        components: impl Into<CreateAccountSessionComponents>,
707    ) -> Self {
708        Self { inner: CreateAccountSessionBuilder::new(account.into(), components.into()) }
709    }
710    /// Specifies which fields in the response should be expanded.
711    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
712        self.inner.expand = Some(expand.into());
713        self
714    }
715}
716impl CreateAccountSession {
717    /// Send the request and return the deserialized response.
718    pub async fn send<C: StripeClient>(
719        &self,
720        client: &C,
721    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
722        self.customize().send(client).await
723    }
724
725    /// Send the request and return the deserialized response, blocking until completion.
726    pub fn send_blocking<C: StripeBlockingClient>(
727        &self,
728        client: &C,
729    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
730        self.customize().send_blocking(client)
731    }
732}
733
734impl StripeRequest for CreateAccountSession {
735    type Output = stripe_connect::AccountSession;
736
737    fn build(&self) -> RequestBuilder {
738        RequestBuilder::new(StripeMethod::Post, "/account_sessions").form(&self.inner)
739    }
740}
741
742#[derive(Copy, Clone, Eq, PartialEq)]
743#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
744#[derive(serde::Serialize)]
745pub struct AccountFeaturesParam {
746    /// Whether Stripe user authentication is disabled.
747    /// This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account.
748    /// The default value is the opposite of the `external_account_collection` value.
749    /// For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`.
750    #[serde(skip_serializing_if = "Option::is_none")]
751    pub disable_stripe_user_authentication: Option<bool>,
752    /// Whether external account collection is enabled.
753    /// This feature can only be `false` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts.
754    /// The default value for this feature is `true`.
755    #[serde(skip_serializing_if = "Option::is_none")]
756    pub external_account_collection: Option<bool>,
757}
758#[cfg(feature = "redact-generated-debug")]
759impl std::fmt::Debug for AccountFeaturesParam {
760    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
761        f.debug_struct("AccountFeaturesParam").finish_non_exhaustive()
762    }
763}
764impl AccountFeaturesParam {
765    pub fn new() -> Self {
766        Self { disable_stripe_user_authentication: None, external_account_collection: None }
767    }
768}
769impl Default for AccountFeaturesParam {
770    fn default() -> Self {
771        Self::new()
772    }
773}
774#[derive(Copy, Clone, Eq, PartialEq)]
775#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
776#[derive(serde::Serialize)]
777pub struct PayoutsFeaturesParam {
778    /// Whether Stripe user authentication is disabled.
779    /// This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account.
780    /// The default value is the opposite of the `external_account_collection` value.
781    /// For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`.
782    #[serde(skip_serializing_if = "Option::is_none")]
783    pub disable_stripe_user_authentication: Option<bool>,
784    /// Whether to allow payout schedule to be changed.
785    /// Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`.
786    #[serde(skip_serializing_if = "Option::is_none")]
787    pub edit_payout_schedule: Option<bool>,
788    /// Whether external account collection is enabled.
789    /// This feature can only be `false` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts.
790    /// The default value for this feature is `true`.
791    #[serde(skip_serializing_if = "Option::is_none")]
792    pub external_account_collection: Option<bool>,
793    /// Whether instant payouts are enabled for this component.
794    #[serde(skip_serializing_if = "Option::is_none")]
795    pub instant_payouts: Option<bool>,
796    /// Whether to allow creation of standard payouts.
797    /// Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`.
798    #[serde(skip_serializing_if = "Option::is_none")]
799    pub standard_payouts: Option<bool>,
800}
801#[cfg(feature = "redact-generated-debug")]
802impl std::fmt::Debug for PayoutsFeaturesParam {
803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
804        f.debug_struct("PayoutsFeaturesParam").finish_non_exhaustive()
805    }
806}
807impl PayoutsFeaturesParam {
808    pub fn new() -> Self {
809        Self {
810            disable_stripe_user_authentication: None,
811            edit_payout_schedule: None,
812            external_account_collection: None,
813            instant_payouts: None,
814            standard_payouts: None,
815        }
816    }
817}
818impl Default for PayoutsFeaturesParam {
819    fn default() -> Self {
820        Self::new()
821    }
822}
823#[derive(Clone)]
824#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
825#[derive(serde::Serialize)]
826pub struct BaseConfigParam {
827    /// Whether the embedded component is enabled.
828    pub enabled: bool,
829    /// An empty list, because this embedded component has no features.
830    #[serde(skip_serializing_if = "Option::is_none")]
831    #[serde(with = "stripe_types::with_serde_json_opt")]
832    pub features: Option<miniserde::json::Value>,
833}
834#[cfg(feature = "redact-generated-debug")]
835impl std::fmt::Debug for BaseConfigParam {
836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
837        f.debug_struct("BaseConfigParam").finish_non_exhaustive()
838    }
839}
840impl BaseConfigParam {
841    pub fn new(enabled: impl Into<bool>) -> Self {
842        Self { enabled: enabled.into(), features: None }
843    }
844}
845#[derive(Copy, Clone, Eq, PartialEq)]
846#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
847#[derive(serde::Serialize)]
848pub struct AccountConfigParam {
849    /// Whether the embedded component is enabled.
850    pub enabled: bool,
851    /// The list of features enabled in the embedded component.
852    #[serde(skip_serializing_if = "Option::is_none")]
853    pub features: Option<AccountFeaturesParam>,
854}
855#[cfg(feature = "redact-generated-debug")]
856impl std::fmt::Debug for AccountConfigParam {
857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
858        f.debug_struct("AccountConfigParam").finish_non_exhaustive()
859    }
860}
861impl AccountConfigParam {
862    pub fn new(enabled: impl Into<bool>) -> Self {
863        Self { enabled: enabled.into(), features: None }
864    }
865}
866#[derive(Copy, Clone, Eq, PartialEq)]
867#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
868#[derive(serde::Serialize)]
869pub struct PayoutsConfigParam {
870    /// Whether the embedded component is enabled.
871    pub enabled: bool,
872    /// The list of features enabled in the embedded component.
873    #[serde(skip_serializing_if = "Option::is_none")]
874    pub features: Option<PayoutsFeaturesParam>,
875}
876#[cfg(feature = "redact-generated-debug")]
877impl std::fmt::Debug for PayoutsConfigParam {
878    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
879        f.debug_struct("PayoutsConfigParam").finish_non_exhaustive()
880    }
881}
882impl PayoutsConfigParam {
883    pub fn new(enabled: impl Into<bool>) -> Self {
884        Self { enabled: enabled.into(), features: None }
885    }
886}