openai-client-base 0.16.1

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

/// UpdateSessionAgentParam : Model settings that can change after session creation.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UpdateSessionAgentParam {
    /// The model for subsequent turns. Omit to keep the current model.
    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    #[serde(rename = "reasoning", skip_serializing_if = "Option::is_none")]
    pub reasoning: Option<models::UpdateSessionReasoningParam>,
    #[serde(
        rename = "service_tier",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub service_tier: Option<Option<models::ServiceTierParam>>,
}

impl UpdateSessionAgentParam {
    /// Model settings that can change after session creation.
    pub fn new() -> UpdateSessionAgentParam {
        UpdateSessionAgentParam {
            model: None,
            reasoning: None,
            service_tier: None,
        }
    }
}

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