/*
 * 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 Client {
	/// String representing the object's type. Objects of the same type share the same value.
	#[serde(rename = "object")]
	pub object: Object,
	/// String representing the identifier of the session.
	#[serde(rename = "id")]
	pub id: String,
	#[serde(rename = "session_ids")]
	pub session_ids: Vec<String>,
	#[serde(rename = "sessions")]
	pub sessions: Vec<crate::models::Session>,
	#[serde(rename = "sign_in_attempt_id", deserialize_with = "Option::deserialize")]
	pub sign_in_attempt_id: Option<String>,
	#[serde(rename = "sign_up_attempt_id", deserialize_with = "Option::deserialize")]
	pub sign_up_attempt_id: Option<String>,
	#[serde(rename = "sign_in_id", deserialize_with = "Option::deserialize")]
	pub sign_in_id: Option<String>,
	#[serde(rename = "sign_up_id", deserialize_with = "Option::deserialize")]
	pub sign_up_id: Option<String>,
	/// Last active session_id.
	#[serde(rename = "last_active_session_id", deserialize_with = "Option::deserialize")]
	pub last_active_session_id: Option<String>,
	/// Unix timestamp of last update.
	#[serde(rename = "updated_at")]
	pub updated_at: i64,
	/// Unix timestamp of creation.
	#[serde(rename = "created_at")]
	pub created_at: i64,
}

impl Client {
	pub fn new(
		object: Object,
		id: String,
		session_ids: Vec<String>,
		sessions: Vec<crate::models::Session>,
		sign_in_attempt_id: Option<String>,
		sign_up_attempt_id: Option<String>,
		sign_in_id: Option<String>,
		sign_up_id: Option<String>,
		last_active_session_id: Option<String>,
		updated_at: i64,
		created_at: i64,
	) -> Client {
		Client {
			object,
			id,
			session_ids,
			sessions,
			sign_in_attempt_id,
			sign_up_attempt_id,
			sign_in_id,
			sign_up_id,
			last_active_session_id,
			updated_at,
			created_at,
		}
	}
}

/// 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 = "client")]
	Client,
}

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