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

/// LiveClientConfigParam : Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct LiveClientConfigParam {
    #[serde(rename = "data_channel")]
    pub data_channel: Box<models::LiveDataChannelConfigParam>,
}

impl LiveClientConfigParam {
    /// Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.
    pub fn new(data_channel: models::LiveDataChannelConfigParam) -> LiveClientConfigParam {
        LiveClientConfigParam {
            data_channel: Box::new(data_channel),
        }
    }
}

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