use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct RealtimeBetaServerEventErrorError {
#[serde(rename = "type")]
pub r#type: String,
#[serde(
rename = "code",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub code: Option<Option<String>>,
#[serde(rename = "message")]
pub message: String,
#[serde(
rename = "param",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub param: Option<Option<String>>,
#[serde(
rename = "event_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub event_id: Option<Option<String>>,
}
impl RealtimeBetaServerEventErrorError {
pub fn new(r#type: String, message: String) -> RealtimeBetaServerEventErrorError {
RealtimeBetaServerEventErrorError {
r#type,
code: None,
message,
param: None,
event_id: None,
}
}
}
impl std::fmt::Display for RealtimeBetaServerEventErrorError {
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),
}
}
}