openai-client-base 0.16.0

Auto-generated Rust client for the OpenAI API
/*
 * OpenAI API
 *
 * The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
 *
 * The version of the OpenAPI document: 2.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// WaitForSubagentsCallItemResource : A request to wait for one or more subagents.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct WaitForSubagentsCallItemResource {
    /// The item type. Always `wait_for_subagents_call`.
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The ID of the tool call item.
    #[serde(rename = "id")]
    pub id: String,
    /// The ID of the turn that contains this item.
    #[serde(rename = "turn_id")]
    pub turn_id: String,
    #[serde(rename = "status")]
    pub status: models::FunctionCallStatusResource,
    /// The ID of the agent waiting for results.
    #[serde(rename = "sender_agent_id")]
    pub sender_agent_id: String,
    /// The IDs of the agents to wait for.
    #[serde(rename = "recipient_agent_ids")]
    pub recipient_agent_ids: Vec<String>,
}

impl WaitForSubagentsCallItemResource {
    /// A request to wait for one or more subagents.
    pub fn new(
        r#type: Type,
        id: String,
        turn_id: String,
        status: models::FunctionCallStatusResource,
        sender_agent_id: String,
        recipient_agent_ids: Vec<String>,
    ) -> WaitForSubagentsCallItemResource {
        WaitForSubagentsCallItemResource {
            r#type,
            id,
            turn_id,
            status,
            sender_agent_id,
            recipient_agent_ids,
        }
    }
}
/// The item type. Always `wait_for_subagents_call`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "wait_for_subagents_call")]
    WaitForSubagentsCall,
}

impl Default for Type {
    fn default() -> Type {
        Self::WaitForSubagentsCall
    }
}

impl std::fmt::Display for WaitForSubagentsCallItemResource {
    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),
        }
    }
}