nethsm_sdk_rs/models/switch.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 Switch {
14 #[serde(rename = "on")]
15 On,
16 #[serde(rename = "off")]
17 Off,
18}
19
20impl std::fmt::Display for Switch {
21 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22 write!(
23 f,
24 "{}",
25 match self {
26 Self::On => "on",
27 Self::Off => "off",
28 }
29 )
30 }
31}
32
33impl Default for Switch {
34 fn default() -> Switch {
35 Self::On
36 }
37}