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};

/// ResumeSubagentCallItemResource : A request to resume a subagent.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ResumeSubagentCallItemResource {
    /// The item type. Always `resume_subagent_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 requesting the resume.
    #[serde(rename = "sender_agent_id")]
    pub sender_agent_id: String,
    /// The ID of the agent to resume.
    #[serde(rename = "recipient_agent_id")]
    pub recipient_agent_id: String,
}

impl ResumeSubagentCallItemResource {
    /// A request to resume a subagent.
    pub fn new(
        r#type: Type,
        id: String,
        turn_id: String,
        status: models::FunctionCallStatusResource,
        sender_agent_id: String,
        recipient_agent_id: String,
    ) -> ResumeSubagentCallItemResource {
        ResumeSubagentCallItemResource {
            r#type,
            id,
            turn_id,
            status,
            sender_agent_id,
            recipient_agent_id,
        }
    }
}
/// The item type. Always `resume_subagent_call`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "resume_subagent_call")]
    ResumeSubagentCall,
}

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

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