use crate::types::SecretString;
#[derive(Clone, Debug, Default)]
#[non_exhaustive]
pub struct QueryBindKeyParams {
pub position_id: Option<String>,
pub connect_type: Option<String>,
}
impl QueryBindKeyParams {
pub fn with_position_id(mut self, position_id: impl Into<String>) -> Self {
self.position_id = Some(position_id.into());
self
}
pub fn with_connect_type(mut self, connect_type: impl Into<String>) -> Self {
self.connect_type = Some(connect_type.into());
self
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryBindParams {
pub bind_key: SecretString,
}
impl QueryBindParams {
pub fn new(bind_key: impl Into<String>) -> Self {
Self {
bind_key: SecretString::new(bind_key),
}
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct OpenConnectParams {
pub did: String,
}
impl OpenConnectParams {
pub fn new(did: impl Into<String>) -> Self {
Self { did: did.into() }
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct CloseConnectParams {
pub did: String,
}
impl CloseConnectParams {
pub fn new(did: impl Into<String>) -> Self {
Self { did: did.into() }
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryDeviceSupportGatewayParams {
pub model: String,
}
impl QueryDeviceSupportGatewayParams {
pub fn new(model: impl Into<String>) -> Self {
Self {
model: model.into(),
}
}
}
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct QueryPositionSupportGatewayParams {
pub position_id: Option<String>,
pub model: String,
pub page_num: u32,
pub page_size: u32,
}
impl QueryPositionSupportGatewayParams {
pub fn new(model: impl Into<String>) -> Self {
Self {
position_id: None,
model: model.into(),
page_num: 1,
page_size: 30,
}
}
pub fn with_position_id(mut self, position_id: impl Into<String>) -> Self {
self.position_id = Some(position_id.into());
self
}
pub fn with_page_num(mut self, page_num: u32) -> Self {
self.page_num = page_num;
self
}
pub fn with_page_size(mut self, page_size: u32) -> Self {
self.page_size = page_size;
self
}
}