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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Hetzner Cloud API
*
* Copied from the official API documentation for the Public Hetzner Cloud.
*
* The version of the OpenAPI document: 0.28.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Iso : ISO Image that is attached to this Server. Null if no ISO is attached.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Iso {
/// CPU architecture compatible with the ISO. Null indicates no restriction on the architecture (wildcard).
#[serde(rename = "architecture", deserialize_with = "Option::deserialize")]
pub architecture: Option<models::Architecture>,
/// Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated.
#[serde(rename = "deprecation", deserialize_with = "Option::deserialize")]
pub deprecation: Option<Box<models::DeprecationInfo>>,
/// Description of the ISO.
#[serde(rename = "description")]
pub description: String,
/// ID of the ISO.
#[serde(rename = "id")]
pub id: i64,
/// Unique identifier of the ISO. Only set for public ISOs.
#[serde(rename = "name", deserialize_with = "Option::deserialize")]
pub name: Option<String>,
/// Type of the ISO.
#[serde(rename = "type", deserialize_with = "Option::deserialize")]
pub r#type: Option<Type>,
}
impl Iso {
/// ISO Image that is attached to this Server. Null if no ISO is attached.
pub fn new(
architecture: Option<models::Architecture>,
deprecation: Option<models::DeprecationInfo>,
description: String,
id: i64,
name: Option<String>,
r#type: Option<Type>,
) -> Iso {
Iso {
architecture,
deprecation: deprecation.map(Box::new),
description,
id,
name,
r#type,
}
}
}
/// Type of the ISO.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl Default for Type {
fn default() -> Type {
Self::Private
}
}