use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct LiveResponsesDelegationParam {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "responses")]
pub responses: Box<models::LiveResponsesDelegationSettingsInputParam>,
}
impl LiveResponsesDelegationParam {
pub fn new(
r#type: Type,
responses: models::LiveResponsesDelegationSettingsInputParam,
) -> LiveResponsesDelegationParam {
LiveResponsesDelegationParam {
r#type,
responses: Box::new(responses),
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "responses")]
Responses,
}
impl Default for Type {
fn default() -> Type {
Self::Responses
}
}
impl std::fmt::Display for LiveResponsesDelegationParam {
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),
}
}
}