DKIM domain enable + AHash version upgrade.

main
Mauro D 2022-08-18 15:53:54 +00:00
parent b0ba1737b1
commit 29ec39d98c
4 changed files with 25 additions and 6 deletions

View File

@ -20,8 +20,8 @@ async-stream = { version = "0.3", optional = true}
serde = { version = "1.0", features = ["derive"]} serde = { version = "1.0", features = ["derive"]}
serde_json = "1.0" serde_json = "1.0"
chrono = { version = "0.4", features = ["serde"]} chrono = { version = "0.4", features = ["serde"]}
ahash = {version = "0.7.6", features = ["serde"]} ahash = {version = "0.8", features = ["serde"]}
parking_lot = "0.12.0" parking_lot = "0.12"
base64 = "0.13" base64 = "0.13"
[features] [features]

View File

@ -82,7 +82,7 @@ where
properties: Option<Vec<U>>, properties: Option<Vec<U>>,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize, Eq, PartialEq)]
pub enum SetErrorType { pub enum SetErrorType {
#[serde(rename = "forbidden")] #[serde(rename = "forbidden")]
Forbidden, Forbidden,

View File

@ -12,7 +12,7 @@ use crate::{
Get, Method, Set, Get, Method, Set,
}; };
use super::{Principal, Property, Type}; use super::{Principal, Property, Type, DKIM};
impl Client { impl Client {
pub async fn individual_create( pub async fn individual_create(
@ -52,6 +52,25 @@ impl Client {
.created(&id) .created(&id)
} }
pub async fn domain_enable_dkim(
&self,
id: &str,
key: impl Into<String>,
selector: impl Into<String>,
expiration: Option<i64>,
) -> crate::Result<Option<Principal>> {
let mut request = self.build();
request
.set_principal()
.update(id)
.secret(key)
.dkim(DKIM::new(Some(selector), expiration));
request
.send_single::<PrincipalSetResponse>()
.await?
.updated(id)
}
pub async fn list_create( pub async fn list_create(
&self, &self,
email: impl Into<String>, email: impl Into<String>,

View File

@ -156,9 +156,9 @@ pub struct DKIM {
} }
impl DKIM { impl DKIM {
pub fn new(dkim_selector: Option<String>, dkim_expiration: Option<i64>) -> DKIM { pub fn new(dkim_selector: Option<impl Into<String>>, dkim_expiration: Option<i64>) -> DKIM {
DKIM { DKIM {
dkim_selector, dkim_selector: dkim_selector.map(Into::into),
dkim_expiration, dkim_expiration,
} }
} }