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
22    /// configured. Activating the rule set is a manual post-deploy step.
23    #[serde(default, skip_serializing_if = "Option::is_none")]
24    pub rule_set_name: Option<String>,
25}
26
27/// Per-domain import payload for an AWS Email resource.
28#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
29#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
30#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
31#[serde(rename_all = "camelCase")]
32pub struct AwsEmailDomainImportData {
33    /// Easy-DKIM CNAME tokens (three per domain). The domain is verified by
34    /// SES once these records exist in its DNS configuration.
35    pub dkim_tokens: Vec<AwsEmailDkimTokenImportData>,
36}
37
38/// A single Easy-DKIM CNAME record.
39#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
40#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
41#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
42#[serde(rename_all = "camelCase")]
43pub struct AwsEmailDkimTokenImportData {
44    /// CNAME record host name.
45    pub name: String,
46    /// CNAME record value.
47    pub value: String,
48}