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
use super::*;
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub enum ServerMode {
Software,
Sgx,
}
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct VersionResponse {
pub version: String,
pub api_version: String,
pub server_mode: ServerMode,
#[serde(default)]
pub fips_level: Option<u8>,
}
pub struct OperationVersion;
#[allow(unused)]
impl Operation for OperationVersion {
type PathParams = ();
type QueryParams = ();
type Body = ();
type Output = VersionResponse;
fn method() -> Method {
Method::Get
}
fn path(p: <Self::PathParams as TupleRef>::Ref, q: Option<&Self::QueryParams>) -> String {
format!("/sys/v1/version")
}
fn to_body(body: &Self::Body) -> Option<serde_json::Value> {
None
}
}
impl SdkmsClient {
pub fn version(&self) -> Result<VersionResponse> {
self.execute::<OperationVersion>(&(), (), None)
}
}