/*
 * 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 Otp {
	#[serde(rename = "status")]
	pub status: Status,
	#[serde(rename = "strategy")]
	pub strategy: Strategy,
	#[serde(rename = "attempts")]
	pub attempts: i32,
	#[serde(rename = "expire_at")]
	pub expire_at: i32,
}

impl Otp {
	pub fn new(status: Status, strategy: Strategy, attempts: i32, expire_at: i32) -> Otp {
		Otp {
			status,
			strategy,
			attempts,
			expire_at,
		}
	}
}

///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
	#[serde(rename = "unverified")]
	Unverified,
	#[serde(rename = "verified")]
	Verified,
	#[serde(rename = "failed")]
	Failed,
	#[serde(rename = "expired")]
	Expired,
}

impl Default for Status {
	fn default() -> Status {
		Self::Unverified
	}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Strategy {
	#[serde(rename = "phone_code")]
	PhoneCode,
	#[serde(rename = "email_code")]
	EmailCode,
}

impl Default for Strategy {
	fn default() -> Strategy {
		Self::PhoneCode
	}
}
