use serde::{Deserialize, Serialize};
use crate::spec::admin::project_service_accounts::ProjectServiceAccount;
use crate::spec::admin::project_users::ProjectUser;
#[derive(Debug, Serialize, Deserialize)]
pub struct ProjectApiKey {
pub object: String,
pub redacted_value: String,
pub name: String,
pub created_at: u64,
pub id: String,
pub owner: ProjectApiKeyOwner,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename = "snake_case")]
pub enum ProjectApiKeyOwnerType {
User,
ServiceAccount,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ProjectApiKeyOwner {
pub kind: ProjectApiKeyOwnerType,
pub user: Option<ProjectUser>,
pub service_account: Option<ProjectServiceAccount>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ProjectApiKeyListResponse {
pub object: String,
pub data: Vec<ProjectApiKey>,
pub first_id: Option<String>,
pub last_id: Option<String>,
pub has_more: bool,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ProjectApiKeyDeleteResponse {
pub object: String,
pub id: String,
pub deleted: bool,
}