use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct FunctionShellCallOutputContentParam {
#[serde(rename = "stdout")]
pub stdout: String,
#[serde(rename = "stderr")]
pub stderr: String,
#[serde(rename = "outcome")]
pub outcome: Box<models::FunctionShellCallOutputOutcomeParam>,
}
impl FunctionShellCallOutputContentParam {
pub fn new(
stdout: String,
stderr: String,
outcome: models::FunctionShellCallOutputOutcomeParam,
) -> FunctionShellCallOutputContentParam {
FunctionShellCallOutputContentParam {
stdout,
stderr,
outcome: Box::new(outcome),
}
}
}
impl std::fmt::Display for FunctionShellCallOutputContentParam {
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),
}
}
}