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