use serde::{Deserialize, Serialize};
use crate::elong::error::ElongError;
use super::api_response::{BaseResponse, ElongResponse};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct IncrStateResponse {
pub states: Vec<State>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct State {
pub last_id: i64,
pub time: String,
pub hotel_id: Option<String>,
pub hotel_code: Option<String>,
pub room_id: Option<String>,
pub room_type_id: Option<String>,
pub rate_plan_id: Option<String>,
pub name: Option<String>,
pub status: Option<bool>,
pub state_type: String,
}
impl BaseResponse for ElongResponse<IncrStateResponse> {
fn from_json(json: String) -> Result<Self, ElongError> {
log::debug!("ElongResponse<IncrIdResponse> json: {}", json);
Ok(serde_json::from_str(&json)?)
}
}