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)]
12pub enum UserRole {
13    #[serde(rename = "Administrator")]
14    Administrator,
15    #[serde(rename = "Operator")]
16    Operator,
17    #[serde(rename = "Metrics")]
18    Metrics,
19    #[serde(rename = "Backup")]
20    Backup,
21}
22
23impl std::fmt::Display for UserRole {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25        write!(
26            f,
27            "{}",
28            match self {
29                Self::Administrator => "Administrator",
30                Self::Operator => "Operator",
31                Self::Metrics => "Metrics",
32                Self::Backup => "Backup",
33            }
34        )
35    }
36}
37
38impl Default for UserRole {
39    fn default() -> UserRole {
40        Self::Administrator
41    }
42}