fundamentum_sdk_api/models/
shelf_devices.rs1use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5
6#[derive(Deserialize, Debug)]
8pub struct GetShelfDeviceResponse {
9 pub id: u32,
11 pub created_at: DateTime<Utc>,
13 pub updated_at: DateTime<Utc>,
15 pub deleted_at: Option<DateTime<Utc>>,
17 pub project_id: u32,
19 pub asset_type_id: i32,
21 pub registry_id: Option<u32>,
23 pub serial_number: String,
25 pub secret: String,
27 pub algorithm: String,
29 pub mqtt_host: Option<String>,
31 pub mqtt_port: Option<u16>,
33}
34
35#[derive(Serialize, Debug)]
37pub struct StoreShelfDeviceRequest {
38 pub serial_number: String,
40 pub secret: String,
42}
43
44pub type StoreShelfDeviceResponse = GetShelfDeviceResponse;
46
47#[derive(Serialize, Debug)]
49pub struct ProvisionShelfDeviceRequest {
50 pub registry_id: u32,
52}
53
54#[derive(Deserialize, Debug)]
56pub struct ProvisionShelfDeviceResponse {
57 pub configuration: serde_json::Value,
59 pub mqtt: MqttConfiguration,
61}
62
63pub type DeprovisionShelfDeviceResponse = GetShelfDeviceResponse;
65
66pub type DeleteShelfDeviceResponse = GetShelfDeviceResponse;
68
69#[derive(Deserialize, Debug)]
71pub struct MqttConfiguration {
72 pub client_id: String,
74 pub host: String,
76 pub port: u16,
78}