use super::ClientDataOtherKeys;
use saa_schema::saa_type;
use saa_common::String;


/// The client data object defined by the WebAuthn standard.
#[cfg_attr(not(feature = "cosmwasm"), derive(serde::Serialize, serde::Deserialize))]
#[saa_type(no_deny)]
#[non_exhaustive]
pub struct ClientData {
    /// Type of the client data. The contract expects "webauthn.get"
    #[serde(rename = "type")]
    pub ty: String,
    
    /// Base64url encoded challenge string
    pub challenge: String,
    
    /// Origin of the client where the passkey was created
    pub origin: String,
    
    /// Whether the passkey was registed with a cross-origin device 
    #[serde(rename = "crossOrigin")]
    pub cross_origin: bool,

    /// Injecting other keys into the client data
    #[serde(flatten, skip_serializing_if = "Option::is_none")]
    // #[cfg_attr(feature = "cosmwasm", serde(flatten, skip_serializing_if = "Option::is_none"))]
    pub other_keys : Option<ClientDataOtherKeys>,
}


