nethsm_sdk_rs/models/
user_role.rs

1/*
2 * NetHSM
3 *
4 * All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All [base64](https://tools.ietf.org/html/rfc4648#section-4) encoded values are Big Endian.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: Nitrokey <info@nitrokey.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
12#[non_exhaustive]
13pub enum UserRole {
14    #[serde(rename = "Administrator")]
15    Administrator,
16    #[serde(rename = "Operator")]
17    Operator,
18    #[serde(rename = "Metrics")]
19    Metrics,
20    #[serde(rename = "Backup")]
21    Backup,
22}
23
24impl std::fmt::Display for UserRole {
25    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26        write!(
27            f,
28            "{}",
29            match self {
30                Self::Administrator => "Administrator",
31                Self::Operator => "Operator",
32                Self::Metrics => "Metrics",
33                Self::Backup => "Backup",
34            }
35        )
36    }
37}
38
39impl Default for UserRole {
40    fn default() -> UserRole {
41        Self::Administrator
42    }
43}