44 lines
1.2 KiB
Rust
44 lines
1.2 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
/// The object type, which is always "model".
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
#[serde(rename_all = "snake_case")]
|
|
pub enum ModelObject {
|
|
Model,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct Model<Id> {
|
|
/// The model identifier, which can be referenced in the API endpoints.
|
|
pub id: Id,
|
|
|
|
/// The Unix timestamp (in seconds) when the model was created.
|
|
pub created: i64,
|
|
|
|
/// The object type, which is always "model".
|
|
pub object: ModelObject,
|
|
|
|
/// The organization that owns the model.
|
|
pub owned_by: String,
|
|
|
|
/// The date when the model will shut down, or null if not announced.
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub shutdown_date: Option<String>,
|
|
}
|
|
|
|
/// The object type, which is always "list".
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
#[serde(rename_all = "snake_case")]
|
|
pub enum ListObject {
|
|
List,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct ListModelsResponse<Id> {
|
|
/// The list of currently available models.
|
|
pub data: Vec<Model<Id>>,
|
|
|
|
/// The object type, which is always "list".
|
|
pub object: ListObject,
|
|
}
|