stripe_core/token/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct RetrieveTokenBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    expand: Option<Vec<String>>,
9}
10impl RetrieveTokenBuilder {
11    fn new() -> Self {
12        Self { expand: None }
13    }
14}
15/// Retrieves the token with the given ID.
16#[derive(Clone, Debug, serde::Serialize)]
17pub struct RetrieveToken {
18    inner: RetrieveTokenBuilder,
19    token: stripe_core::TokenId,
20}
21impl RetrieveToken {
22    /// Construct a new `RetrieveToken`.
23    pub fn new(token: impl Into<stripe_core::TokenId>) -> Self {
24        Self { token: token.into(), inner: RetrieveTokenBuilder::new() }
25    }
26    /// Specifies which fields in the response should be expanded.
27    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
28        self.inner.expand = Some(expand.into());
29        self
30    }
31}
32impl RetrieveToken {
33    /// Send the request and return the deserialized response.
34    pub async fn send<C: StripeClient>(
35        &self,
36        client: &C,
37    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
38        self.customize().send(client).await
39    }
40
41    /// Send the request and return the deserialized response, blocking until completion.
42    pub fn send_blocking<C: StripeBlockingClient>(
43        &self,
44        client: &C,
45    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
46        self.customize().send_blocking(client)
47    }
48}
49
50impl StripeRequest for RetrieveToken {
51    type Output = stripe_core::Token;
52
53    fn build(&self) -> RequestBuilder {
54        let token = &self.token;
55        RequestBuilder::new(StripeMethod::Get, format!("/tokens/{token}")).query(&self.inner)
56    }
57}
58#[derive(Clone, Debug, serde::Serialize)]
59struct CreateTokenBuilder {
60    #[serde(skip_serializing_if = "Option::is_none")]
61    account: Option<CreateTokenAccount>,
62    #[serde(skip_serializing_if = "Option::is_none")]
63    bank_account: Option<CreateTokenBankAccount>,
64    #[serde(skip_serializing_if = "Option::is_none")]
65    card: Option<CreateTokenCard>,
66    #[serde(skip_serializing_if = "Option::is_none")]
67    customer: Option<String>,
68    #[serde(skip_serializing_if = "Option::is_none")]
69    cvc_update: Option<CreateTokenCvcUpdate>,
70    #[serde(skip_serializing_if = "Option::is_none")]
71    expand: Option<Vec<String>>,
72    #[serde(skip_serializing_if = "Option::is_none")]
73    person: Option<CreateTokenPerson>,
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pii: Option<CreateTokenPii>,
76}
77impl CreateTokenBuilder {
78    fn new() -> Self {
79        Self {
80            account: None,
81            bank_account: None,
82            card: None,
83            customer: None,
84            cvc_update: None,
85            expand: None,
86            person: None,
87            pii: None,
88        }
89    }
90}
91/// Information for the account this token represents.
92#[derive(Clone, Debug, serde::Serialize)]
93pub struct CreateTokenAccount {
94    /// The business type.
95    #[serde(skip_serializing_if = "Option::is_none")]
96    pub business_type: Option<CreateTokenAccountBusinessType>,
97    /// Information about the company or business.
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub company: Option<CreateTokenAccountCompany>,
100    /// Information about the person represented by the account.
101    #[serde(skip_serializing_if = "Option::is_none")]
102    pub individual: Option<CreateTokenAccountIndividual>,
103    /// Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](/connect/account-tokens#stripe-connected-account-agreement).
104    /// When creating an account token to create a new Connect account, this value must be `true`.
105    #[serde(skip_serializing_if = "Option::is_none")]
106    pub tos_shown_and_accepted: Option<bool>,
107}
108impl CreateTokenAccount {
109    pub fn new() -> Self {
110        Self { business_type: None, company: None, individual: None, tos_shown_and_accepted: None }
111    }
112}
113impl Default for CreateTokenAccount {
114    fn default() -> Self {
115        Self::new()
116    }
117}
118/// The business type.
119#[derive(Copy, Clone, Eq, PartialEq)]
120pub enum CreateTokenAccountBusinessType {
121    Company,
122    GovernmentEntity,
123    Individual,
124    NonProfit,
125}
126impl CreateTokenAccountBusinessType {
127    pub fn as_str(self) -> &'static str {
128        use CreateTokenAccountBusinessType::*;
129        match self {
130            Company => "company",
131            GovernmentEntity => "government_entity",
132            Individual => "individual",
133            NonProfit => "non_profit",
134        }
135    }
136}
137
138impl std::str::FromStr for CreateTokenAccountBusinessType {
139    type Err = stripe_types::StripeParseError;
140    fn from_str(s: &str) -> Result<Self, Self::Err> {
141        use CreateTokenAccountBusinessType::*;
142        match s {
143            "company" => Ok(Company),
144            "government_entity" => Ok(GovernmentEntity),
145            "individual" => Ok(Individual),
146            "non_profit" => Ok(NonProfit),
147            _ => Err(stripe_types::StripeParseError),
148        }
149    }
150}
151impl std::fmt::Display for CreateTokenAccountBusinessType {
152    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
153        f.write_str(self.as_str())
154    }
155}
156
157impl std::fmt::Debug for CreateTokenAccountBusinessType {
158    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
159        f.write_str(self.as_str())
160    }
161}
162impl serde::Serialize for CreateTokenAccountBusinessType {
163    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
164    where
165        S: serde::Serializer,
166    {
167        serializer.serialize_str(self.as_str())
168    }
169}
170#[cfg(feature = "deserialize")]
171impl<'de> serde::Deserialize<'de> for CreateTokenAccountBusinessType {
172    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
173        use std::str::FromStr;
174        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
175        Self::from_str(&s).map_err(|_| {
176            serde::de::Error::custom("Unknown value for CreateTokenAccountBusinessType")
177        })
178    }
179}
180/// Information about the company or business.
181#[derive(Clone, Debug, serde::Serialize)]
182pub struct CreateTokenAccountCompany {
183    /// The company's primary address.
184    #[serde(skip_serializing_if = "Option::is_none")]
185    pub address: Option<CreateTokenAccountCompanyAddress>,
186    /// The Kana variation of the company's primary address (Japan only).
187    #[serde(skip_serializing_if = "Option::is_none")]
188    pub address_kana: Option<CreateTokenAccountCompanyAddressKana>,
189    /// The Kanji variation of the company's primary address (Japan only).
190    #[serde(skip_serializing_if = "Option::is_none")]
191    pub address_kanji: Option<CreateTokenAccountCompanyAddressKanji>,
192    /// Whether the company's directors have been provided.
193    /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](/api/persons) for accounts with a `relationship.director` requirement.
194    /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub directors_provided: Option<bool>,
197    /// This hash is used to attest that the directors information provided to Stripe is both current and correct.
198    #[serde(skip_serializing_if = "Option::is_none")]
199    pub directorship_declaration: Option<CreateTokenAccountCompanyDirectorshipDeclaration>,
200    /// Whether the company's executives have been provided.
201    /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](/api/persons) for accounts with a `relationship.executive` requirement.
202    #[serde(skip_serializing_if = "Option::is_none")]
203    pub executives_provided: Option<bool>,
204    /// The export license ID number of the company, also referred as Import Export Code (India only).
205    #[serde(skip_serializing_if = "Option::is_none")]
206    pub export_license_id: Option<String>,
207    /// The purpose code to use for export transactions (India only).
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub export_purpose_code: Option<String>,
210    /// The company's legal name.
211    #[serde(skip_serializing_if = "Option::is_none")]
212    pub name: Option<String>,
213    /// The Kana variation of the company's legal name (Japan only).
214    #[serde(skip_serializing_if = "Option::is_none")]
215    pub name_kana: Option<String>,
216    /// The Kanji variation of the company's legal name (Japan only).
217    #[serde(skip_serializing_if = "Option::is_none")]
218    pub name_kanji: Option<String>,
219    /// Whether the company's owners have been provided.
220    /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](/api/persons) for accounts with a `relationship.owner` requirement.
221    #[serde(skip_serializing_if = "Option::is_none")]
222    pub owners_provided: Option<bool>,
223    /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.
224    #[serde(skip_serializing_if = "Option::is_none")]
225    pub ownership_declaration: Option<CreateTokenAccountCompanyOwnershipDeclaration>,
226    /// Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct.
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub ownership_declaration_shown_and_signed: Option<bool>,
229    /// This value is used to determine if a business is exempt from providing ultimate beneficial owners.
230    /// See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details.
231    #[serde(skip_serializing_if = "Option::is_none")]
232    pub ownership_exemption_reason: Option<CreateTokenAccountCompanyOwnershipExemptionReason>,
233    /// The company's phone number (used for verification).
234    #[serde(skip_serializing_if = "Option::is_none")]
235    pub phone: Option<String>,
236    #[serde(skip_serializing_if = "Option::is_none")]
237    pub registration_date: Option<CreateTokenAccountCompanyRegistrationDate>,
238    /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes.
239    /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong).
240    #[serde(skip_serializing_if = "Option::is_none")]
241    pub registration_number: Option<String>,
242    /// The category identifying the legal structure of the company or legal entity.
243    /// See [Business structure](/connect/identity-verification#business-structure) for more details.
244    /// Pass an empty string to unset this value.
245    #[serde(skip_serializing_if = "Option::is_none")]
246    pub structure: Option<CreateTokenAccountCompanyStructure>,
247    /// The business ID number of the company, as appropriate for the company’s country.
248    /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.).
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub tax_id: Option<String>,
251    /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
252    #[serde(skip_serializing_if = "Option::is_none")]
253    pub tax_id_registrar: Option<String>,
254    /// The VAT number of the company.
255    #[serde(skip_serializing_if = "Option::is_none")]
256    pub vat_id: Option<String>,
257    /// Information on the verification state of the company.
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub verification: Option<CreateTokenAccountCompanyVerification>,
260}
261impl CreateTokenAccountCompany {
262    pub fn new() -> Self {
263        Self {
264            address: None,
265            address_kana: None,
266            address_kanji: None,
267            directors_provided: None,
268            directorship_declaration: None,
269            executives_provided: None,
270            export_license_id: None,
271            export_purpose_code: None,
272            name: None,
273            name_kana: None,
274            name_kanji: None,
275            owners_provided: None,
276            ownership_declaration: None,
277            ownership_declaration_shown_and_signed: None,
278            ownership_exemption_reason: None,
279            phone: None,
280            registration_date: None,
281            registration_number: None,
282            structure: None,
283            tax_id: None,
284            tax_id_registrar: None,
285            vat_id: None,
286            verification: None,
287        }
288    }
289}
290impl Default for CreateTokenAccountCompany {
291    fn default() -> Self {
292        Self::new()
293    }
294}
295/// The company's primary address.
296#[derive(Clone, Debug, serde::Serialize)]
297pub struct CreateTokenAccountCompanyAddress {
298    /// City, district, suburb, town, or village.
299    #[serde(skip_serializing_if = "Option::is_none")]
300    pub city: Option<String>,
301    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub country: Option<String>,
304    /// Address line 1 (e.g., street, PO Box, or company name).
305    #[serde(skip_serializing_if = "Option::is_none")]
306    pub line1: Option<String>,
307    /// Address line 2 (e.g., apartment, suite, unit, or building).
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub line2: Option<String>,
310    /// ZIP or postal code.
311    #[serde(skip_serializing_if = "Option::is_none")]
312    pub postal_code: Option<String>,
313    /// State, county, province, or region.
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub state: Option<String>,
316}
317impl CreateTokenAccountCompanyAddress {
318    pub fn new() -> Self {
319        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
320    }
321}
322impl Default for CreateTokenAccountCompanyAddress {
323    fn default() -> Self {
324        Self::new()
325    }
326}
327/// The Kana variation of the company's primary address (Japan only).
328#[derive(Clone, Debug, serde::Serialize)]
329pub struct CreateTokenAccountCompanyAddressKana {
330    /// City or ward.
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub city: Option<String>,
333    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub country: Option<String>,
336    /// Block or building number.
337    #[serde(skip_serializing_if = "Option::is_none")]
338    pub line1: Option<String>,
339    /// Building details.
340    #[serde(skip_serializing_if = "Option::is_none")]
341    pub line2: Option<String>,
342    /// Postal code.
343    #[serde(skip_serializing_if = "Option::is_none")]
344    pub postal_code: Option<String>,
345    /// Prefecture.
346    #[serde(skip_serializing_if = "Option::is_none")]
347    pub state: Option<String>,
348    /// Town or cho-me.
349    #[serde(skip_serializing_if = "Option::is_none")]
350    pub town: Option<String>,
351}
352impl CreateTokenAccountCompanyAddressKana {
353    pub fn new() -> Self {
354        Self {
355            city: None,
356            country: None,
357            line1: None,
358            line2: None,
359            postal_code: None,
360            state: None,
361            town: None,
362        }
363    }
364}
365impl Default for CreateTokenAccountCompanyAddressKana {
366    fn default() -> Self {
367        Self::new()
368    }
369}
370/// The Kanji variation of the company's primary address (Japan only).
371#[derive(Clone, Debug, serde::Serialize)]
372pub struct CreateTokenAccountCompanyAddressKanji {
373    /// City or ward.
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub city: Option<String>,
376    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
377    #[serde(skip_serializing_if = "Option::is_none")]
378    pub country: Option<String>,
379    /// Block or building number.
380    #[serde(skip_serializing_if = "Option::is_none")]
381    pub line1: Option<String>,
382    /// Building details.
383    #[serde(skip_serializing_if = "Option::is_none")]
384    pub line2: Option<String>,
385    /// Postal code.
386    #[serde(skip_serializing_if = "Option::is_none")]
387    pub postal_code: Option<String>,
388    /// Prefecture.
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub state: Option<String>,
391    /// Town or cho-me.
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub town: Option<String>,
394}
395impl CreateTokenAccountCompanyAddressKanji {
396    pub fn new() -> Self {
397        Self {
398            city: None,
399            country: None,
400            line1: None,
401            line2: None,
402            postal_code: None,
403            state: None,
404            town: None,
405        }
406    }
407}
408impl Default for CreateTokenAccountCompanyAddressKanji {
409    fn default() -> Self {
410        Self::new()
411    }
412}
413/// This hash is used to attest that the directors information provided to Stripe is both current and correct.
414#[derive(Clone, Debug, serde::Serialize)]
415pub struct CreateTokenAccountCompanyDirectorshipDeclaration {
416    /// The Unix timestamp marking when the directorship declaration attestation was made.
417    #[serde(skip_serializing_if = "Option::is_none")]
418    pub date: Option<stripe_types::Timestamp>,
419    /// The IP address from which the directorship declaration attestation was made.
420    #[serde(skip_serializing_if = "Option::is_none")]
421    pub ip: Option<String>,
422    /// The user agent of the browser from which the directorship declaration attestation was made.
423    #[serde(skip_serializing_if = "Option::is_none")]
424    pub user_agent: Option<String>,
425}
426impl CreateTokenAccountCompanyDirectorshipDeclaration {
427    pub fn new() -> Self {
428        Self { date: None, ip: None, user_agent: None }
429    }
430}
431impl Default for CreateTokenAccountCompanyDirectorshipDeclaration {
432    fn default() -> Self {
433        Self::new()
434    }
435}
436/// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.
437#[derive(Clone, Debug, serde::Serialize)]
438pub struct CreateTokenAccountCompanyOwnershipDeclaration {
439    /// The Unix timestamp marking when the beneficial owner attestation was made.
440    #[serde(skip_serializing_if = "Option::is_none")]
441    pub date: Option<stripe_types::Timestamp>,
442    /// The IP address from which the beneficial owner attestation was made.
443    #[serde(skip_serializing_if = "Option::is_none")]
444    pub ip: Option<String>,
445    /// The user agent of the browser from which the beneficial owner attestation was made.
446    #[serde(skip_serializing_if = "Option::is_none")]
447    pub user_agent: Option<String>,
448}
449impl CreateTokenAccountCompanyOwnershipDeclaration {
450    pub fn new() -> Self {
451        Self { date: None, ip: None, user_agent: None }
452    }
453}
454impl Default for CreateTokenAccountCompanyOwnershipDeclaration {
455    fn default() -> Self {
456        Self::new()
457    }
458}
459/// This value is used to determine if a business is exempt from providing ultimate beneficial owners.
460/// See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details.
461#[derive(Copy, Clone, Eq, PartialEq)]
462pub enum CreateTokenAccountCompanyOwnershipExemptionReason {
463    QualifiedEntityExceedsOwnershipThreshold,
464    QualifiesAsFinancialInstitution,
465}
466impl CreateTokenAccountCompanyOwnershipExemptionReason {
467    pub fn as_str(self) -> &'static str {
468        use CreateTokenAccountCompanyOwnershipExemptionReason::*;
469        match self {
470            QualifiedEntityExceedsOwnershipThreshold => {
471                "qualified_entity_exceeds_ownership_threshold"
472            }
473            QualifiesAsFinancialInstitution => "qualifies_as_financial_institution",
474        }
475    }
476}
477
478impl std::str::FromStr for CreateTokenAccountCompanyOwnershipExemptionReason {
479    type Err = stripe_types::StripeParseError;
480    fn from_str(s: &str) -> Result<Self, Self::Err> {
481        use CreateTokenAccountCompanyOwnershipExemptionReason::*;
482        match s {
483            "qualified_entity_exceeds_ownership_threshold" => {
484                Ok(QualifiedEntityExceedsOwnershipThreshold)
485            }
486            "qualifies_as_financial_institution" => Ok(QualifiesAsFinancialInstitution),
487            _ => Err(stripe_types::StripeParseError),
488        }
489    }
490}
491impl std::fmt::Display for CreateTokenAccountCompanyOwnershipExemptionReason {
492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
493        f.write_str(self.as_str())
494    }
495}
496
497impl std::fmt::Debug for CreateTokenAccountCompanyOwnershipExemptionReason {
498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
499        f.write_str(self.as_str())
500    }
501}
502impl serde::Serialize for CreateTokenAccountCompanyOwnershipExemptionReason {
503    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
504    where
505        S: serde::Serializer,
506    {
507        serializer.serialize_str(self.as_str())
508    }
509}
510#[cfg(feature = "deserialize")]
511impl<'de> serde::Deserialize<'de> for CreateTokenAccountCompanyOwnershipExemptionReason {
512    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
513        use std::str::FromStr;
514        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
515        Self::from_str(&s).map_err(|_| {
516            serde::de::Error::custom(
517                "Unknown value for CreateTokenAccountCompanyOwnershipExemptionReason",
518            )
519        })
520    }
521}
522#[derive(Copy, Clone, Debug, serde::Serialize)]
523pub struct CreateTokenAccountCompanyRegistrationDate {
524    /// The day of registration, between 1 and 31.
525    pub day: i64,
526    /// The month of registration, between 1 and 12.
527    pub month: i64,
528    /// The four-digit year of registration.
529    pub year: i64,
530}
531impl CreateTokenAccountCompanyRegistrationDate {
532    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
533        Self { day: day.into(), month: month.into(), year: year.into() }
534    }
535}
536/// The category identifying the legal structure of the company or legal entity.
537/// See [Business structure](/connect/identity-verification#business-structure) for more details.
538/// Pass an empty string to unset this value.
539#[derive(Clone, Eq, PartialEq)]
540#[non_exhaustive]
541pub enum CreateTokenAccountCompanyStructure {
542    FreeZoneEstablishment,
543    FreeZoneLlc,
544    GovernmentInstrumentality,
545    GovernmentalUnit,
546    IncorporatedNonProfit,
547    IncorporatedPartnership,
548    LimitedLiabilityPartnership,
549    Llc,
550    MultiMemberLlc,
551    PrivateCompany,
552    PrivateCorporation,
553    PrivatePartnership,
554    PublicCompany,
555    PublicCorporation,
556    PublicPartnership,
557    RegisteredCharity,
558    SingleMemberLlc,
559    SoleEstablishment,
560    SoleProprietorship,
561    TaxExemptGovernmentInstrumentality,
562    UnincorporatedAssociation,
563    UnincorporatedNonProfit,
564    UnincorporatedPartnership,
565    /// An unrecognized value from Stripe. Should not be used as a request parameter.
566    Unknown(String),
567}
568impl CreateTokenAccountCompanyStructure {
569    pub fn as_str(&self) -> &str {
570        use CreateTokenAccountCompanyStructure::*;
571        match self {
572            FreeZoneEstablishment => "free_zone_establishment",
573            FreeZoneLlc => "free_zone_llc",
574            GovernmentInstrumentality => "government_instrumentality",
575            GovernmentalUnit => "governmental_unit",
576            IncorporatedNonProfit => "incorporated_non_profit",
577            IncorporatedPartnership => "incorporated_partnership",
578            LimitedLiabilityPartnership => "limited_liability_partnership",
579            Llc => "llc",
580            MultiMemberLlc => "multi_member_llc",
581            PrivateCompany => "private_company",
582            PrivateCorporation => "private_corporation",
583            PrivatePartnership => "private_partnership",
584            PublicCompany => "public_company",
585            PublicCorporation => "public_corporation",
586            PublicPartnership => "public_partnership",
587            RegisteredCharity => "registered_charity",
588            SingleMemberLlc => "single_member_llc",
589            SoleEstablishment => "sole_establishment",
590            SoleProprietorship => "sole_proprietorship",
591            TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality",
592            UnincorporatedAssociation => "unincorporated_association",
593            UnincorporatedNonProfit => "unincorporated_non_profit",
594            UnincorporatedPartnership => "unincorporated_partnership",
595            Unknown(v) => v,
596        }
597    }
598}
599
600impl std::str::FromStr for CreateTokenAccountCompanyStructure {
601    type Err = std::convert::Infallible;
602    fn from_str(s: &str) -> Result<Self, Self::Err> {
603        use CreateTokenAccountCompanyStructure::*;
604        match s {
605            "free_zone_establishment" => Ok(FreeZoneEstablishment),
606            "free_zone_llc" => Ok(FreeZoneLlc),
607            "government_instrumentality" => Ok(GovernmentInstrumentality),
608            "governmental_unit" => Ok(GovernmentalUnit),
609            "incorporated_non_profit" => Ok(IncorporatedNonProfit),
610            "incorporated_partnership" => Ok(IncorporatedPartnership),
611            "limited_liability_partnership" => Ok(LimitedLiabilityPartnership),
612            "llc" => Ok(Llc),
613            "multi_member_llc" => Ok(MultiMemberLlc),
614            "private_company" => Ok(PrivateCompany),
615            "private_corporation" => Ok(PrivateCorporation),
616            "private_partnership" => Ok(PrivatePartnership),
617            "public_company" => Ok(PublicCompany),
618            "public_corporation" => Ok(PublicCorporation),
619            "public_partnership" => Ok(PublicPartnership),
620            "registered_charity" => Ok(RegisteredCharity),
621            "single_member_llc" => Ok(SingleMemberLlc),
622            "sole_establishment" => Ok(SoleEstablishment),
623            "sole_proprietorship" => Ok(SoleProprietorship),
624            "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality),
625            "unincorporated_association" => Ok(UnincorporatedAssociation),
626            "unincorporated_non_profit" => Ok(UnincorporatedNonProfit),
627            "unincorporated_partnership" => Ok(UnincorporatedPartnership),
628            v => Ok(Unknown(v.to_owned())),
629        }
630    }
631}
632impl std::fmt::Display for CreateTokenAccountCompanyStructure {
633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
634        f.write_str(self.as_str())
635    }
636}
637
638impl std::fmt::Debug for CreateTokenAccountCompanyStructure {
639    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
640        f.write_str(self.as_str())
641    }
642}
643impl serde::Serialize for CreateTokenAccountCompanyStructure {
644    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
645    where
646        S: serde::Serializer,
647    {
648        serializer.serialize_str(self.as_str())
649    }
650}
651#[cfg(feature = "deserialize")]
652impl<'de> serde::Deserialize<'de> for CreateTokenAccountCompanyStructure {
653    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
654        use std::str::FromStr;
655        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
656        Ok(Self::from_str(&s).unwrap())
657    }
658}
659/// Information on the verification state of the company.
660#[derive(Clone, Debug, serde::Serialize)]
661pub struct CreateTokenAccountCompanyVerification {
662    /// A document verifying the business.
663    #[serde(skip_serializing_if = "Option::is_none")]
664    pub document: Option<CreateTokenAccountCompanyVerificationDocument>,
665}
666impl CreateTokenAccountCompanyVerification {
667    pub fn new() -> Self {
668        Self { document: None }
669    }
670}
671impl Default for CreateTokenAccountCompanyVerification {
672    fn default() -> Self {
673        Self::new()
674    }
675}
676/// A document verifying the business.
677#[derive(Clone, Debug, serde::Serialize)]
678pub struct CreateTokenAccountCompanyVerificationDocument {
679    /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`.
680    /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
681    #[serde(skip_serializing_if = "Option::is_none")]
682    pub back: Option<String>,
683    /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`.
684    /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
685    #[serde(skip_serializing_if = "Option::is_none")]
686    pub front: Option<String>,
687}
688impl CreateTokenAccountCompanyVerificationDocument {
689    pub fn new() -> Self {
690        Self { back: None, front: None }
691    }
692}
693impl Default for CreateTokenAccountCompanyVerificationDocument {
694    fn default() -> Self {
695        Self::new()
696    }
697}
698/// Information about the person represented by the account.
699#[derive(Clone, Debug, serde::Serialize)]
700pub struct CreateTokenAccountIndividual {
701    /// The individual's primary address.
702    #[serde(skip_serializing_if = "Option::is_none")]
703    pub address: Option<CreateTokenAccountIndividualAddress>,
704    /// The Kana variation of the individual's primary address (Japan only).
705    #[serde(skip_serializing_if = "Option::is_none")]
706    pub address_kana: Option<CreateTokenAccountIndividualAddressKana>,
707    /// The Kanji variation of the individual's primary address (Japan only).
708    #[serde(skip_serializing_if = "Option::is_none")]
709    pub address_kanji: Option<CreateTokenAccountIndividualAddressKanji>,
710    /// The individual's date of birth.
711    #[serde(skip_serializing_if = "Option::is_none")]
712    pub dob: Option<DateOfBirthSpecs>,
713    /// The individual's email address.
714    #[serde(skip_serializing_if = "Option::is_none")]
715    pub email: Option<String>,
716    /// The individual's first name.
717    #[serde(skip_serializing_if = "Option::is_none")]
718    pub first_name: Option<String>,
719    /// The Kana variation of the individual's first name (Japan only).
720    #[serde(skip_serializing_if = "Option::is_none")]
721    pub first_name_kana: Option<String>,
722    /// The Kanji variation of the individual's first name (Japan only).
723    #[serde(skip_serializing_if = "Option::is_none")]
724    pub first_name_kanji: Option<String>,
725    /// A list of alternate names or aliases that the individual is known by.
726    #[serde(skip_serializing_if = "Option::is_none")]
727    pub full_name_aliases: Option<Vec<String>>,
728    /// The individual's gender
729    #[serde(skip_serializing_if = "Option::is_none")]
730    pub gender: Option<String>,
731    /// The government-issued ID number of the individual, as appropriate for the representative's country.
732    /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada).
733    /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](/js/tokens/create_token?type=pii).
734    #[serde(skip_serializing_if = "Option::is_none")]
735    pub id_number: Option<String>,
736    /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks.
737    /// In Thailand, this would be the laser code found on the back of an ID card.
738    /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](/js/tokens/create_token?type=pii).
739    #[serde(skip_serializing_if = "Option::is_none")]
740    pub id_number_secondary: Option<String>,
741    /// The individual's last name.
742    #[serde(skip_serializing_if = "Option::is_none")]
743    pub last_name: Option<String>,
744    /// The Kana variation of the individual's last name (Japan only).
745    #[serde(skip_serializing_if = "Option::is_none")]
746    pub last_name_kana: Option<String>,
747    /// The Kanji variation of the individual's last name (Japan only).
748    #[serde(skip_serializing_if = "Option::is_none")]
749    pub last_name_kanji: Option<String>,
750    /// The individual's maiden name.
751    #[serde(skip_serializing_if = "Option::is_none")]
752    pub maiden_name: Option<String>,
753    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
754    /// This can be useful for storing additional information about the object in a structured format.
755    /// Individual keys can be unset by posting an empty value to them.
756    /// All keys can be unset by posting an empty value to `metadata`.
757    #[serde(skip_serializing_if = "Option::is_none")]
758    pub metadata: Option<std::collections::HashMap<String, String>>,
759    /// The individual's phone number.
760    #[serde(skip_serializing_if = "Option::is_none")]
761    pub phone: Option<String>,
762    /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
763    #[serde(skip_serializing_if = "Option::is_none")]
764    pub political_exposure: Option<CreateTokenAccountIndividualPoliticalExposure>,
765    /// The individual's registered address.
766    #[serde(skip_serializing_if = "Option::is_none")]
767    pub registered_address: Option<CreateTokenAccountIndividualRegisteredAddress>,
768    /// Describes the person’s relationship to the account.
769    #[serde(skip_serializing_if = "Option::is_none")]
770    pub relationship: Option<CreateTokenAccountIndividualRelationship>,
771    /// The last four digits of the individual's Social Security Number (U.S. only).
772    #[serde(skip_serializing_if = "Option::is_none")]
773    pub ssn_last_4: Option<String>,
774    /// The individual's verification document information.
775    #[serde(skip_serializing_if = "Option::is_none")]
776    pub verification: Option<PersonVerificationSpecs>,
777}
778impl CreateTokenAccountIndividual {
779    pub fn new() -> Self {
780        Self {
781            address: None,
782            address_kana: None,
783            address_kanji: None,
784            dob: None,
785            email: None,
786            first_name: None,
787            first_name_kana: None,
788            first_name_kanji: None,
789            full_name_aliases: None,
790            gender: None,
791            id_number: None,
792            id_number_secondary: None,
793            last_name: None,
794            last_name_kana: None,
795            last_name_kanji: None,
796            maiden_name: None,
797            metadata: None,
798            phone: None,
799            political_exposure: None,
800            registered_address: None,
801            relationship: None,
802            ssn_last_4: None,
803            verification: None,
804        }
805    }
806}
807impl Default for CreateTokenAccountIndividual {
808    fn default() -> Self {
809        Self::new()
810    }
811}
812/// The individual's primary address.
813#[derive(Clone, Debug, serde::Serialize)]
814pub struct CreateTokenAccountIndividualAddress {
815    /// City, district, suburb, town, or village.
816    #[serde(skip_serializing_if = "Option::is_none")]
817    pub city: Option<String>,
818    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
819    #[serde(skip_serializing_if = "Option::is_none")]
820    pub country: Option<String>,
821    /// Address line 1 (e.g., street, PO Box, or company name).
822    #[serde(skip_serializing_if = "Option::is_none")]
823    pub line1: Option<String>,
824    /// Address line 2 (e.g., apartment, suite, unit, or building).
825    #[serde(skip_serializing_if = "Option::is_none")]
826    pub line2: Option<String>,
827    /// ZIP or postal code.
828    #[serde(skip_serializing_if = "Option::is_none")]
829    pub postal_code: Option<String>,
830    /// State, county, province, or region.
831    #[serde(skip_serializing_if = "Option::is_none")]
832    pub state: Option<String>,
833}
834impl CreateTokenAccountIndividualAddress {
835    pub fn new() -> Self {
836        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
837    }
838}
839impl Default for CreateTokenAccountIndividualAddress {
840    fn default() -> Self {
841        Self::new()
842    }
843}
844/// The Kana variation of the individual's primary address (Japan only).
845#[derive(Clone, Debug, serde::Serialize)]
846pub struct CreateTokenAccountIndividualAddressKana {
847    /// City or ward.
848    #[serde(skip_serializing_if = "Option::is_none")]
849    pub city: Option<String>,
850    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
851    #[serde(skip_serializing_if = "Option::is_none")]
852    pub country: Option<String>,
853    /// Block or building number.
854    #[serde(skip_serializing_if = "Option::is_none")]
855    pub line1: Option<String>,
856    /// Building details.
857    #[serde(skip_serializing_if = "Option::is_none")]
858    pub line2: Option<String>,
859    /// Postal code.
860    #[serde(skip_serializing_if = "Option::is_none")]
861    pub postal_code: Option<String>,
862    /// Prefecture.
863    #[serde(skip_serializing_if = "Option::is_none")]
864    pub state: Option<String>,
865    /// Town or cho-me.
866    #[serde(skip_serializing_if = "Option::is_none")]
867    pub town: Option<String>,
868}
869impl CreateTokenAccountIndividualAddressKana {
870    pub fn new() -> Self {
871        Self {
872            city: None,
873            country: None,
874            line1: None,
875            line2: None,
876            postal_code: None,
877            state: None,
878            town: None,
879        }
880    }
881}
882impl Default for CreateTokenAccountIndividualAddressKana {
883    fn default() -> Self {
884        Self::new()
885    }
886}
887/// The Kanji variation of the individual's primary address (Japan only).
888#[derive(Clone, Debug, serde::Serialize)]
889pub struct CreateTokenAccountIndividualAddressKanji {
890    /// City or ward.
891    #[serde(skip_serializing_if = "Option::is_none")]
892    pub city: Option<String>,
893    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
894    #[serde(skip_serializing_if = "Option::is_none")]
895    pub country: Option<String>,
896    /// Block or building number.
897    #[serde(skip_serializing_if = "Option::is_none")]
898    pub line1: Option<String>,
899    /// Building details.
900    #[serde(skip_serializing_if = "Option::is_none")]
901    pub line2: Option<String>,
902    /// Postal code.
903    #[serde(skip_serializing_if = "Option::is_none")]
904    pub postal_code: Option<String>,
905    /// Prefecture.
906    #[serde(skip_serializing_if = "Option::is_none")]
907    pub state: Option<String>,
908    /// Town or cho-me.
909    #[serde(skip_serializing_if = "Option::is_none")]
910    pub town: Option<String>,
911}
912impl CreateTokenAccountIndividualAddressKanji {
913    pub fn new() -> Self {
914        Self {
915            city: None,
916            country: None,
917            line1: None,
918            line2: None,
919            postal_code: None,
920            state: None,
921            town: None,
922        }
923    }
924}
925impl Default for CreateTokenAccountIndividualAddressKanji {
926    fn default() -> Self {
927        Self::new()
928    }
929}
930/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
931#[derive(Copy, Clone, Eq, PartialEq)]
932pub enum CreateTokenAccountIndividualPoliticalExposure {
933    Existing,
934    None,
935}
936impl CreateTokenAccountIndividualPoliticalExposure {
937    pub fn as_str(self) -> &'static str {
938        use CreateTokenAccountIndividualPoliticalExposure::*;
939        match self {
940            Existing => "existing",
941            None => "none",
942        }
943    }
944}
945
946impl std::str::FromStr for CreateTokenAccountIndividualPoliticalExposure {
947    type Err = stripe_types::StripeParseError;
948    fn from_str(s: &str) -> Result<Self, Self::Err> {
949        use CreateTokenAccountIndividualPoliticalExposure::*;
950        match s {
951            "existing" => Ok(Existing),
952            "none" => Ok(None),
953            _ => Err(stripe_types::StripeParseError),
954        }
955    }
956}
957impl std::fmt::Display for CreateTokenAccountIndividualPoliticalExposure {
958    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
959        f.write_str(self.as_str())
960    }
961}
962
963impl std::fmt::Debug for CreateTokenAccountIndividualPoliticalExposure {
964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
965        f.write_str(self.as_str())
966    }
967}
968impl serde::Serialize for CreateTokenAccountIndividualPoliticalExposure {
969    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
970    where
971        S: serde::Serializer,
972    {
973        serializer.serialize_str(self.as_str())
974    }
975}
976#[cfg(feature = "deserialize")]
977impl<'de> serde::Deserialize<'de> for CreateTokenAccountIndividualPoliticalExposure {
978    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
979        use std::str::FromStr;
980        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
981        Self::from_str(&s).map_err(|_| {
982            serde::de::Error::custom(
983                "Unknown value for CreateTokenAccountIndividualPoliticalExposure",
984            )
985        })
986    }
987}
988/// The individual's registered address.
989#[derive(Clone, Debug, serde::Serialize)]
990pub struct CreateTokenAccountIndividualRegisteredAddress {
991    /// City, district, suburb, town, or village.
992    #[serde(skip_serializing_if = "Option::is_none")]
993    pub city: Option<String>,
994    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
995    #[serde(skip_serializing_if = "Option::is_none")]
996    pub country: Option<String>,
997    /// Address line 1 (e.g., street, PO Box, or company name).
998    #[serde(skip_serializing_if = "Option::is_none")]
999    pub line1: Option<String>,
1000    /// Address line 2 (e.g., apartment, suite, unit, or building).
1001    #[serde(skip_serializing_if = "Option::is_none")]
1002    pub line2: Option<String>,
1003    /// ZIP or postal code.
1004    #[serde(skip_serializing_if = "Option::is_none")]
1005    pub postal_code: Option<String>,
1006    /// State, county, province, or region.
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub state: Option<String>,
1009}
1010impl CreateTokenAccountIndividualRegisteredAddress {
1011    pub fn new() -> Self {
1012        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
1013    }
1014}
1015impl Default for CreateTokenAccountIndividualRegisteredAddress {
1016    fn default() -> Self {
1017        Self::new()
1018    }
1019}
1020/// Describes the person’s relationship to the account.
1021#[derive(Clone, Debug, serde::Serialize)]
1022pub struct CreateTokenAccountIndividualRelationship {
1023    /// Whether the person is a director of the account's legal entity.
1024    /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
1025    #[serde(skip_serializing_if = "Option::is_none")]
1026    pub director: Option<bool>,
1027    /// Whether the person has significant responsibility to control, manage, or direct the organization.
1028    #[serde(skip_serializing_if = "Option::is_none")]
1029    pub executive: Option<bool>,
1030    /// Whether the person is an owner of the account’s legal entity.
1031    #[serde(skip_serializing_if = "Option::is_none")]
1032    pub owner: Option<bool>,
1033    /// The percent owned by the person of the account's legal entity.
1034    #[serde(skip_serializing_if = "Option::is_none")]
1035    pub percent_ownership: Option<f64>,
1036    /// The person's title (e.g., CEO, Support Engineer).
1037    #[serde(skip_serializing_if = "Option::is_none")]
1038    pub title: Option<String>,
1039}
1040impl CreateTokenAccountIndividualRelationship {
1041    pub fn new() -> Self {
1042        Self { director: None, executive: None, owner: None, percent_ownership: None, title: None }
1043    }
1044}
1045impl Default for CreateTokenAccountIndividualRelationship {
1046    fn default() -> Self {
1047        Self::new()
1048    }
1049}
1050/// The bank account this token will represent.
1051#[derive(Clone, Debug, serde::Serialize)]
1052pub struct CreateTokenBankAccount {
1053    /// The name of the person or business that owns the bank account.
1054    /// This field is required when attaching the bank account to a `Customer` object.
1055    #[serde(skip_serializing_if = "Option::is_none")]
1056    pub account_holder_name: Option<String>,
1057    /// The type of entity that holds the account.
1058    /// It can be `company` or `individual`.
1059    /// This field is required when attaching the bank account to a `Customer` object.
1060    #[serde(skip_serializing_if = "Option::is_none")]
1061    pub account_holder_type: Option<CreateTokenBankAccountAccountHolderType>,
1062    /// The account number for the bank account, in string form. Must be a checking account.
1063    pub account_number: String,
1064    /// The bank account type.
1065    /// This can only be `checking` or `savings` in most countries.
1066    /// In Japan, this can only be `futsu` or `toza`.
1067    #[serde(skip_serializing_if = "Option::is_none")]
1068    pub account_type: Option<CreateTokenBankAccountAccountType>,
1069    /// The country in which the bank account is located.
1070    pub country: String,
1071    /// The currency the bank account is in.
1072    /// This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts).
1073    #[serde(skip_serializing_if = "Option::is_none")]
1074    pub currency: Option<stripe_types::Currency>,
1075    /// The ID of a Payment Method with a `type` of `us_bank_account`.
1076    /// The Payment Method's bank account information will be copied and returned as a Bank Account Token.
1077    /// This parameter is exclusive with respect to all other parameters in the `bank_account` hash.
1078    /// You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object.
1079    /// If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again.
1080    /// You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`.
1081    #[serde(skip_serializing_if = "Option::is_none")]
1082    pub payment_method: Option<String>,
1083    /// The routing number, sort code, or other country-appropriate institution number for the bank account.
1084    /// For US bank accounts, this is required and should be the ACH routing number, not the wire routing number.
1085    /// If you are providing an IBAN for `account_number`, this field is not required.
1086    #[serde(skip_serializing_if = "Option::is_none")]
1087    pub routing_number: Option<String>,
1088}
1089impl CreateTokenBankAccount {
1090    pub fn new(account_number: impl Into<String>, country: impl Into<String>) -> Self {
1091        Self {
1092            account_holder_name: None,
1093            account_holder_type: None,
1094            account_number: account_number.into(),
1095            account_type: None,
1096            country: country.into(),
1097            currency: None,
1098            payment_method: None,
1099            routing_number: None,
1100        }
1101    }
1102}
1103/// The type of entity that holds the account.
1104/// It can be `company` or `individual`.
1105/// This field is required when attaching the bank account to a `Customer` object.
1106#[derive(Copy, Clone, Eq, PartialEq)]
1107pub enum CreateTokenBankAccountAccountHolderType {
1108    Company,
1109    Individual,
1110}
1111impl CreateTokenBankAccountAccountHolderType {
1112    pub fn as_str(self) -> &'static str {
1113        use CreateTokenBankAccountAccountHolderType::*;
1114        match self {
1115            Company => "company",
1116            Individual => "individual",
1117        }
1118    }
1119}
1120
1121impl std::str::FromStr for CreateTokenBankAccountAccountHolderType {
1122    type Err = stripe_types::StripeParseError;
1123    fn from_str(s: &str) -> Result<Self, Self::Err> {
1124        use CreateTokenBankAccountAccountHolderType::*;
1125        match s {
1126            "company" => Ok(Company),
1127            "individual" => Ok(Individual),
1128            _ => Err(stripe_types::StripeParseError),
1129        }
1130    }
1131}
1132impl std::fmt::Display for CreateTokenBankAccountAccountHolderType {
1133    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1134        f.write_str(self.as_str())
1135    }
1136}
1137
1138impl std::fmt::Debug for CreateTokenBankAccountAccountHolderType {
1139    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1140        f.write_str(self.as_str())
1141    }
1142}
1143impl serde::Serialize for CreateTokenBankAccountAccountHolderType {
1144    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1145    where
1146        S: serde::Serializer,
1147    {
1148        serializer.serialize_str(self.as_str())
1149    }
1150}
1151#[cfg(feature = "deserialize")]
1152impl<'de> serde::Deserialize<'de> for CreateTokenBankAccountAccountHolderType {
1153    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1154        use std::str::FromStr;
1155        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1156        Self::from_str(&s).map_err(|_| {
1157            serde::de::Error::custom("Unknown value for CreateTokenBankAccountAccountHolderType")
1158        })
1159    }
1160}
1161/// The bank account type.
1162/// This can only be `checking` or `savings` in most countries.
1163/// In Japan, this can only be `futsu` or `toza`.
1164#[derive(Copy, Clone, Eq, PartialEq)]
1165pub enum CreateTokenBankAccountAccountType {
1166    Checking,
1167    Futsu,
1168    Savings,
1169    Toza,
1170}
1171impl CreateTokenBankAccountAccountType {
1172    pub fn as_str(self) -> &'static str {
1173        use CreateTokenBankAccountAccountType::*;
1174        match self {
1175            Checking => "checking",
1176            Futsu => "futsu",
1177            Savings => "savings",
1178            Toza => "toza",
1179        }
1180    }
1181}
1182
1183impl std::str::FromStr for CreateTokenBankAccountAccountType {
1184    type Err = stripe_types::StripeParseError;
1185    fn from_str(s: &str) -> Result<Self, Self::Err> {
1186        use CreateTokenBankAccountAccountType::*;
1187        match s {
1188            "checking" => Ok(Checking),
1189            "futsu" => Ok(Futsu),
1190            "savings" => Ok(Savings),
1191            "toza" => Ok(Toza),
1192            _ => Err(stripe_types::StripeParseError),
1193        }
1194    }
1195}
1196impl std::fmt::Display for CreateTokenBankAccountAccountType {
1197    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1198        f.write_str(self.as_str())
1199    }
1200}
1201
1202impl std::fmt::Debug for CreateTokenBankAccountAccountType {
1203    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1204        f.write_str(self.as_str())
1205    }
1206}
1207impl serde::Serialize for CreateTokenBankAccountAccountType {
1208    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1209    where
1210        S: serde::Serializer,
1211    {
1212        serializer.serialize_str(self.as_str())
1213    }
1214}
1215#[cfg(feature = "deserialize")]
1216impl<'de> serde::Deserialize<'de> for CreateTokenBankAccountAccountType {
1217    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1218        use std::str::FromStr;
1219        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1220        Self::from_str(&s).map_err(|_| {
1221            serde::de::Error::custom("Unknown value for CreateTokenBankAccountAccountType")
1222        })
1223    }
1224}
1225/// The card this token will represent.
1226/// If you also pass in a customer, the card must be the ID of a card belonging to the customer.
1227/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below.
1228#[derive(Clone, Debug, serde::Serialize)]
1229#[serde(rename_all = "snake_case")]
1230pub enum CreateTokenCard {
1231    #[serde(untagged)]
1232    CreditCardSpecs(CreateTokenCreditCardSpecs),
1233    #[serde(untagged)]
1234    String(String),
1235}
1236/// The card this token will represent.
1237/// If you also pass in a customer, the card must be the ID of a card belonging to the customer.
1238/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below.
1239#[derive(Clone, Debug, serde::Serialize)]
1240pub struct CreateTokenCreditCardSpecs {
1241    /// City / District / Suburb / Town / Village.
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub address_city: Option<String>,
1244    /// Billing address country, if provided.
1245    #[serde(skip_serializing_if = "Option::is_none")]
1246    pub address_country: Option<String>,
1247    /// Address line 1 (Street address / PO Box / Company name).
1248    #[serde(skip_serializing_if = "Option::is_none")]
1249    pub address_line1: Option<String>,
1250    /// Address line 2 (Apartment / Suite / Unit / Building).
1251    #[serde(skip_serializing_if = "Option::is_none")]
1252    pub address_line2: Option<String>,
1253    /// State / County / Province / Region.
1254    #[serde(skip_serializing_if = "Option::is_none")]
1255    pub address_state: Option<String>,
1256    /// ZIP or postal code.
1257    #[serde(skip_serializing_if = "Option::is_none")]
1258    pub address_zip: Option<String>,
1259    /// Required in order to add the card to an account; in all other cases, this parameter is not used.
1260    /// When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency.
1261    #[serde(skip_serializing_if = "Option::is_none")]
1262    pub currency: Option<stripe_types::Currency>,
1263    /// Card security code. Highly recommended to always include this value.
1264    #[serde(skip_serializing_if = "Option::is_none")]
1265    pub cvc: Option<String>,
1266    /// Two-digit number representing the card's expiration month.
1267    pub exp_month: String,
1268    /// Two- or four-digit number representing the card's expiration year.
1269    pub exp_year: String,
1270    /// Cardholder's full name.
1271    #[serde(skip_serializing_if = "Option::is_none")]
1272    pub name: Option<String>,
1273    /// Contains information about card networks used to process the payment.
1274    #[serde(skip_serializing_if = "Option::is_none")]
1275    pub networks: Option<CreateTokenCreditCardSpecsNetworks>,
1276    /// The card number, as a string without any separators.
1277    pub number: String,
1278}
1279impl CreateTokenCreditCardSpecs {
1280    pub fn new(
1281        exp_month: impl Into<String>,
1282        exp_year: impl Into<String>,
1283        number: impl Into<String>,
1284    ) -> Self {
1285        Self {
1286            address_city: None,
1287            address_country: None,
1288            address_line1: None,
1289            address_line2: None,
1290            address_state: None,
1291            address_zip: None,
1292            currency: None,
1293            cvc: None,
1294            exp_month: exp_month.into(),
1295            exp_year: exp_year.into(),
1296            name: None,
1297            networks: None,
1298            number: number.into(),
1299        }
1300    }
1301}
1302/// Contains information about card networks used to process the payment.
1303#[derive(Copy, Clone, Debug, serde::Serialize)]
1304pub struct CreateTokenCreditCardSpecsNetworks {
1305    /// The customer's preferred card network for co-branded cards.
1306    /// Supports `cartes_bancaires`, `mastercard`, or `visa`.
1307    /// Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card.
1308    #[serde(skip_serializing_if = "Option::is_none")]
1309    pub preferred: Option<CreateTokenCreditCardSpecsNetworksPreferred>,
1310}
1311impl CreateTokenCreditCardSpecsNetworks {
1312    pub fn new() -> Self {
1313        Self { preferred: None }
1314    }
1315}
1316impl Default for CreateTokenCreditCardSpecsNetworks {
1317    fn default() -> Self {
1318        Self::new()
1319    }
1320}
1321/// The customer's preferred card network for co-branded cards.
1322/// Supports `cartes_bancaires`, `mastercard`, or `visa`.
1323/// Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card.
1324#[derive(Copy, Clone, Eq, PartialEq)]
1325pub enum CreateTokenCreditCardSpecsNetworksPreferred {
1326    CartesBancaires,
1327    Mastercard,
1328    Visa,
1329}
1330impl CreateTokenCreditCardSpecsNetworksPreferred {
1331    pub fn as_str(self) -> &'static str {
1332        use CreateTokenCreditCardSpecsNetworksPreferred::*;
1333        match self {
1334            CartesBancaires => "cartes_bancaires",
1335            Mastercard => "mastercard",
1336            Visa => "visa",
1337        }
1338    }
1339}
1340
1341impl std::str::FromStr for CreateTokenCreditCardSpecsNetworksPreferred {
1342    type Err = stripe_types::StripeParseError;
1343    fn from_str(s: &str) -> Result<Self, Self::Err> {
1344        use CreateTokenCreditCardSpecsNetworksPreferred::*;
1345        match s {
1346            "cartes_bancaires" => Ok(CartesBancaires),
1347            "mastercard" => Ok(Mastercard),
1348            "visa" => Ok(Visa),
1349            _ => Err(stripe_types::StripeParseError),
1350        }
1351    }
1352}
1353impl std::fmt::Display for CreateTokenCreditCardSpecsNetworksPreferred {
1354    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1355        f.write_str(self.as_str())
1356    }
1357}
1358
1359impl std::fmt::Debug for CreateTokenCreditCardSpecsNetworksPreferred {
1360    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1361        f.write_str(self.as_str())
1362    }
1363}
1364impl serde::Serialize for CreateTokenCreditCardSpecsNetworksPreferred {
1365    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1366    where
1367        S: serde::Serializer,
1368    {
1369        serializer.serialize_str(self.as_str())
1370    }
1371}
1372#[cfg(feature = "deserialize")]
1373impl<'de> serde::Deserialize<'de> for CreateTokenCreditCardSpecsNetworksPreferred {
1374    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1375        use std::str::FromStr;
1376        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1377        Self::from_str(&s).map_err(|_| {
1378            serde::de::Error::custom(
1379                "Unknown value for CreateTokenCreditCardSpecsNetworksPreferred",
1380            )
1381        })
1382    }
1383}
1384/// The updated CVC value this token represents.
1385#[derive(Clone, Debug, serde::Serialize)]
1386pub struct CreateTokenCvcUpdate {
1387    /// The CVC value, in string form.
1388    pub cvc: String,
1389}
1390impl CreateTokenCvcUpdate {
1391    pub fn new(cvc: impl Into<String>) -> Self {
1392        Self { cvc: cvc.into() }
1393    }
1394}
1395/// Information for the person this token represents.
1396#[derive(Clone, Debug, serde::Serialize)]
1397pub struct CreateTokenPerson {
1398    /// Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements.
1399    #[serde(skip_serializing_if = "Option::is_none")]
1400    pub additional_tos_acceptances: Option<CreateTokenPersonAdditionalTosAcceptances>,
1401    /// The person's address.
1402    #[serde(skip_serializing_if = "Option::is_none")]
1403    pub address: Option<CreateTokenPersonAddress>,
1404    /// The Kana variation of the person's address (Japan only).
1405    #[serde(skip_serializing_if = "Option::is_none")]
1406    pub address_kana: Option<CreateTokenPersonAddressKana>,
1407    /// The Kanji variation of the person's address (Japan only).
1408    #[serde(skip_serializing_if = "Option::is_none")]
1409    pub address_kanji: Option<CreateTokenPersonAddressKanji>,
1410    /// The person's date of birth.
1411    #[serde(skip_serializing_if = "Option::is_none")]
1412    pub dob: Option<DateOfBirthSpecs>,
1413    /// Documents that may be submitted to satisfy various informational requests.
1414    #[serde(skip_serializing_if = "Option::is_none")]
1415    pub documents: Option<CreateTokenPersonDocuments>,
1416    /// The person's email address.
1417    #[serde(skip_serializing_if = "Option::is_none")]
1418    pub email: Option<String>,
1419    /// The person's first name.
1420    #[serde(skip_serializing_if = "Option::is_none")]
1421    pub first_name: Option<String>,
1422    /// The Kana variation of the person's first name (Japan only).
1423    #[serde(skip_serializing_if = "Option::is_none")]
1424    pub first_name_kana: Option<String>,
1425    /// The Kanji variation of the person's first name (Japan only).
1426    #[serde(skip_serializing_if = "Option::is_none")]
1427    pub first_name_kanji: Option<String>,
1428    /// A list of alternate names or aliases that the person is known by.
1429    #[serde(skip_serializing_if = "Option::is_none")]
1430    pub full_name_aliases: Option<Vec<String>>,
1431    /// The person's gender (International regulations require either "male" or "female").
1432    #[serde(skip_serializing_if = "Option::is_none")]
1433    pub gender: Option<String>,
1434    /// The person's ID number, as appropriate for their country.
1435    /// For example, a social security number in the U.S., social insurance number in Canada, etc.
1436    /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii).
1437    #[serde(skip_serializing_if = "Option::is_none")]
1438    pub id_number: Option<String>,
1439    /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks.
1440    /// In Thailand, this would be the laser code found on the back of an ID card.
1441    /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii).
1442    #[serde(skip_serializing_if = "Option::is_none")]
1443    pub id_number_secondary: Option<String>,
1444    /// The person's last name.
1445    #[serde(skip_serializing_if = "Option::is_none")]
1446    pub last_name: Option<String>,
1447    /// The Kana variation of the person's last name (Japan only).
1448    #[serde(skip_serializing_if = "Option::is_none")]
1449    pub last_name_kana: Option<String>,
1450    /// The Kanji variation of the person's last name (Japan only).
1451    #[serde(skip_serializing_if = "Option::is_none")]
1452    pub last_name_kanji: Option<String>,
1453    /// The person's maiden name.
1454    #[serde(skip_serializing_if = "Option::is_none")]
1455    pub maiden_name: Option<String>,
1456    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1457    /// This can be useful for storing additional information about the object in a structured format.
1458    /// Individual keys can be unset by posting an empty value to them.
1459    /// All keys can be unset by posting an empty value to `metadata`.
1460    #[serde(skip_serializing_if = "Option::is_none")]
1461    pub metadata: Option<std::collections::HashMap<String, String>>,
1462    /// The country where the person is a national.
1463    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable.
1464    #[serde(skip_serializing_if = "Option::is_none")]
1465    pub nationality: Option<String>,
1466    /// The person's phone number.
1467    #[serde(skip_serializing_if = "Option::is_none")]
1468    pub phone: Option<String>,
1469    /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
1470    #[serde(skip_serializing_if = "Option::is_none")]
1471    pub political_exposure: Option<CreateTokenPersonPoliticalExposure>,
1472    /// The person's registered address.
1473    #[serde(skip_serializing_if = "Option::is_none")]
1474    pub registered_address: Option<CreateTokenPersonRegisteredAddress>,
1475    /// The relationship that this person has with the account's legal entity.
1476    #[serde(skip_serializing_if = "Option::is_none")]
1477    pub relationship: Option<CreateTokenPersonRelationship>,
1478    /// The last four digits of the person's Social Security number (U.S. only).
1479    #[serde(skip_serializing_if = "Option::is_none")]
1480    pub ssn_last_4: Option<String>,
1481    /// Demographic data related to the person.
1482    #[serde(skip_serializing_if = "Option::is_none")]
1483    pub us_cfpb_data: Option<CreateTokenPersonUsCfpbData>,
1484    /// The person's verification status.
1485    #[serde(skip_serializing_if = "Option::is_none")]
1486    pub verification: Option<PersonVerificationSpecs>,
1487}
1488impl CreateTokenPerson {
1489    pub fn new() -> Self {
1490        Self {
1491            additional_tos_acceptances: None,
1492            address: None,
1493            address_kana: None,
1494            address_kanji: None,
1495            dob: None,
1496            documents: None,
1497            email: None,
1498            first_name: None,
1499            first_name_kana: None,
1500            first_name_kanji: None,
1501            full_name_aliases: None,
1502            gender: None,
1503            id_number: None,
1504            id_number_secondary: None,
1505            last_name: None,
1506            last_name_kana: None,
1507            last_name_kanji: None,
1508            maiden_name: None,
1509            metadata: None,
1510            nationality: None,
1511            phone: None,
1512            political_exposure: None,
1513            registered_address: None,
1514            relationship: None,
1515            ssn_last_4: None,
1516            us_cfpb_data: None,
1517            verification: None,
1518        }
1519    }
1520}
1521impl Default for CreateTokenPerson {
1522    fn default() -> Self {
1523        Self::new()
1524    }
1525}
1526/// Details on the legal guardian's or authorizer's acceptance of the required Stripe agreements.
1527#[derive(Clone, Debug, serde::Serialize)]
1528pub struct CreateTokenPersonAdditionalTosAcceptances {
1529    /// Details on the legal guardian's acceptance of the main Stripe service agreement.
1530    #[serde(skip_serializing_if = "Option::is_none")]
1531    pub account: Option<CreateTokenPersonAdditionalTosAcceptancesAccount>,
1532}
1533impl CreateTokenPersonAdditionalTosAcceptances {
1534    pub fn new() -> Self {
1535        Self { account: None }
1536    }
1537}
1538impl Default for CreateTokenPersonAdditionalTosAcceptances {
1539    fn default() -> Self {
1540        Self::new()
1541    }
1542}
1543/// Details on the legal guardian's acceptance of the main Stripe service agreement.
1544#[derive(Clone, Debug, serde::Serialize)]
1545pub struct CreateTokenPersonAdditionalTosAcceptancesAccount {
1546    /// The Unix timestamp marking when the account representative accepted the service agreement.
1547    #[serde(skip_serializing_if = "Option::is_none")]
1548    pub date: Option<stripe_types::Timestamp>,
1549    /// The IP address from which the account representative accepted the service agreement.
1550    #[serde(skip_serializing_if = "Option::is_none")]
1551    pub ip: Option<String>,
1552    /// The user agent of the browser from which the account representative accepted the service agreement.
1553    #[serde(skip_serializing_if = "Option::is_none")]
1554    pub user_agent: Option<String>,
1555}
1556impl CreateTokenPersonAdditionalTosAcceptancesAccount {
1557    pub fn new() -> Self {
1558        Self { date: None, ip: None, user_agent: None }
1559    }
1560}
1561impl Default for CreateTokenPersonAdditionalTosAcceptancesAccount {
1562    fn default() -> Self {
1563        Self::new()
1564    }
1565}
1566/// The person's address.
1567#[derive(Clone, Debug, serde::Serialize)]
1568pub struct CreateTokenPersonAddress {
1569    /// City, district, suburb, town, or village.
1570    #[serde(skip_serializing_if = "Option::is_none")]
1571    pub city: Option<String>,
1572    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1573    #[serde(skip_serializing_if = "Option::is_none")]
1574    pub country: Option<String>,
1575    /// Address line 1 (e.g., street, PO Box, or company name).
1576    #[serde(skip_serializing_if = "Option::is_none")]
1577    pub line1: Option<String>,
1578    /// Address line 2 (e.g., apartment, suite, unit, or building).
1579    #[serde(skip_serializing_if = "Option::is_none")]
1580    pub line2: Option<String>,
1581    /// ZIP or postal code.
1582    #[serde(skip_serializing_if = "Option::is_none")]
1583    pub postal_code: Option<String>,
1584    /// State, county, province, or region.
1585    #[serde(skip_serializing_if = "Option::is_none")]
1586    pub state: Option<String>,
1587}
1588impl CreateTokenPersonAddress {
1589    pub fn new() -> Self {
1590        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
1591    }
1592}
1593impl Default for CreateTokenPersonAddress {
1594    fn default() -> Self {
1595        Self::new()
1596    }
1597}
1598/// The Kana variation of the person's address (Japan only).
1599#[derive(Clone, Debug, serde::Serialize)]
1600pub struct CreateTokenPersonAddressKana {
1601    /// City or ward.
1602    #[serde(skip_serializing_if = "Option::is_none")]
1603    pub city: Option<String>,
1604    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1605    #[serde(skip_serializing_if = "Option::is_none")]
1606    pub country: Option<String>,
1607    /// Block or building number.
1608    #[serde(skip_serializing_if = "Option::is_none")]
1609    pub line1: Option<String>,
1610    /// Building details.
1611    #[serde(skip_serializing_if = "Option::is_none")]
1612    pub line2: Option<String>,
1613    /// Postal code.
1614    #[serde(skip_serializing_if = "Option::is_none")]
1615    pub postal_code: Option<String>,
1616    /// Prefecture.
1617    #[serde(skip_serializing_if = "Option::is_none")]
1618    pub state: Option<String>,
1619    /// Town or cho-me.
1620    #[serde(skip_serializing_if = "Option::is_none")]
1621    pub town: Option<String>,
1622}
1623impl CreateTokenPersonAddressKana {
1624    pub fn new() -> Self {
1625        Self {
1626            city: None,
1627            country: None,
1628            line1: None,
1629            line2: None,
1630            postal_code: None,
1631            state: None,
1632            town: None,
1633        }
1634    }
1635}
1636impl Default for CreateTokenPersonAddressKana {
1637    fn default() -> Self {
1638        Self::new()
1639    }
1640}
1641/// The Kanji variation of the person's address (Japan only).
1642#[derive(Clone, Debug, serde::Serialize)]
1643pub struct CreateTokenPersonAddressKanji {
1644    /// City or ward.
1645    #[serde(skip_serializing_if = "Option::is_none")]
1646    pub city: Option<String>,
1647    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1648    #[serde(skip_serializing_if = "Option::is_none")]
1649    pub country: Option<String>,
1650    /// Block or building number.
1651    #[serde(skip_serializing_if = "Option::is_none")]
1652    pub line1: Option<String>,
1653    /// Building details.
1654    #[serde(skip_serializing_if = "Option::is_none")]
1655    pub line2: Option<String>,
1656    /// Postal code.
1657    #[serde(skip_serializing_if = "Option::is_none")]
1658    pub postal_code: Option<String>,
1659    /// Prefecture.
1660    #[serde(skip_serializing_if = "Option::is_none")]
1661    pub state: Option<String>,
1662    /// Town or cho-me.
1663    #[serde(skip_serializing_if = "Option::is_none")]
1664    pub town: Option<String>,
1665}
1666impl CreateTokenPersonAddressKanji {
1667    pub fn new() -> Self {
1668        Self {
1669            city: None,
1670            country: None,
1671            line1: None,
1672            line2: None,
1673            postal_code: None,
1674            state: None,
1675            town: None,
1676        }
1677    }
1678}
1679impl Default for CreateTokenPersonAddressKanji {
1680    fn default() -> Self {
1681        Self::new()
1682    }
1683}
1684/// Documents that may be submitted to satisfy various informational requests.
1685#[derive(Clone, Debug, serde::Serialize)]
1686pub struct CreateTokenPersonDocuments {
1687    /// One or more documents that demonstrate proof that this person is authorized to represent the company.
1688    #[serde(skip_serializing_if = "Option::is_none")]
1689    pub company_authorization: Option<DocumentsParam>,
1690    /// One or more documents showing the person's passport page with photo and personal data.
1691    #[serde(skip_serializing_if = "Option::is_none")]
1692    pub passport: Option<DocumentsParam>,
1693    /// One or more documents showing the person's visa required for living in the country where they are residing.
1694    #[serde(skip_serializing_if = "Option::is_none")]
1695    pub visa: Option<DocumentsParam>,
1696}
1697impl CreateTokenPersonDocuments {
1698    pub fn new() -> Self {
1699        Self { company_authorization: None, passport: None, visa: None }
1700    }
1701}
1702impl Default for CreateTokenPersonDocuments {
1703    fn default() -> Self {
1704        Self::new()
1705    }
1706}
1707/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
1708#[derive(Copy, Clone, Eq, PartialEq)]
1709pub enum CreateTokenPersonPoliticalExposure {
1710    Existing,
1711    None,
1712}
1713impl CreateTokenPersonPoliticalExposure {
1714    pub fn as_str(self) -> &'static str {
1715        use CreateTokenPersonPoliticalExposure::*;
1716        match self {
1717            Existing => "existing",
1718            None => "none",
1719        }
1720    }
1721}
1722
1723impl std::str::FromStr for CreateTokenPersonPoliticalExposure {
1724    type Err = stripe_types::StripeParseError;
1725    fn from_str(s: &str) -> Result<Self, Self::Err> {
1726        use CreateTokenPersonPoliticalExposure::*;
1727        match s {
1728            "existing" => Ok(Existing),
1729            "none" => Ok(None),
1730            _ => Err(stripe_types::StripeParseError),
1731        }
1732    }
1733}
1734impl std::fmt::Display for CreateTokenPersonPoliticalExposure {
1735    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1736        f.write_str(self.as_str())
1737    }
1738}
1739
1740impl std::fmt::Debug for CreateTokenPersonPoliticalExposure {
1741    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1742        f.write_str(self.as_str())
1743    }
1744}
1745impl serde::Serialize for CreateTokenPersonPoliticalExposure {
1746    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1747    where
1748        S: serde::Serializer,
1749    {
1750        serializer.serialize_str(self.as_str())
1751    }
1752}
1753#[cfg(feature = "deserialize")]
1754impl<'de> serde::Deserialize<'de> for CreateTokenPersonPoliticalExposure {
1755    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1756        use std::str::FromStr;
1757        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1758        Self::from_str(&s).map_err(|_| {
1759            serde::de::Error::custom("Unknown value for CreateTokenPersonPoliticalExposure")
1760        })
1761    }
1762}
1763/// The person's registered address.
1764#[derive(Clone, Debug, serde::Serialize)]
1765pub struct CreateTokenPersonRegisteredAddress {
1766    /// City, district, suburb, town, or village.
1767    #[serde(skip_serializing_if = "Option::is_none")]
1768    pub city: Option<String>,
1769    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1770    #[serde(skip_serializing_if = "Option::is_none")]
1771    pub country: Option<String>,
1772    /// Address line 1 (e.g., street, PO Box, or company name).
1773    #[serde(skip_serializing_if = "Option::is_none")]
1774    pub line1: Option<String>,
1775    /// Address line 2 (e.g., apartment, suite, unit, or building).
1776    #[serde(skip_serializing_if = "Option::is_none")]
1777    pub line2: Option<String>,
1778    /// ZIP or postal code.
1779    #[serde(skip_serializing_if = "Option::is_none")]
1780    pub postal_code: Option<String>,
1781    /// State, county, province, or region.
1782    #[serde(skip_serializing_if = "Option::is_none")]
1783    pub state: Option<String>,
1784}
1785impl CreateTokenPersonRegisteredAddress {
1786    pub fn new() -> Self {
1787        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
1788    }
1789}
1790impl Default for CreateTokenPersonRegisteredAddress {
1791    fn default() -> Self {
1792        Self::new()
1793    }
1794}
1795/// The relationship that this person has with the account's legal entity.
1796#[derive(Clone, Debug, serde::Serialize)]
1797pub struct CreateTokenPersonRelationship {
1798    /// Whether the person is the authorizer of the account's representative.
1799    #[serde(skip_serializing_if = "Option::is_none")]
1800    pub authorizer: Option<bool>,
1801    /// Whether the person is a director of the account's legal entity.
1802    /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
1803    #[serde(skip_serializing_if = "Option::is_none")]
1804    pub director: Option<bool>,
1805    /// Whether the person has significant responsibility to control, manage, or direct the organization.
1806    #[serde(skip_serializing_if = "Option::is_none")]
1807    pub executive: Option<bool>,
1808    /// Whether the person is the legal guardian of the account's representative.
1809    #[serde(skip_serializing_if = "Option::is_none")]
1810    pub legal_guardian: Option<bool>,
1811    /// Whether the person is an owner of the account’s legal entity.
1812    #[serde(skip_serializing_if = "Option::is_none")]
1813    pub owner: Option<bool>,
1814    /// The percent owned by the person of the account's legal entity.
1815    #[serde(skip_serializing_if = "Option::is_none")]
1816    pub percent_ownership: Option<f64>,
1817    /// Whether the person is authorized as the primary representative of the account.
1818    /// This is the person nominated by the business to provide information about themselves, and general information about the account.
1819    /// There can only be one representative at any given time.
1820    /// At the time the account is created, this person should be set to the person responsible for opening the account.
1821    #[serde(skip_serializing_if = "Option::is_none")]
1822    pub representative: Option<bool>,
1823    /// The person's title (e.g., CEO, Support Engineer).
1824    #[serde(skip_serializing_if = "Option::is_none")]
1825    pub title: Option<String>,
1826}
1827impl CreateTokenPersonRelationship {
1828    pub fn new() -> Self {
1829        Self {
1830            authorizer: None,
1831            director: None,
1832            executive: None,
1833            legal_guardian: None,
1834            owner: None,
1835            percent_ownership: None,
1836            representative: None,
1837            title: None,
1838        }
1839    }
1840}
1841impl Default for CreateTokenPersonRelationship {
1842    fn default() -> Self {
1843        Self::new()
1844    }
1845}
1846/// Demographic data related to the person.
1847#[derive(Clone, Debug, serde::Serialize)]
1848pub struct CreateTokenPersonUsCfpbData {
1849    /// The persons ethnicity details
1850    #[serde(skip_serializing_if = "Option::is_none")]
1851    pub ethnicity_details: Option<CreateTokenPersonUsCfpbDataEthnicityDetails>,
1852    /// The persons race details
1853    #[serde(skip_serializing_if = "Option::is_none")]
1854    pub race_details: Option<CreateTokenPersonUsCfpbDataRaceDetails>,
1855    /// The persons self-identified gender
1856    #[serde(skip_serializing_if = "Option::is_none")]
1857    pub self_identified_gender: Option<String>,
1858}
1859impl CreateTokenPersonUsCfpbData {
1860    pub fn new() -> Self {
1861        Self { ethnicity_details: None, race_details: None, self_identified_gender: None }
1862    }
1863}
1864impl Default for CreateTokenPersonUsCfpbData {
1865    fn default() -> Self {
1866        Self::new()
1867    }
1868}
1869/// The persons ethnicity details
1870#[derive(Clone, Debug, serde::Serialize)]
1871pub struct CreateTokenPersonUsCfpbDataEthnicityDetails {
1872    /// The persons ethnicity
1873    #[serde(skip_serializing_if = "Option::is_none")]
1874    pub ethnicity: Option<Vec<CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity>>,
1875    /// Please specify your origin, when other is selected.
1876    #[serde(skip_serializing_if = "Option::is_none")]
1877    pub ethnicity_other: Option<String>,
1878}
1879impl CreateTokenPersonUsCfpbDataEthnicityDetails {
1880    pub fn new() -> Self {
1881        Self { ethnicity: None, ethnicity_other: None }
1882    }
1883}
1884impl Default for CreateTokenPersonUsCfpbDataEthnicityDetails {
1885    fn default() -> Self {
1886        Self::new()
1887    }
1888}
1889/// The persons ethnicity
1890#[derive(Copy, Clone, Eq, PartialEq)]
1891pub enum CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1892    Cuban,
1893    HispanicOrLatino,
1894    Mexican,
1895    NotHispanicOrLatino,
1896    OtherHispanicOrLatino,
1897    PreferNotToAnswer,
1898    PuertoRican,
1899}
1900impl CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1901    pub fn as_str(self) -> &'static str {
1902        use CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity::*;
1903        match self {
1904            Cuban => "cuban",
1905            HispanicOrLatino => "hispanic_or_latino",
1906            Mexican => "mexican",
1907            NotHispanicOrLatino => "not_hispanic_or_latino",
1908            OtherHispanicOrLatino => "other_hispanic_or_latino",
1909            PreferNotToAnswer => "prefer_not_to_answer",
1910            PuertoRican => "puerto_rican",
1911        }
1912    }
1913}
1914
1915impl std::str::FromStr for CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1916    type Err = stripe_types::StripeParseError;
1917    fn from_str(s: &str) -> Result<Self, Self::Err> {
1918        use CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity::*;
1919        match s {
1920            "cuban" => Ok(Cuban),
1921            "hispanic_or_latino" => Ok(HispanicOrLatino),
1922            "mexican" => Ok(Mexican),
1923            "not_hispanic_or_latino" => Ok(NotHispanicOrLatino),
1924            "other_hispanic_or_latino" => Ok(OtherHispanicOrLatino),
1925            "prefer_not_to_answer" => Ok(PreferNotToAnswer),
1926            "puerto_rican" => Ok(PuertoRican),
1927            _ => Err(stripe_types::StripeParseError),
1928        }
1929    }
1930}
1931impl std::fmt::Display for CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1932    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1933        f.write_str(self.as_str())
1934    }
1935}
1936
1937impl std::fmt::Debug for CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1938    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1939        f.write_str(self.as_str())
1940    }
1941}
1942impl serde::Serialize for CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1943    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1944    where
1945        S: serde::Serializer,
1946    {
1947        serializer.serialize_str(self.as_str())
1948    }
1949}
1950#[cfg(feature = "deserialize")]
1951impl<'de> serde::Deserialize<'de> for CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity {
1952    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1953        use std::str::FromStr;
1954        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1955        Self::from_str(&s).map_err(|_| {
1956            serde::de::Error::custom(
1957                "Unknown value for CreateTokenPersonUsCfpbDataEthnicityDetailsEthnicity",
1958            )
1959        })
1960    }
1961}
1962/// The persons race details
1963#[derive(Clone, Debug, serde::Serialize)]
1964pub struct CreateTokenPersonUsCfpbDataRaceDetails {
1965    /// The persons race.
1966    #[serde(skip_serializing_if = "Option::is_none")]
1967    pub race: Option<Vec<CreateTokenPersonUsCfpbDataRaceDetailsRace>>,
1968    /// Please specify your race, when other is selected.
1969    #[serde(skip_serializing_if = "Option::is_none")]
1970    pub race_other: Option<String>,
1971}
1972impl CreateTokenPersonUsCfpbDataRaceDetails {
1973    pub fn new() -> Self {
1974        Self { race: None, race_other: None }
1975    }
1976}
1977impl Default for CreateTokenPersonUsCfpbDataRaceDetails {
1978    fn default() -> Self {
1979        Self::new()
1980    }
1981}
1982/// The persons race.
1983#[derive(Clone, Eq, PartialEq)]
1984#[non_exhaustive]
1985pub enum CreateTokenPersonUsCfpbDataRaceDetailsRace {
1986    AfricanAmerican,
1987    AmericanIndianOrAlaskaNative,
1988    Asian,
1989    AsianIndian,
1990    BlackOrAfricanAmerican,
1991    Chinese,
1992    Ethiopian,
1993    Filipino,
1994    GuamanianOrChamorro,
1995    Haitian,
1996    Jamaican,
1997    Japanese,
1998    Korean,
1999    NativeHawaiian,
2000    NativeHawaiianOrOtherPacificIslander,
2001    Nigerian,
2002    OtherAsian,
2003    OtherBlackOrAfricanAmerican,
2004    OtherPacificIslander,
2005    PreferNotToAnswer,
2006    Samoan,
2007    Somali,
2008    Vietnamese,
2009    White,
2010    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2011    Unknown(String),
2012}
2013impl CreateTokenPersonUsCfpbDataRaceDetailsRace {
2014    pub fn as_str(&self) -> &str {
2015        use CreateTokenPersonUsCfpbDataRaceDetailsRace::*;
2016        match self {
2017            AfricanAmerican => "african_american",
2018            AmericanIndianOrAlaskaNative => "american_indian_or_alaska_native",
2019            Asian => "asian",
2020            AsianIndian => "asian_indian",
2021            BlackOrAfricanAmerican => "black_or_african_american",
2022            Chinese => "chinese",
2023            Ethiopian => "ethiopian",
2024            Filipino => "filipino",
2025            GuamanianOrChamorro => "guamanian_or_chamorro",
2026            Haitian => "haitian",
2027            Jamaican => "jamaican",
2028            Japanese => "japanese",
2029            Korean => "korean",
2030            NativeHawaiian => "native_hawaiian",
2031            NativeHawaiianOrOtherPacificIslander => "native_hawaiian_or_other_pacific_islander",
2032            Nigerian => "nigerian",
2033            OtherAsian => "other_asian",
2034            OtherBlackOrAfricanAmerican => "other_black_or_african_american",
2035            OtherPacificIslander => "other_pacific_islander",
2036            PreferNotToAnswer => "prefer_not_to_answer",
2037            Samoan => "samoan",
2038            Somali => "somali",
2039            Vietnamese => "vietnamese",
2040            White => "white",
2041            Unknown(v) => v,
2042        }
2043    }
2044}
2045
2046impl std::str::FromStr for CreateTokenPersonUsCfpbDataRaceDetailsRace {
2047    type Err = std::convert::Infallible;
2048    fn from_str(s: &str) -> Result<Self, Self::Err> {
2049        use CreateTokenPersonUsCfpbDataRaceDetailsRace::*;
2050        match s {
2051            "african_american" => Ok(AfricanAmerican),
2052            "american_indian_or_alaska_native" => Ok(AmericanIndianOrAlaskaNative),
2053            "asian" => Ok(Asian),
2054            "asian_indian" => Ok(AsianIndian),
2055            "black_or_african_american" => Ok(BlackOrAfricanAmerican),
2056            "chinese" => Ok(Chinese),
2057            "ethiopian" => Ok(Ethiopian),
2058            "filipino" => Ok(Filipino),
2059            "guamanian_or_chamorro" => Ok(GuamanianOrChamorro),
2060            "haitian" => Ok(Haitian),
2061            "jamaican" => Ok(Jamaican),
2062            "japanese" => Ok(Japanese),
2063            "korean" => Ok(Korean),
2064            "native_hawaiian" => Ok(NativeHawaiian),
2065            "native_hawaiian_or_other_pacific_islander" => Ok(NativeHawaiianOrOtherPacificIslander),
2066            "nigerian" => Ok(Nigerian),
2067            "other_asian" => Ok(OtherAsian),
2068            "other_black_or_african_american" => Ok(OtherBlackOrAfricanAmerican),
2069            "other_pacific_islander" => Ok(OtherPacificIslander),
2070            "prefer_not_to_answer" => Ok(PreferNotToAnswer),
2071            "samoan" => Ok(Samoan),
2072            "somali" => Ok(Somali),
2073            "vietnamese" => Ok(Vietnamese),
2074            "white" => Ok(White),
2075            v => Ok(Unknown(v.to_owned())),
2076        }
2077    }
2078}
2079impl std::fmt::Display for CreateTokenPersonUsCfpbDataRaceDetailsRace {
2080    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2081        f.write_str(self.as_str())
2082    }
2083}
2084
2085impl std::fmt::Debug for CreateTokenPersonUsCfpbDataRaceDetailsRace {
2086    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2087        f.write_str(self.as_str())
2088    }
2089}
2090impl serde::Serialize for CreateTokenPersonUsCfpbDataRaceDetailsRace {
2091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2092    where
2093        S: serde::Serializer,
2094    {
2095        serializer.serialize_str(self.as_str())
2096    }
2097}
2098#[cfg(feature = "deserialize")]
2099impl<'de> serde::Deserialize<'de> for CreateTokenPersonUsCfpbDataRaceDetailsRace {
2100    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2101        use std::str::FromStr;
2102        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2103        Ok(Self::from_str(&s).unwrap())
2104    }
2105}
2106/// The PII this token represents.
2107#[derive(Clone, Debug, serde::Serialize)]
2108pub struct CreateTokenPii {
2109    /// The `id_number` for the PII, in string form.
2110    #[serde(skip_serializing_if = "Option::is_none")]
2111    pub id_number: Option<String>,
2112}
2113impl CreateTokenPii {
2114    pub fn new() -> Self {
2115        Self { id_number: None }
2116    }
2117}
2118impl Default for CreateTokenPii {
2119    fn default() -> Self {
2120        Self::new()
2121    }
2122}
2123/// Creates a single-use token that represents a bank account’s details.
2124/// You can use this token with any v1 API method in place of a bank account dictionary.
2125/// You can only use this token once.
2126/// To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where <a href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> is `application`, which includes Custom accounts.
2127#[derive(Clone, Debug, serde::Serialize)]
2128pub struct CreateToken {
2129    inner: CreateTokenBuilder,
2130}
2131impl CreateToken {
2132    /// Construct a new `CreateToken`.
2133    pub fn new() -> Self {
2134        Self { inner: CreateTokenBuilder::new() }
2135    }
2136    /// Information for the account this token represents.
2137    pub fn account(mut self, account: impl Into<CreateTokenAccount>) -> Self {
2138        self.inner.account = Some(account.into());
2139        self
2140    }
2141    /// The bank account this token will represent.
2142    pub fn bank_account(mut self, bank_account: impl Into<CreateTokenBankAccount>) -> Self {
2143        self.inner.bank_account = Some(bank_account.into());
2144        self
2145    }
2146    /// The card this token will represent.
2147    /// If you also pass in a customer, the card must be the ID of a card belonging to the customer.
2148    /// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below.
2149    pub fn card(mut self, card: impl Into<CreateTokenCard>) -> Self {
2150        self.inner.card = Some(card.into());
2151        self
2152    }
2153    /// Create a token for the customer, which is owned by the application's account.
2154    /// You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication).
2155    /// Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods).
2156    pub fn customer(mut self, customer: impl Into<String>) -> Self {
2157        self.inner.customer = Some(customer.into());
2158        self
2159    }
2160    /// The updated CVC value this token represents.
2161    pub fn cvc_update(mut self, cvc_update: impl Into<CreateTokenCvcUpdate>) -> Self {
2162        self.inner.cvc_update = Some(cvc_update.into());
2163        self
2164    }
2165    /// Specifies which fields in the response should be expanded.
2166    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
2167        self.inner.expand = Some(expand.into());
2168        self
2169    }
2170    /// Information for the person this token represents.
2171    pub fn person(mut self, person: impl Into<CreateTokenPerson>) -> Self {
2172        self.inner.person = Some(person.into());
2173        self
2174    }
2175    /// The PII this token represents.
2176    pub fn pii(mut self, pii: impl Into<CreateTokenPii>) -> Self {
2177        self.inner.pii = Some(pii.into());
2178        self
2179    }
2180}
2181impl Default for CreateToken {
2182    fn default() -> Self {
2183        Self::new()
2184    }
2185}
2186impl CreateToken {
2187    /// Send the request and return the deserialized response.
2188    pub async fn send<C: StripeClient>(
2189        &self,
2190        client: &C,
2191    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
2192        self.customize().send(client).await
2193    }
2194
2195    /// Send the request and return the deserialized response, blocking until completion.
2196    pub fn send_blocking<C: StripeBlockingClient>(
2197        &self,
2198        client: &C,
2199    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
2200        self.customize().send_blocking(client)
2201    }
2202}
2203
2204impl StripeRequest for CreateToken {
2205    type Output = stripe_core::Token;
2206
2207    fn build(&self) -> RequestBuilder {
2208        RequestBuilder::new(StripeMethod::Post, "/tokens").form(&self.inner)
2209    }
2210}
2211
2212#[derive(Copy, Clone, Debug, serde::Serialize)]
2213pub struct DateOfBirthSpecs {
2214    /// The day of birth, between 1 and 31.
2215    pub day: i64,
2216    /// The month of birth, between 1 and 12.
2217    pub month: i64,
2218    /// The four-digit year of birth.
2219    pub year: i64,
2220}
2221impl DateOfBirthSpecs {
2222    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
2223        Self { day: day.into(), month: month.into(), year: year.into() }
2224    }
2225}
2226#[derive(Clone, Debug, serde::Serialize)]
2227pub struct PersonVerificationDocumentSpecs {
2228    /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.
2229    /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
2230    #[serde(skip_serializing_if = "Option::is_none")]
2231    pub back: Option<String>,
2232    /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.
2233    /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
2234    #[serde(skip_serializing_if = "Option::is_none")]
2235    pub front: Option<String>,
2236}
2237impl PersonVerificationDocumentSpecs {
2238    pub fn new() -> Self {
2239        Self { back: None, front: None }
2240    }
2241}
2242impl Default for PersonVerificationDocumentSpecs {
2243    fn default() -> Self {
2244        Self::new()
2245    }
2246}
2247#[derive(Clone, Debug, serde::Serialize)]
2248pub struct DocumentsParam {
2249    /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
2250    #[serde(skip_serializing_if = "Option::is_none")]
2251    pub files: Option<Vec<String>>,
2252}
2253impl DocumentsParam {
2254    pub fn new() -> Self {
2255        Self { files: None }
2256    }
2257}
2258impl Default for DocumentsParam {
2259    fn default() -> Self {
2260        Self::new()
2261    }
2262}
2263#[derive(Clone, Debug, serde::Serialize)]
2264pub struct PersonVerificationSpecs {
2265    /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
2266    #[serde(skip_serializing_if = "Option::is_none")]
2267    pub additional_document: Option<PersonVerificationDocumentSpecs>,
2268    /// An identifying document, either a passport or local ID card.
2269    #[serde(skip_serializing_if = "Option::is_none")]
2270    pub document: Option<PersonVerificationDocumentSpecs>,
2271}
2272impl PersonVerificationSpecs {
2273    pub fn new() -> Self {
2274        Self { additional_document: None, document: None }
2275    }
2276}
2277impl Default for PersonVerificationSpecs {
2278    fn default() -> Self {
2279        Self::new()
2280    }
2281}