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
/*
* 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};
/// Nameserver : Primary nameserver that returns Zones via `AXFR`. Must allow queries from and may send `NOTIFY` queries to [Hetzner's secondary nameservers](https://docs.hetzner.com/dns-console/dns/general/authoritative-name-servers#secondary-dns-servers-old-name-servers-for-robot-customers).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Nameserver {
/// Public IPv4 or IPv6 address of the primary nameserver.
#[serde(rename = "address")]
pub address: String,
/// Port of the primary nameserver.
#[serde(rename = "port", skip_serializing_if = "Option::is_none")]
pub port: Option<i32>,
/// [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key.
#[serde(rename = "tsig_algorithm", skip_serializing_if = "Option::is_none")]
pub tsig_algorithm: Option<TsigAlgorithm>,
/// [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) key to use for the zone transfer. Must be base64 encoded.
#[serde(rename = "tsig_key", skip_serializing_if = "Option::is_none")]
pub tsig_key: Option<String>,
}
impl Nameserver {
/// Primary nameserver that returns Zones via `AXFR`. Must allow queries from and may send `NOTIFY` queries to [Hetzner's secondary nameservers](https://docs.hetzner.com/dns-console/dns/general/authoritative-name-servers#secondary-dns-servers-old-name-servers-for-robot-customers).
pub fn new(address: String) -> Nameserver {
Nameserver {
address,
port: None,
tsig_algorithm: None,
tsig_key: None,
}
}
}
/// [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TsigAlgorithm {
#[serde(rename = "hmac-md5")]
Md5,
#[serde(rename = "hmac-sha1")]
Sha1,
#[serde(rename = "hmac-sha256")]
Sha256,
}
impl Default for TsigAlgorithm {
fn default() -> TsigAlgorithm {
Self::Md5
}
}