use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ErrorResponse2 {
#[serde(rename = "error")]
pub error: models::ErrorBodyResource,
}
impl ErrorResponse2 {
pub fn new(error: models::ErrorBodyResource) -> ErrorResponse2 {
ErrorResponse2 { error }
}
}
impl std::fmt::Display for ErrorResponse2 {
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),
}
}
}