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

use super::*;

impl From<RegisterClusterDto> for Cluster {
    fn from(value: RegisterClusterDto) -> Self {
        Self {
            name: value.name,
            id: Uuid::nil(),
            vendor: value.vendor,
            location: value.location,
            description: value.description,
            registered: false,
            version: String::from("unknown"),
            platform_version: None,
            software: None,
        }
    }
}

impl From<Vec<Cluster>> for Clusters {
    fn from(data: Vec<Cluster>) -> Self {
        Self { data }
    }
}