use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[schemars(rename = "client_objectiveai_mcp.client_response.Response")]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum Response {
#[schemars(title = "client_objectiveai_mcp.client_response.Response.Ok")]
Ok {
id: String,
},
#[schemars(title = "client_objectiveai_mcp.client_response.Response.Error")]
Error {
id: String,
code: u16,
message: serde_json::Value,
},
}
impl Response {
pub fn id(&self) -> &str {
match self {
Response::Ok { id } => id,
Response::Error { id, .. } => id,
}
}
}