use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct AutoCodeInterpreterToolParam {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "file_ids", skip_serializing_if = "Option::is_none")]
pub file_ids: Option<Vec<String>>,
#[serde(
rename = "memory_limit",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub memory_limit: Option<Option<models::ContainerMemoryLimit>>,
#[serde(rename = "network_policy", skip_serializing_if = "Option::is_none")]
pub network_policy: Option<Box<models::CreateContainerBodyNetworkPolicy>>,
}
impl AutoCodeInterpreterToolParam {
pub fn new(r#type: Type) -> AutoCodeInterpreterToolParam {
AutoCodeInterpreterToolParam {
r#type,
file_ids: None,
memory_limit: None,
network_policy: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "auto")]
Auto,
}
impl Default for Type {
fn default() -> Type {
Self::Auto
}
}
impl std::fmt::Display for AutoCodeInterpreterToolParam {
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),
}
}
}