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