use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct RealtimeBetaClientEventInputAudioBufferClear {
#[serde(rename = "event_id", skip_serializing_if = "Option::is_none")]
pub event_id: Option<String>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl RealtimeBetaClientEventInputAudioBufferClear {
pub fn new(r#type: Type) -> RealtimeBetaClientEventInputAudioBufferClear {
RealtimeBetaClientEventInputAudioBufferClear {
event_id: None,
r#type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "input_audio_buffer.clear")]
InputAudioBufferClear,
}
impl Default for Type {
fn default() -> Type {
Self::InputAudioBufferClear
}
}
impl std::fmt::Display for RealtimeBetaClientEventInputAudioBufferClear {
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),
}
}
}