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
use serde::{Deserialize, Serialize};
/// A sending domain, as the API returns it.
#[derive(Clone, Debug, Deserialize)]
pub struct Domain {
/// Unique domain id.
pub domain_id: String,
/// The domain name, e.g. `mail.example.com`.
#[serde(default)]
pub domain: Option<String>,
/// Owning pod, when the account uses pods.
#[serde(default)]
pub pod_id: Option<String>,
/// Verification status (e.g. `pending`, `verified`).
#[serde(default)]
pub status: Option<String>,
/// Whether bounce/complaint feedback is enabled.
#[serde(default)]
pub feedback_enabled: Option<bool>,
/// Whether subdomains of this domain may be used for inboxes.
#[serde(default)]
pub subdomains_enabled: Option<bool>,
/// The DNS records to add for verification and sending.
#[serde(default)]
pub records: Vec<VerificationRecord>,
/// Your reference id from creation, when set.
#[serde(default)]
pub client_id: Option<String>,
/// Timestamp the domain was last updated (RFC 3339).
#[serde(default)]
pub updated_at: Option<String>,
/// Timestamp the domain was created (RFC 3339).
#[serde(default)]
pub created_at: Option<String>,
}
/// A single DNS record to publish for a domain.
#[derive(Clone, Debug, Deserialize)]
pub struct VerificationRecord {
/// DNS record type, e.g. `TXT`, `MX`, `CNAME`.
#[serde(rename = "type")]
pub record_type: String,
/// The record name (host).
pub name: String,
/// The record value.
pub value: String,
/// Verification status of this record.
#[serde(default)]
pub status: Option<String>,
/// Priority, for records that need one (e.g. `MX`).
#[serde(default)]
pub priority: Option<i64>,
}
/// Request body for `create_domain`.
#[derive(Clone, Debug, Default, Serialize)]
pub struct CreateDomain {
/// The domain name to add.
pub domain: String,
/// Enable bounce/complaint feedback.
#[serde(skip_serializing_if = "Option::is_none")]
pub feedback_enabled: Option<bool>,
/// Allow subdomains of this domain to be used for inboxes.
#[serde(skip_serializing_if = "Option::is_none")]
pub subdomains_enabled: Option<bool>,
}
/// Request body for `update_domain`. Fields left `None` stay unchanged.
#[derive(Clone, Debug, Default, Serialize)]
pub struct UpdateDomain {
/// Enable or disable bounce/complaint feedback.
#[serde(skip_serializing_if = "Option::is_none")]
pub feedback_enabled: Option<bool>,
/// Enable or disable subdomains for inbox use.
#[serde(skip_serializing_if = "Option::is_none")]
pub subdomains_enabled: Option<bool>,
}
/// One page of domains from `list_domains_page`.
#[derive(Clone, Debug, Deserialize)]
pub struct DomainList {
/// Total domains in the account (not just this page).
pub count: u64,
/// This page of domains.
#[serde(default)]
pub domains: Vec<Domain>,
/// Cursor for the next page; `None` on the last page.
#[serde(default)]
pub next_page_token: Option<String>,
}