use serde::{Serialize, Deserialize};
///An object specifying information about the end user who will be linking their account.
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct LinkTokenCreateRequestUser {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub address: Option<serde_json::Value>,
///A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. It is currently used as a means of searching logs for the given user in the Plaid Dashboard.
pub client_user_id: String,
///To be provided in the format "yyyy-mm-dd". Can be used to prefill Link fields when used with Identity Verification.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub date_of_birth: Option<chrono::NaiveDate>,
///The user's email address. Can be used to prefill Link fields when used with [Identity Verification](https://www.plaid.com/docs/identity-verification).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
/**The date and time the email address was verified in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDThh:mm:ssZ`). This was previously an optional field used in the [returning user experience](https://plaid.com/docs/link/returning-user). This field is no longer required to enable the returning user experience.
Only pass a verification time for an email address that you have verified. If you have performed verification but don’t have the time, you may supply a signal value of the start of the UNIX epoch.
Example: `2020-01-01T00:00:00Z`*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub email_address_verified_time: Option<chrono::DateTime<chrono::Utc>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id_number: Option<serde_json::Value>,
///The user's full legal name, used for [micro-deposit based verification flows](https://plaid.com/docs/auth/coverage/). For a small number of customers on legacy flows, providing this field is required to enable micro-deposit-based flows. For all other customers, this field is optional. Providing the user's name in this field when using micro-deposit-based verification will streamline the end user experience, as the user will not be prompted to enter their name during the Link flow; Plaid will use the provided legal name instead.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub legal_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<serde_json::Value>,
///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. If supplied, will be used when applicable to prefill phone number fields in Link for the [returning user flow](https://www.plaid.com/docs/link/returning-user) and the [Identity Verification flow](https://www.plaid.com/docs/identity-verification).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub phone_number: Option<String>,
/**The date and time the phone number was verified in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDThh:mm:ssZ`). This was previously an optional field used in the [returning user experience](https://plaid.com/docs/link/returning-user). This field is no longer required to enable the returning user experience.
Only pass a verification time for a phone number that you have verified. If you have performed verification but don’t have the time, you may supply a signal value of the start of the UNIX epoch.
Example: `2020-01-01T00:00:00Z`*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub phone_number_verified_time: Option<chrono::DateTime<chrono::Utc>>,
///Deprecated and not currently used, use the `id_number` field instead.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ssn: Option<String>,
}
impl std::fmt::Display for LinkTokenCreateRequestUser {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}