#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::string::String;
#[cfg(feature = "std")]
use std::string::String;
#[cfg(any(feature = "alloc", feature = "std"))]
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg(any(feature = "alloc", feature = "std"))]
pub struct AuthResponse {
pub code: Option<String>,
pub id_token: Option<String>,
pub state: Option<String>,
pub user: Option<String>,
pub error: Option<String>,
}
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg(any(feature = "alloc", feature = "std"))]
pub struct User {
pub email: Option<String>,
pub name: Option<Name>,
}
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg(any(feature = "alloc", feature = "std"))]
pub struct Name {
#[serde(rename = "firstName")]
pub first_name: Option<String>,
#[serde(rename = "lastName")]
pub last_name: Option<String>,
}
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg(any(feature = "alloc", feature = "std"))]
pub struct IdTokenClaims {
pub iss: Option<String>,
pub aud: Option<String>,
pub exp: Option<u64>,
pub iat: Option<u64>,
pub sub: Option<String>,
pub c_hash: Option<String>,
pub email: Option<String>,
pub email_verified: Option<String>,
pub is_private_email: Option<String>,
pub auth_time: Option<u64>,
}
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg(any(feature = "alloc", feature = "std"))]
pub struct ValidateAuthCodeRequest {
pub client_id: String,
pub client_secret: String,
pub grant_type: String,
pub code: String,
pub redirect_uri: String,
}
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[cfg(any(feature = "alloc", feature = "std"))]
pub struct TokenResponse {
pub access_token: Option<String>,
pub expires_in: Option<u64>,
pub id_token: Option<String>,
pub refresh_token: Option<String>,
pub token_type: Option<String>,
pub error: Option<String>,
}