use serde::{Deserialize, Serialize};
use crate::tapo_vendor::error::Error;
use crate::tapo_vendor::responses::{DecodableResultExt, TapoResponseExt};
use crate::tapo_vendor::utils::{bool_from_int_or_bool, option_bool_from_int_or_bool};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(any(), pyo3::prelude::pyclass(from_py_object, get_all))]
#[allow(missing_docs)]
pub struct DeviceInfoCameraResult {
pub avatar: String,
#[serde(alias = "dev_id")]
pub device_id: String,
pub device_info: String,
pub device_name: String,
#[serde(alias = "sw_version")]
pub fw_ver: String,
#[serde(deserialize_with = "bool_from_int_or_bool")]
pub has_set_location_info: bool,
pub hw_id: String,
#[serde(alias = "hw_version")]
pub hw_ver: String,
pub latitude: Option<i64>,
pub longitude: Option<i64>,
pub mac: String,
#[serde(alias = "device_model")]
pub model: String,
#[serde(alias = "device_alias")]
pub nickname: String,
#[serde(default, deserialize_with = "option_bool_from_int_or_bool")]
pub no_rtsp_constrain: Option<bool>,
pub region: Option<String>,
#[serde(alias = "device_type")]
pub r#type: String,
}
#[cfg(any())]
crate::tapo_vendor::impl_to_dict!(DeviceInfoCameraResult);
impl TapoResponseExt for DeviceInfoCameraResult {}
impl DecodableResultExt for DeviceInfoCameraResult {
fn decode(self) -> Result<Self, Error> {
Ok(self)
}
}