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
52
53
54
55
56
57
//
// Copyright 2023 Zesty Tech Ltd. All rights reserved.
// Use is subject to license terms.
//

use super::*;

pub use software::Software;

mod impls;
mod software;

pub const PREFIX: &str = "/v0";

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RegisterClusterDto {
    pub name: String,
    pub vendor: Vendor,
    pub handle: String,
    pub location: Location,
    pub description: Option<String>,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Cluster {
    pub name: String,
    pub id: Uuid,
    pub vendor: Vendor,
    pub registered: bool,
    pub location: Location,
    pub description: Option<String>,
    pub version: String,
    pub platform_version: Option<String>,
    pub software: Option<Software>,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Clusters {
    pub data: Vec<Cluster>,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ClusterToken {
    pub token: String,
}

impl RegisterClusterDto {
    pub const PATH: &str = "/clusters";
}

impl Cluster {
    pub const PATH: &str = "/clusters";
}

impl ClusterToken {
    pub const PATH: &str = "/token";
}