Skip to main content

alien_core/import/data/aws/
email.rs

1use serde::{Deserialize, Serialize};
2use std::collections::BTreeMap;
3
4/// AWS Email ImportData.
5///
6/// Mirrors the `emit_import_ref` payload of the AWS SES email emitter: the
7/// shared configuration set name, one entry per seed domain carrying its
8/// Easy-DKIM CNAME records, and — when inbound mail is configured — the
9/// receipt rule set name. Identities created at runtime through the
10/// `email/manage-identities` grant are application data and never appear
11/// here.
12#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
13#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
14#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
15#[serde(rename_all = "camelCase")]
16pub struct AwsEmailImportData {
17    /// SES configuration set name (used when sending).
18    pub configuration_set: String,
19    /// Per-seed-domain DNS data, keyed by mail domain.
20    pub domains: BTreeMap<String, AwsEmailDomainImportData>,
21    /// SES receipt rule set name, present only when inbound mail is configured.
22    #[serde(default, skip_serializing_if = "Option::is_none")]
23    pub rule_set_name: Option<String>,
24}
25
26/// Per-domain import payload for an AWS Email resource.
27#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
28#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
29#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
30#[serde(rename_all = "camelCase")]
31pub struct AwsEmailDomainImportData {
32    /// Easy-DKIM CNAME tokens (three per domain). The domain is verified by
33    /// SES once these records exist in its DNS configuration.
34    pub dkim_tokens: Vec<AwsEmailDkimTokenImportData>,
35}
36
37/// A single Easy-DKIM CNAME record.
38#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
39#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
40#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
41#[serde(rename_all = "camelCase")]
42pub struct AwsEmailDkimTokenImportData {
43    /// CNAME record host name.
44    pub name: String,
45    /// CNAME record value.
46    pub value: String,
47}