/*
 * 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 SignUp {
	#[serde(rename = "object")]
	pub object: Object,
	#[serde(rename = "id")]
	pub id: String,
	#[serde(rename = "status")]
	pub status: Status,
	#[serde(rename = "required_fields", skip_serializing_if = "Option::is_none")]
	pub required_fields: Option<Vec<String>>,
	#[serde(rename = "optional_fields", skip_serializing_if = "Option::is_none")]
	pub optional_fields: Option<Vec<String>>,
	#[serde(rename = "missing_fields", skip_serializing_if = "Option::is_none")]
	pub missing_fields: Option<Vec<String>>,
	#[serde(rename = "unverified_fields", skip_serializing_if = "Option::is_none")]
	pub unverified_fields: Option<Vec<String>>,
	#[serde(rename = "verifications", skip_serializing_if = "Option::is_none")]
	pub verifications: Option<serde_json::Value>,
	#[serde(
		rename = "username",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub username: Option<Option<String>>,
	#[serde(
		rename = "email_address",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub email_address: Option<Option<String>>,
	#[serde(
		rename = "phone_number",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub phone_number: Option<Option<String>>,
	#[serde(
		rename = "web3_wallet",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub web3_wallet: Option<Option<String>>,
	#[serde(rename = "password_enabled")]
	pub password_enabled: bool,
	#[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 = "unsafe_metadata", skip_serializing_if = "Option::is_none")]
	pub unsafe_metadata: Option<serde_json::Value>,
	#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
	pub public_metadata: Option<serde_json::Value>,
	#[serde(rename = "custom_action")]
	pub custom_action: bool,
	#[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 = "created_session_id",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub created_session_id: Option<Option<String>>,
	#[serde(
		rename = "created_user_id",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub created_user_id: Option<Option<String>>,
	#[serde(rename = "abandon_at")]
	pub abandon_at: i32,
	#[serde(rename = "identification_requirements", skip_serializing_if = "Option::is_none")]
	pub identification_requirements: Option<Vec<Vec<String>>>,
	#[serde(rename = "missing_requirements", skip_serializing_if = "Option::is_none")]
	pub missing_requirements: Option<Vec<String>>,
	#[serde(
		rename = "email_address_verification",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub email_address_verification: Option<Option<serde_json::Value>>,
	#[serde(
		rename = "phone_number_verification",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub phone_number_verification: Option<Option<serde_json::Value>>,
	#[serde(
		rename = "external_account_strategy",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub external_account_strategy: Option<Option<String>>,
	#[serde(
		rename = "external_account_verification",
		default,
		with = "::serde_with::rust::double_option",
		skip_serializing_if = "Option::is_none"
	)]
	pub external_account_verification: Option<Option<serde_json::Value>>,
	#[serde(rename = "external_account", skip_serializing_if = "Option::is_none")]
	pub external_account: Option<serde_json::Value>,
}

impl SignUp {
	pub fn new(object: Object, id: String, status: Status, password_enabled: bool, custom_action: bool, abandon_at: i32) -> SignUp {
		SignUp {
			object,
			id,
			status,
			required_fields: None,
			optional_fields: None,
			missing_fields: None,
			unverified_fields: None,
			verifications: None,
			username: None,
			email_address: None,
			phone_number: None,
			web3_wallet: None,
			password_enabled,
			first_name: None,
			last_name: None,
			unsafe_metadata: None,
			public_metadata: None,
			custom_action,
			external_id: None,
			created_session_id: None,
			created_user_id: None,
			abandon_at,
			identification_requirements: None,
			missing_requirements: None,
			email_address_verification: None,
			phone_number_verification: None,
			external_account_strategy: None,
			external_account_verification: None,
			external_account: None,
		}
	}
}

///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
	#[serde(rename = "sign_up_attempt")]
	SignUpAttempt,
}

impl Default for Object {
	fn default() -> Object {
		Self::SignUpAttempt
	}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
	#[serde(rename = "missing_requirements")]
	MissingRequirements,
	#[serde(rename = "complete")]
	Complete,
	#[serde(rename = "abandoned")]
	Abandoned,
}

impl Default for Status {
	fn default() -> Status {
		Self::MissingRequirements
	}
}
