netcup_client/models/
dnsrecord.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Deserialize, Serialize, Clone)]
4pub struct DnsRecord {
5    pub id: String,
6    pub hostname: String,
7    #[serde(rename = "type")]
8    pub record_type: String,
9    pub priority: String,
10    pub destination: String,
11    pub deleterecord: bool,
12    pub state: String,
13}
14
15impl DnsRecord {
16    pub fn new(hostname: &str, record_type: &str, destination: &str) -> Self {
17        Self {
18            id: String::default(),
19            hostname: hostname.to_owned(),
20            record_type: record_type.to_owned(),
21            priority: String::default(),
22            destination: destination.to_owned(),
23            deleterecord: false,
24            state: String::default(),
25        }
26    }
27}
28
29#[derive(Debug, Deserialize, Serialize)]
30pub struct DnsRecordSet {
31    #[serde(rename = "dnsrecords")]
32    pub records: Vec<DnsRecord>,
33}