#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrBrandsParams {
pub category_id: u32,
}
impl QueryIrBrandsParams {
pub fn new(category_id: u32) -> Self {
Self { category_id }
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrMatchParams {
pub r#type: u32,
pub category_id: u32,
pub brand_id: u32,
}
impl QueryIrMatchParams {
pub fn new(r#type: u32, category_id: u32, brand_id: u32) -> Self {
Self {
r#type,
category_id,
brand_id,
}
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct CreateIrControllerParams {
pub parent_did: String,
pub position_id: Option<String>,
pub category_id: u32,
pub brand_id: u32,
pub controller_id: u32,
pub name: String,
}
impl CreateIrControllerParams {
pub fn new(
parent_did: impl Into<String>,
category_id: u32,
brand_id: u32,
controller_id: u32,
name: impl Into<String>,
) -> Self {
Self {
parent_did: parent_did.into(),
position_id: None,
category_id,
brand_id,
controller_id,
name: name.into(),
}
}
pub fn with_position_id(mut self, position_id: impl Into<String>) -> Self {
self.position_id = Some(position_id.into());
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct DeleteIrControllerParams {
pub did: String,
}
impl DeleteIrControllerParams {
pub fn new(did: impl Into<String>) -> Self {
Self { did: did.into() }
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct UpdateIrControllerParams {
pub did: String,
pub name: String,
}
impl UpdateIrControllerParams {
pub fn new(did: impl Into<String>, name: impl Into<String>) -> Self {
Self {
did: did.into(),
name: name.into(),
}
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrInfoParams {
pub did: String,
}
impl QueryIrInfoParams {
pub fn new(did: impl Into<String>) -> Self {
Self { did: did.into() }
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrListParams {
pub parent_did: String,
}
impl QueryIrListParams {
pub fn new(parent_did: impl Into<String>) -> Self {
Self {
parent_did: parent_did.into(),
}
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct WriteIrClickParams {
pub did: String,
pub brand_id: Option<u32>,
pub controller_id: Option<u32>,
pub key_id: Option<String>,
pub is_ac_match: Option<String>,
pub ac_key: Option<String>,
}
impl WriteIrClickParams {
pub fn new(did: impl Into<String>) -> Self {
Self {
did: did.into(),
brand_id: None,
controller_id: None,
key_id: None,
is_ac_match: None,
ac_key: None,
}
}
pub fn with_brand_id(mut self, brand_id: u32) -> Self {
self.brand_id = Some(brand_id);
self
}
pub fn with_controller_id(mut self, controller_id: u32) -> Self {
self.controller_id = Some(controller_id);
self
}
pub fn with_key_id(mut self, key_id: impl Into<String>) -> Self {
self.key_id = Some(key_id.into());
self
}
pub fn with_is_ac_match(mut self, is_ac_match: impl Into<String>) -> Self {
self.is_ac_match = Some(is_ac_match.into());
self
}
pub fn with_ac_key(mut self, ac_key: impl Into<String>) -> Self {
self.ac_key = Some(ac_key.into());
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrAcStateParams {
pub did: String,
}
impl QueryIrAcStateParams {
pub fn new(did: impl Into<String>) -> Self {
Self { did: did.into() }
}
}
#[derive(Clone, Debug, Default)]
#[non_exhaustive]
pub struct QueryIrFunctionsParams {
pub did: Option<String>,
pub controller_id: Option<u32>,
}
impl QueryIrFunctionsParams {
pub fn with_did(mut self, did: impl Into<String>) -> Self {
self.did = Some(did.into());
self
}
pub fn with_controller_id(mut self, controller_id: u32) -> Self {
self.controller_id = Some(controller_id);
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrKeysParams {
pub did: String,
}
impl QueryIrKeysParams {
pub fn new(did: impl Into<String>) -> Self {
Self { did: did.into() }
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct WriteIrStartLearnParams {
pub did: String,
pub time_length: Option<u32>,
}
impl WriteIrStartLearnParams {
pub fn new(did: impl Into<String>) -> Self {
Self {
did: did.into(),
time_length: None,
}
}
pub fn with_time_length(mut self, time_length: u32) -> Self {
self.time_length = Some(time_length);
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct WriteIrCancelLearnParams {
pub did: String,
pub key_id: Option<String>,
}
impl WriteIrCancelLearnParams {
pub fn new(did: impl Into<String>) -> Self {
Self {
did: did.into(),
key_id: None,
}
}
pub fn with_key_id(mut self, key_id: impl Into<String>) -> Self {
self.key_id = Some(key_id.into());
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryIrLearnResultParams {
pub did: String,
pub key_id: Option<String>,
}
impl QueryIrLearnResultParams {
pub fn new(did: impl Into<String>) -> Self {
Self {
did: did.into(),
key_id: None,
}
}
pub fn with_key_id(mut self, key_id: impl Into<String>) -> Self {
self.key_id = Some(key_id.into());
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct IrCodeInfo {
pub key_name: String,
pub key_id: String,
pub ircode: String,
pub freq: Option<String>,
}
impl IrCodeInfo {
pub fn new(
key_id: impl Into<String>,
key_name: impl Into<String>,
ircode: impl Into<String>,
) -> Self {
Self {
key_name: key_name.into(),
key_id: key_id.into(),
ircode: ircode.into(),
freq: None,
}
}
pub fn with_freq(mut self, freq: impl Into<String>) -> Self {
self.freq = Some(freq.into());
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct ConfigIrCustomParams {
pub parent_did: String,
pub name: String,
pub position_id: Option<String>,
pub ir_code_infos: Vec<IrCodeInfo>,
}
impl ConfigIrCustomParams {
pub fn new(
parent_did: impl Into<String>,
name: impl Into<String>,
ir_code_infos: impl Into<Vec<IrCodeInfo>>,
) -> Self {
Self {
parent_did: parent_did.into(),
name: name.into(),
position_id: None,
ir_code_infos: ir_code_infos.into(),
}
}
pub fn with_position_id(mut self, position_id: impl Into<String>) -> Self {
self.position_id = Some(position_id.into());
self
}
}