use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct RealtimeBetaServerEventResponseMcpCallCompleted {
#[serde(rename = "event_id")]
pub event_id: String,
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "output_index")]
pub output_index: i32,
#[serde(rename = "item_id")]
pub item_id: String,
}
impl RealtimeBetaServerEventResponseMcpCallCompleted {
pub fn new(
event_id: String,
r#type: Type,
output_index: i32,
item_id: String,
) -> RealtimeBetaServerEventResponseMcpCallCompleted {
RealtimeBetaServerEventResponseMcpCallCompleted {
event_id,
r#type,
output_index,
item_id,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "response.mcp_call.completed")]
ResponseMcpCallCompleted,
}
impl Default for Type {
fn default() -> Type {
Self::ResponseMcpCallCompleted
}
}
impl std::fmt::Display for RealtimeBetaServerEventResponseMcpCallCompleted {
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),
}
}
}