/*
 * Clerk Backend API
 *
 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
 *
 * The version of the OpenAPI document: v1
 * Contact: support@clerk.com
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct User {
	#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
	pub id: Option<String>,
	/// String representing the object's type. Objects of the same type share the same value.
	#[serde(rename = "object", skip_serializing_if = "Option::is_none")]
	pub object: Option<Object>,
	#[serde(
		rename = "external_id",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub external_id: Option<Option<String>>,
	#[serde(
		rename = "primary_email_address_id",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub primary_email_address_id: Option<Option<String>>,
	#[serde(
		rename = "primary_phone_number_id",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub primary_phone_number_id: Option<Option<String>>,
	#[serde(
		rename = "primary_web3_wallet_id",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub primary_web3_wallet_id: Option<Option<String>>,
	#[serde(
		rename = "username",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub username: Option<Option<String>>,
	#[serde(
		rename = "first_name",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub first_name: Option<Option<String>>,
	#[serde(
		rename = "last_name",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub last_name: Option<Option<String>>,
	#[serde(rename = "profile_image_url", skip_serializing_if = "Option::is_none")]
	pub profile_image_url: Option<String>,
	#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
	pub public_metadata: Option<serde_json::Value>,
	#[serde(
		rename = "private_metadata",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub private_metadata: Option<Option<serde_json::Value>>,
	#[serde(rename = "unsafe_metadata", skip_serializing_if = "Option::is_none")]
	pub unsafe_metadata: Option<serde_json::Value>,
	#[serde(
		rename = "gender",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub gender: Option<Option<String>>,
	#[serde(
		rename = "birthday",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub birthday: Option<Option<String>>,
	#[serde(rename = "email_addresses", skip_serializing_if = "Option::is_none")]
	pub email_addresses: Option<Vec<crate::models::EmailAddress>>,
	#[serde(rename = "phone_numbers", skip_serializing_if = "Option::is_none")]
	pub phone_numbers: Option<Vec<crate::models::PhoneNumber>>,
	#[serde(rename = "web3_wallets", skip_serializing_if = "Option::is_none")]
	pub web3_wallets: Option<Vec<crate::models::Web3Wallet>>,
	#[serde(rename = "password_enabled", skip_serializing_if = "Option::is_none")]
	pub password_enabled: Option<bool>,
	#[serde(rename = "two_factor_enabled", skip_serializing_if = "Option::is_none")]
	pub two_factor_enabled: Option<bool>,
	#[serde(rename = "totp_enabled", skip_serializing_if = "Option::is_none")]
	pub totp_enabled: Option<bool>,
	#[serde(rename = "backup_code_enabled", skip_serializing_if = "Option::is_none")]
	pub backup_code_enabled: Option<bool>,
	#[serde(rename = "external_accounts", skip_serializing_if = "Option::is_none")]
	pub external_accounts: Option<Vec<serde_json::Value>>,
	/// Unix timestamp of last sign-in.
	#[serde(
		rename = "last_sign_in_at",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub last_sign_in_at: Option<Option<i64>>,
	/// Flag to denote whether user is banned or not.
	#[serde(rename = "banned", skip_serializing_if = "Option::is_none")]
	pub banned: Option<bool>,
	/// Unix timestamp of last update.
	#[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
	pub updated_at: Option<i64>,
	/// Unix timestamp of creation.
	#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
	pub created_at: Option<i64>,
}

impl User {
	pub fn new() -> User {
		User {
			id: None,
			object: None,
			external_id: None,
			primary_email_address_id: None,
			primary_phone_number_id: None,
			primary_web3_wallet_id: None,
			username: None,
			first_name: None,
			last_name: None,
			profile_image_url: None,
			public_metadata: None,
			private_metadata: None,
			unsafe_metadata: None,
			gender: None,
			birthday: None,
			email_addresses: None,
			phone_numbers: None,
			web3_wallets: None,
			password_enabled: None,
			two_factor_enabled: None,
			totp_enabled: None,
			backup_code_enabled: None,
			external_accounts: None,
			last_sign_in_at: None,
			banned: None,
			updated_at: None,
			created_at: None,
		}
	}
}

/// String representing the object's type. Objects of the same type share the same value.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
	#[serde(rename = "user")]
	User,
}

impl Default for Object {
	fn default() -> Object {
		Self::User
	}
}
