stripe/resources/generated/
person.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::ids::PersonId;
6use crate::params::{Expandable, Metadata, Object, Timestamp};
7use crate::resources::{Address, File};
8use serde::{Deserialize, Serialize};
9
10/// The resource representing a Stripe "Person".
11///
12/// For more details see <https://stripe.com/docs/api/persons/object>
13#[derive(Clone, Debug, Default, Deserialize, Serialize)]
14pub struct Person {
15    /// Unique identifier for the object.
16    pub id: PersonId,
17
18    /// The account the person is associated with.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub account: Option<String>,
21
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub additional_tos_acceptances: Option<PersonAdditionalTosAcceptances>,
24
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub address: Option<Address>,
27
28    /// The Kana variation of the person's address (Japan only).
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub address_kana: Option<Address>,
31
32    /// The Kanji variation of the person's address (Japan only).
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub address_kanji: Option<Address>,
35
36    /// Time at which the object was created.
37    ///
38    /// Measured in seconds since the Unix epoch.
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub created: Option<Timestamp>,
41
42    // Always true for a deleted object
43    #[serde(default)]
44    pub deleted: bool,
45
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub dob: Option<LegalEntityDob>,
48
49    /// The person's email address.
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub email: Option<String>,
52
53    /// The person's first name.
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub first_name: Option<String>,
56
57    /// The Kana variation of the person's first name (Japan only).
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub first_name_kana: Option<String>,
60
61    /// The Kanji variation of the person's first name (Japan only).
62    #[serde(skip_serializing_if = "Option::is_none")]
63    pub first_name_kanji: Option<String>,
64
65    /// A list of alternate names or aliases that the person is known by.
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub full_name_aliases: Option<Vec<String>>,
68
69    /// Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub future_requirements: Option<PersonFutureRequirements>,
72
73    /// The person's gender (International regulations require either "male" or "female").
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub gender: Option<String>,
76
77    /// Whether the person's `id_number` was provided.
78    ///
79    /// True if either the full ID number was provided or if only the required part of the ID number was provided (ex.
80    /// last four of an individual's SSN for the US indicated by `ssn_last_4_provided`).
81    #[serde(skip_serializing_if = "Option::is_none")]
82    pub id_number_provided: Option<bool>,
83
84    /// Whether the person's `id_number_secondary` was provided.
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub id_number_secondary_provided: Option<bool>,
87
88    /// The person's last name.
89    #[serde(skip_serializing_if = "Option::is_none")]
90    pub last_name: Option<String>,
91
92    /// The Kana variation of the person's last name (Japan only).
93    #[serde(skip_serializing_if = "Option::is_none")]
94    pub last_name_kana: Option<String>,
95
96    /// The Kanji variation of the person's last name (Japan only).
97    #[serde(skip_serializing_if = "Option::is_none")]
98    pub last_name_kanji: Option<String>,
99
100    /// The person's maiden name.
101    #[serde(skip_serializing_if = "Option::is_none")]
102    pub maiden_name: Option<String>,
103
104    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
105    ///
106    /// This can be useful for storing additional information about the object in a structured format.
107    #[serde(skip_serializing_if = "Option::is_none")]
108    pub metadata: Option<Metadata>,
109
110    /// The country where the person is a national.
111    #[serde(skip_serializing_if = "Option::is_none")]
112    pub nationality: Option<String>,
113
114    /// The person's phone number.
115    #[serde(skip_serializing_if = "Option::is_none")]
116    pub phone: Option<String>,
117
118    /// 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.
119    #[serde(skip_serializing_if = "Option::is_none")]
120    pub political_exposure: Option<PersonPoliticalExposure>,
121
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub registered_address: Option<Address>,
124
125    #[serde(skip_serializing_if = "Option::is_none")]
126    pub relationship: Option<PersonRelationship>,
127
128    /// Information about the requirements for this person, including what information needs to be collected, and by when.
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub requirements: Option<PersonRequirements>,
131
132    /// Whether the last four digits of the person's Social Security number have been provided (U.S.
133    ///
134    /// only).
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub ssn_last_4_provided: Option<bool>,
137
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub verification: Option<PersonVerification>,
140}
141
142impl Object for Person {
143    type Id = PersonId;
144    fn id(&self) -> Self::Id {
145        self.id.clone()
146    }
147    fn object(&self) -> &'static str {
148        "person"
149    }
150}
151
152#[derive(Clone, Debug, Default, Deserialize, Serialize)]
153pub struct LegalEntityDob {
154    /// The day of birth, between 1 and 31.
155    pub day: Option<i64>,
156
157    /// The month of birth, between 1 and 12.
158    pub month: Option<i64>,
159
160    /// The four-digit year of birth.
161    pub year: Option<i64>,
162}
163
164#[derive(Clone, Debug, Default, Deserialize, Serialize)]
165pub struct PersonVerification {
166    /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
167    #[serde(skip_serializing_if = "Option::is_none")]
168    pub additional_document: Option<PersonVerificationDocument>,
169
170    /// A user-displayable string describing the verification state for the person.
171    ///
172    /// For example, this may say "Provided identity information could not be verified".
173    #[serde(skip_serializing_if = "Option::is_none")]
174    pub details: Option<String>,
175
176    /// One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`.
177    ///
178    /// A machine-readable code specifying the verification state for the person.
179    #[serde(skip_serializing_if = "Option::is_none")]
180    pub details_code: Option<String>,
181
182    #[serde(skip_serializing_if = "Option::is_none")]
183    pub document: Option<PersonVerificationDocument>,
184
185    /// The state of verification for the person.
186    ///
187    /// Possible values are `unverified`, `pending`, or `verified`.
188    pub status: String,
189}
190
191#[derive(Clone, Debug, Default, Deserialize, Serialize)]
192pub struct PersonVerificationDocument {
193    /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.
194    pub back: Option<Expandable<File>>,
195
196    /// A user-displayable string describing the verification state of this document.
197    ///
198    /// For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read".
199    pub details: Option<String>,
200
201    /// One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`.
202    ///
203    /// A machine-readable code specifying the verification state for this document.
204    pub details_code: Option<String>,
205
206    /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.
207    pub front: Option<Expandable<File>>,
208}
209
210#[derive(Clone, Debug, Default, Deserialize, Serialize)]
211pub struct PersonAdditionalTosAcceptances {
212    pub account: PersonAdditionalTosAcceptance,
213}
214
215#[derive(Clone, Debug, Default, Deserialize, Serialize)]
216pub struct PersonAdditionalTosAcceptance {
217    /// The Unix timestamp marking when the legal guardian accepted the service agreement.
218    pub date: Option<Timestamp>,
219
220    /// The IP address from which the legal guardian accepted the service agreement.
221    pub ip: Option<String>,
222
223    /// The user agent of the browser from which the legal guardian accepted the service agreement.
224    pub user_agent: Option<String>,
225}
226
227#[derive(Clone, Debug, Default, Deserialize, Serialize)]
228pub struct PersonFutureRequirements {
229    /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead.
230    pub alternatives: Option<Vec<AccountRequirementsAlternative>>,
231
232    /// Fields that need to be collected to keep the person's account enabled.
233    ///
234    /// If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition.
235    pub currently_due: Vec<String>,
236
237    /// Fields that are `currently_due` and need to be collected again because validation or verification failed.
238    pub errors: Vec<AccountRequirementsError>,
239
240    /// Fields that need to be collected assuming all volume thresholds are reached.
241    ///
242    /// As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set.
243    pub eventually_due: Vec<String>,
244
245    /// Fields that weren't collected by the account's `requirements.current_deadline`.
246    ///
247    /// These fields need to be collected to enable the person's account.
248    /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`.
249    pub past_due: Vec<String>,
250
251    /// Fields that may become required depending on the results of verification or review.
252    ///
253    /// Will be an empty array unless an asynchronous verification is pending.
254    /// If verification fails, these fields move to `eventually_due` or `currently_due`.
255    pub pending_verification: Vec<String>,
256}
257
258#[derive(Clone, Debug, Default, Deserialize, Serialize)]
259pub struct AccountRequirementsAlternative {
260    /// Fields that can be provided to satisfy all fields in `original_fields_due`.
261    pub alternative_fields_due: Vec<String>,
262
263    /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`.
264    pub original_fields_due: Vec<String>,
265}
266
267#[derive(Clone, Debug, Default, Deserialize, Serialize)]
268pub struct AccountRequirementsError {
269    /// The code for the type of error.
270    pub code: AccountRequirementsErrorCode,
271
272    /// An informative message that indicates the error type and provides additional details about the error.
273    pub reason: String,
274
275    /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved.
276    pub requirement: String,
277}
278
279#[derive(Clone, Debug, Default, Deserialize, Serialize)]
280pub struct PersonRelationship {
281    /// Whether the person is a director of the account's legal entity.
282    ///
283    /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
284    pub director: Option<bool>,
285
286    /// Whether the person has significant responsibility to control, manage, or direct the organization.
287    pub executive: Option<bool>,
288
289    /// Whether the person is the legal guardian of the account's representative.
290    pub legal_guardian: Option<bool>,
291
292    /// Whether the person is an owner of the account’s legal entity.
293    pub owner: Option<bool>,
294
295    /// The percent owned by the person of the account's legal entity.
296    pub percent_ownership: Option<f64>,
297
298    /// Whether the person is authorized as the primary representative of the account.
299    ///
300    /// This is the person nominated by the business to provide information about themselves, and general information about the account.
301    /// There can only be one representative at any given time.
302    /// At the time the account is created, this person should be set to the person responsible for opening the account.
303    pub representative: Option<bool>,
304
305    /// The person's title (e.g., CEO, Support Engineer).
306    pub title: Option<String>,
307}
308
309#[derive(Clone, Debug, Default, Deserialize, Serialize)]
310pub struct PersonRequirements {
311    /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead.
312    pub alternatives: Option<Vec<AccountRequirementsAlternative>>,
313
314    /// Fields that need to be collected to keep the person's account enabled.
315    ///
316    /// If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
317    pub currently_due: Vec<String>,
318
319    /// Fields that are `currently_due` and need to be collected again because validation or verification failed.
320    pub errors: Vec<AccountRequirementsError>,
321
322    /// Fields that need to be collected assuming all volume thresholds are reached.
323    ///
324    /// As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set.
325    pub eventually_due: Vec<String>,
326
327    /// Fields that weren't collected by the account's `current_deadline`.
328    ///
329    /// These fields need to be collected to enable the person's account.
330    pub past_due: Vec<String>,
331
332    /// Fields that may become required depending on the results of verification or review.
333    ///
334    /// Will be an empty array unless an asynchronous verification is pending.
335    /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`.
336    pub pending_verification: Vec<String>,
337}
338
339/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field.
340#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
341#[serde(rename_all = "snake_case")]
342pub enum AccountRequirementsErrorCode {
343    InvalidAddressCityStatePostalCode,
344    InvalidAddressHighwayContractBox,
345    InvalidAddressPrivateMailbox,
346    InvalidBusinessProfileName,
347    InvalidBusinessProfileNameDenylisted,
348    InvalidCompanyNameDenylisted,
349    InvalidDobAgeOverMaximum,
350    #[serde(rename = "invalid_dob_age_under_18")]
351    InvalidDobAgeUnder18,
352    InvalidDobAgeUnderMinimum,
353    InvalidProductDescriptionLength,
354    InvalidProductDescriptionUrlMatch,
355    InvalidRepresentativeCountry,
356    InvalidStatementDescriptorBusinessMismatch,
357    InvalidStatementDescriptorDenylisted,
358    InvalidStatementDescriptorLength,
359    InvalidStatementDescriptorPrefixDenylisted,
360    InvalidStatementDescriptorPrefixMismatch,
361    InvalidStreetAddress,
362    InvalidTaxId,
363    InvalidTaxIdFormat,
364    InvalidTosAcceptance,
365    InvalidUrlDenylisted,
366    InvalidUrlFormat,
367    InvalidUrlLength,
368    InvalidUrlWebPresenceDetected,
369    InvalidUrlWebsiteBusinessInformationMismatch,
370    InvalidUrlWebsiteEmpty,
371    InvalidUrlWebsiteInaccessible,
372    InvalidUrlWebsiteInaccessibleGeoblocked,
373    InvalidUrlWebsiteInaccessiblePasswordProtected,
374    InvalidUrlWebsiteIncomplete,
375    InvalidUrlWebsiteIncompleteCancellationPolicy,
376    InvalidUrlWebsiteIncompleteCustomerServiceDetails,
377    InvalidUrlWebsiteIncompleteLegalRestrictions,
378    InvalidUrlWebsiteIncompleteRefundPolicy,
379    InvalidUrlWebsiteIncompleteReturnPolicy,
380    InvalidUrlWebsiteIncompleteTermsAndConditions,
381    InvalidUrlWebsiteIncompleteUnderConstruction,
382    InvalidUrlWebsiteOther,
383    InvalidValueOther,
384    VerificationDirectorsMismatch,
385    VerificationDocumentAddressMismatch,
386    VerificationDocumentAddressMissing,
387    VerificationDocumentCorrupt,
388    VerificationDocumentCountryNotSupported,
389    VerificationDocumentDirectorsMismatch,
390    VerificationDocumentDobMismatch,
391    VerificationDocumentDuplicateType,
392    VerificationDocumentExpired,
393    VerificationDocumentFailedCopy,
394    VerificationDocumentFailedGreyscale,
395    VerificationDocumentFailedOther,
396    VerificationDocumentFailedTestMode,
397    VerificationDocumentFraudulent,
398    VerificationDocumentIdNumberMismatch,
399    VerificationDocumentIdNumberMissing,
400    VerificationDocumentIncomplete,
401    VerificationDocumentInvalid,
402    VerificationDocumentIssueOrExpiryDateMissing,
403    VerificationDocumentManipulated,
404    VerificationDocumentMissingBack,
405    VerificationDocumentMissingFront,
406    VerificationDocumentNameMismatch,
407    VerificationDocumentNameMissing,
408    VerificationDocumentNationalityMismatch,
409    VerificationDocumentNotReadable,
410    VerificationDocumentNotSigned,
411    VerificationDocumentNotUploaded,
412    VerificationDocumentPhotoMismatch,
413    VerificationDocumentTooLarge,
414    VerificationDocumentTypeNotSupported,
415    VerificationExtraneousDirectors,
416    VerificationFailedAddressMatch,
417    VerificationFailedBusinessIecNumber,
418    VerificationFailedDocumentMatch,
419    VerificationFailedIdNumberMatch,
420    VerificationFailedKeyedIdentity,
421    VerificationFailedKeyedMatch,
422    VerificationFailedNameMatch,
423    VerificationFailedOther,
424    VerificationFailedResidentialAddress,
425    VerificationFailedTaxIdMatch,
426    VerificationFailedTaxIdNotIssued,
427    VerificationMissingDirectors,
428    VerificationMissingExecutives,
429    VerificationMissingOwners,
430    VerificationRequiresAdditionalMemorandumOfAssociations,
431}
432
433impl AccountRequirementsErrorCode {
434    pub fn as_str(self) -> &'static str {
435        match self {
436            AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code",
437            AccountRequirementsErrorCode::InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box",
438            AccountRequirementsErrorCode::InvalidAddressPrivateMailbox => "invalid_address_private_mailbox",
439            AccountRequirementsErrorCode::InvalidBusinessProfileName => "invalid_business_profile_name",
440            AccountRequirementsErrorCode::InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted",
441            AccountRequirementsErrorCode::InvalidCompanyNameDenylisted => "invalid_company_name_denylisted",
442            AccountRequirementsErrorCode::InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum",
443            AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18",
444            AccountRequirementsErrorCode::InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum",
445            AccountRequirementsErrorCode::InvalidProductDescriptionLength => "invalid_product_description_length",
446            AccountRequirementsErrorCode::InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match",
447            AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country",
448            AccountRequirementsErrorCode::InvalidStatementDescriptorBusinessMismatch => "invalid_statement_descriptor_business_mismatch",
449            AccountRequirementsErrorCode::InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted",
450            AccountRequirementsErrorCode::InvalidStatementDescriptorLength => "invalid_statement_descriptor_length",
451            AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixDenylisted => "invalid_statement_descriptor_prefix_denylisted",
452            AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixMismatch => "invalid_statement_descriptor_prefix_mismatch",
453            AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address",
454            AccountRequirementsErrorCode::InvalidTaxId => "invalid_tax_id",
455            AccountRequirementsErrorCode::InvalidTaxIdFormat => "invalid_tax_id_format",
456            AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance",
457            AccountRequirementsErrorCode::InvalidUrlDenylisted => "invalid_url_denylisted",
458            AccountRequirementsErrorCode::InvalidUrlFormat => "invalid_url_format",
459            AccountRequirementsErrorCode::InvalidUrlLength => "invalid_url_length",
460            AccountRequirementsErrorCode::InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected",
461            AccountRequirementsErrorCode::InvalidUrlWebsiteBusinessInformationMismatch => "invalid_url_website_business_information_mismatch",
462            AccountRequirementsErrorCode::InvalidUrlWebsiteEmpty => "invalid_url_website_empty",
463            AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible",
464            AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessibleGeoblocked => "invalid_url_website_inaccessible_geoblocked",
465            AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessiblePasswordProtected => "invalid_url_website_inaccessible_password_protected",
466            AccountRequirementsErrorCode::InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete",
467            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCancellationPolicy => "invalid_url_website_incomplete_cancellation_policy",
468            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCustomerServiceDetails => "invalid_url_website_incomplete_customer_service_details",
469            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteLegalRestrictions => "invalid_url_website_incomplete_legal_restrictions",
470            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteRefundPolicy => "invalid_url_website_incomplete_refund_policy",
471            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteReturnPolicy => "invalid_url_website_incomplete_return_policy",
472            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteTermsAndConditions => "invalid_url_website_incomplete_terms_and_conditions",
473            AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteUnderConstruction => "invalid_url_website_incomplete_under_construction",
474            AccountRequirementsErrorCode::InvalidUrlWebsiteOther => "invalid_url_website_other",
475            AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other",
476            AccountRequirementsErrorCode::VerificationDirectorsMismatch => "verification_directors_mismatch",
477            AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch",
478            AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing",
479            AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt",
480            AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported",
481            AccountRequirementsErrorCode::VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch",
482            AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch",
483            AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type",
484            AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired",
485            AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy",
486            AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale",
487            AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other",
488            AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode",
489            AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent",
490            AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch",
491            AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing",
492            AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete",
493            AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid",
494            AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing",
495            AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated",
496            AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back",
497            AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front",
498            AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch",
499            AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing",
500            AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch",
501            AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable",
502            AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed",
503            AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded",
504            AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch",
505            AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large",
506            AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported",
507            AccountRequirementsErrorCode::VerificationExtraneousDirectors => "verification_extraneous_directors",
508            AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match",
509            AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number",
510            AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match",
511            AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match",
512            AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity",
513            AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match",
514            AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match",
515            AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other",
516            AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address",
517            AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match",
518            AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued",
519            AccountRequirementsErrorCode::VerificationMissingDirectors => "verification_missing_directors",
520            AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives",
521            AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners",
522            AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations",
523        }
524    }
525}
526
527impl AsRef<str> for AccountRequirementsErrorCode {
528    fn as_ref(&self) -> &str {
529        self.as_str()
530    }
531}
532
533impl std::fmt::Display for AccountRequirementsErrorCode {
534    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
535        self.as_str().fmt(f)
536    }
537}
538impl std::default::Default for AccountRequirementsErrorCode {
539    fn default() -> Self {
540        Self::InvalidAddressCityStatePostalCode
541    }
542}
543
544/// An enum representing the possible values of an `Person`'s `political_exposure` field.
545#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
546#[serde(rename_all = "snake_case")]
547pub enum PersonPoliticalExposure {
548    Existing,
549    None,
550}
551
552impl PersonPoliticalExposure {
553    pub fn as_str(self) -> &'static str {
554        match self {
555            PersonPoliticalExposure::Existing => "existing",
556            PersonPoliticalExposure::None => "none",
557        }
558    }
559}
560
561impl AsRef<str> for PersonPoliticalExposure {
562    fn as_ref(&self) -> &str {
563        self.as_str()
564    }
565}
566
567impl std::fmt::Display for PersonPoliticalExposure {
568    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
569        self.as_str().fmt(f)
570    }
571}
572impl std::default::Default for PersonPoliticalExposure {
573    fn default() -> Self {
574        Self::Existing
575    }
576}