bioscopelib/dto/
microscope_request.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//!
//! Request from client to change or add `Microscope`
//!
use jsonb::access::Access;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use uuid::Uuid;

use crate::jsonb;

/// Request to change or add a microscope
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct MicroscopeRequest {
    /// Microscope id - can be generated if microscope is new
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<Uuid>,

    /// ID of the user, who created or change microscope info
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user: Option<Uuid>,

    /// ID of the organization that owns the microscope
    pub organization: Uuid,

    /// Microscope name
    pub name: String,

    /// Some info about the microscope
    #[serde(skip_serializing_if = "Option::is_none")]
    pub details: Option<Value>,

    /// Microscope description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,

    /// Who has access to the microscope, if none then all registered
    #[serde(skip_serializing_if = "Option::is_none")]
    pub access: Option<Access>,

    /// ID of the microscope model
    pub model: Uuid,

    /// Wi-Fi name for connecting the microscope to the Internet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub networkname: Option<String>,

    /// Wi-Fi password for connecting the microscope to the Internet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub networkpass: Option<String>,
}