1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use serde::{Deserialize, Serialize};

pub const HEADER_API_KEY: &str = "api-key";

#[derive(Serialize, Deserialize)]
pub struct Question {
    pub os: String,
    pub shell: String,
    pub prompt: String,
    pub explain: bool,
}

#[derive(Serialize, Deserialize)]
pub struct Answer {
    pub result: String,
    pub error: Option<Error>,
}

#[derive(Serialize, Deserialize)]
pub struct Error {
    pub message: String,
    pub code: Option<u16>, // You can include an error code if applicable
}