fundamentum_sdk_api/models/provisioning.rs
1//! Provisioning API structures
2
3use super::general::MqttField;
4use serde::{Deserialize, Serialize};
5
6/// Provision Scheme.
7/// More info: <https://dimonoff.atlassian.net/wiki/spaces/F2/pages/306166693917/Provisioning#Provisioning-API-V2>.
8#[derive(Serialize, Debug)]
9pub struct ProvisionReqV2 {
10 /// Project id on the Hub.
11 pub project_id: u32,
12 /// Region id on the Hub.
13 pub region_id: u32,
14 /// Registry id on the Hub.
15 pub registry_id: u32,
16 /// Serial number of the end device to provision.
17 pub serial_number: String,
18 /// Provisioning token obtained from a Token file.
19 pub access_token: String,
20 /// The RSA public key that will be used to validate the JWT token made by the device.
21 pub public_key: String,
22 /// Type of the device. The default is [`DEFAULT_ASSET_TYPE_ID`](crate::models::constants::DEFAULT_ASSET_TYPE_ID).
23 pub asset_type_id: i32,
24}
25
26/// Provision Scheme.
27/// More info: <https://dimonoff.atlassian.net/wiki/spaces/F2/pages/306166693917/Provisioning#Provisioning-API-V3>.
28#[derive(Serialize, Debug)]
29pub struct ProvisionReqV3 {
30 /// Project id on the Hub.
31 pub project_id: u32,
32 /// Region id on the Hub.
33 pub region_id: u32,
34 /// Registry id on the Hub.
35 pub registry_id: u32,
36 /// Serial number of the end device to provision.
37 pub serial_number: String,
38 /// Provisioning token obtained from a Token file.
39 pub access_token: String,
40 /// The RSA public key that will be used to validate the JWT token made by the device.
41 pub secret: String,
42 /// Type of the device. The default is [`DEFAULT_ASSET_TYPE_ID`](crate::models::constants::DEFAULT_ASSET_TYPE_ID).
43 pub asset_type_id: i32,
44}
45
46/// Provision Response Scheme.
47#[derive(Deserialize, Debug)]
48pub struct ProvisionRes {
49 /// Unknown at implementation time.
50 pub configuration: serde_json::Value,
51 /// MQTT configuration.
52 pub mqtt: MqttField,
53}