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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* 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};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Zone {
#[serde(rename = "authoritative_nameservers")]
pub authoritative_nameservers: Box<models::ZoneAuthoritativeNameservers>,
/// Point in time when the Resource was created (in ISO-8601 format).
#[serde(rename = "created")]
pub created: String,
/// ID of the Zone.
#[serde(rename = "id")]
pub id: i64,
/// User-defined labels (`key/value` pairs) for the Resource. For more information, see \"Labels\". | User-defined labels (`key/value` pairs) for the Resource. Note that the set of Labels provided in the request will overwrite the existing one. For more information, see \"Labels\".
#[serde(rename = "labels")]
pub labels: std::collections::HashMap<String, String>,
/// Mode of the Zone. For more information, see Zone Modes.
#[serde(rename = "mode")]
pub mode: Mode,
/// Name of the Zone. All names with [well-known public suffixes](https://publicsuffix.org/) (e.g. `.de`, `.com`, `.co.uk`) are supported. Subdomains are not supported. The name must be in lower case and must not end with a dot. [Internationalized domain names](https://en.wikipedia.org/wiki/Internationalized_domain_name) must be transcribed to [Punycode](https://wikipedia.org/wiki/Punycode) representation with ACE prefix, e.g. `xn--mnchen-3ya.de` (`münchen.de`).
#[serde(rename = "name")]
pub name: String,
/// Primary nameservers of the Zone. Only set if Zone is in secondary mode, otherwise empty.
#[serde(
rename = "primary_nameservers",
skip_serializing_if = "Option::is_none"
)]
pub primary_nameservers: Option<Vec<models::Nameserver>>,
#[serde(rename = "protection")]
pub protection: Box<models::Protection>,
/// Number of resource records (RR) within the Zone.
#[serde(rename = "record_count")]
pub record_count: i32,
/// Registrar of the domain.
#[serde(rename = "registrar")]
pub registrar: Registrar,
/// Status of the Zone. - `ok`: the Zone is pushed to the authoritative nameservers. - `updating`: the Zone is currently being published to the authoritative nameservers. - `error`: the Zone could not be published to the authoritative nameservers.
#[serde(rename = "status")]
pub status: Status,
/// Default Time To Live (TTL) of the Zone. Must be in between 60s and 2147483647s. This TTL is used for RRSets that do not explicitly define a TTL.
#[serde(rename = "ttl")]
pub ttl: i32,
}
impl Zone {
pub fn new(
authoritative_nameservers: models::ZoneAuthoritativeNameservers,
created: String,
id: i64,
labels: std::collections::HashMap<String, String>,
mode: Mode,
name: String,
protection: models::Protection,
record_count: i32,
registrar: Registrar,
status: Status,
ttl: i32,
) -> Zone {
Zone {
authoritative_nameservers: Box::new(authoritative_nameservers),
created,
id,
labels,
mode,
name,
primary_nameservers: None,
protection: Box::new(protection),
record_count,
registrar,
status,
ttl,
}
}
}
/// Mode of the Zone. For more information, see Zone Modes.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
#[serde(rename = "primary")]
Primary,
#[serde(rename = "secondary")]
Secondary,
}
impl Default for Mode {
fn default() -> Mode {
Self::Primary
}
}
/// Registrar of the domain.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Registrar {
#[serde(rename = "hetzner")]
Hetzner,
#[serde(rename = "other")]
Other,
#[serde(rename = "unknown")]
Unknown,
}
impl Default for Registrar {
fn default() -> Registrar {
Self::Hetzner
}
}
/// Status of the Zone. - `ok`: the Zone is pushed to the authoritative nameservers. - `updating`: the Zone is currently being published to the authoritative nameservers. - `error`: the Zone could not be published to the authoritative nameservers.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "error")]
Error,
#[serde(rename = "ok")]
Ok,
#[serde(rename = "updating")]
Updating,
}
impl Default for Status {
fn default() -> Status {
Self::Error
}
}