use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct RealtimeMcpListTools {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "server_label")]
pub server_label: String,
#[serde(rename = "tools")]
pub tools: Vec<models::McpListToolsTool>,
}
impl RealtimeMcpListTools {
pub fn new(
r#type: Type,
server_label: String,
tools: Vec<models::McpListToolsTool>,
) -> RealtimeMcpListTools {
RealtimeMcpListTools {
r#type,
id: None,
server_label,
tools,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "mcp_list_tools")]
McpListTools,
}
impl Default for Type {
fn default() -> Type {
Self::McpListTools
}
}
impl std::fmt::Display for RealtimeMcpListTools {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}