use crate::one_api::send_messages::{GatewayError, MessageResponse};
use serde::Deserialize;
#[derive(Deserialize, Debug)]
pub struct Response {
pub error: Option<GatewayError>,
messages: Option<Vec<MessageResponse>>,
}
impl Response {
pub fn messages(&self) -> Vec<MessageResponse> {
match self.messages.clone() {
Some(message_responses) => message_responses,
None => Vec::new(),
}
}
pub fn is_error(&self) -> bool {
self.error.is_some()
}
}