DKIM domain enable + AHash version upgrade.
This commit is contained in:
@@ -82,7 +82,7 @@ where
|
||||
properties: Option<Vec<U>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[derive(Debug, Clone, Deserialize, Eq, PartialEq)]
|
||||
pub enum SetErrorType {
|
||||
#[serde(rename = "forbidden")]
|
||||
Forbidden,
|
||||
|
||||
@@ -12,7 +12,7 @@ use crate::{
|
||||
Get, Method, Set,
|
||||
};
|
||||
|
||||
use super::{Principal, Property, Type};
|
||||
use super::{Principal, Property, Type, DKIM};
|
||||
|
||||
impl Client {
|
||||
pub async fn individual_create(
|
||||
@@ -52,6 +52,25 @@ impl Client {
|
||||
.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(
|
||||
&self,
|
||||
email: impl Into<String>,
|
||||
|
||||
@@ -156,9 +156,9 @@ pub struct 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_selector,
|
||||
dkim_selector: dkim_selector.map(Into::into),
|
||||
dkim_expiration,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user