pub struct NameClient<T> {
client: T,
path: String,
}
impl<T> NameClient<T>
where
T: crate::client::Client,
{
pub fn new(client: T, parent_path: &str, name: &str) -> Self {
Self {
client,
path: format!("{}/{}", parent_path, name),
}
}
}
impl<T> NameClient<T>
where
T: crate::client::Client,
{
#[doc = "Deactivate existing ACME account at CA."]
pub fn delete(&self) -> Result<String, T::Error> {
let path = self.path.to_string();
self.client.delete(&path, &())
}
}
impl<T> NameClient<T>
where
T: crate::client::Client,
{
#[doc = "Return existing ACME account information."]
pub fn get(&self) -> Result<GetOutput, T::Error> {
let path = self.path.to_string();
self.client.get(&path, &())
}
}
impl<T> NameClient<T>
where
T: crate::client::Client,
{
#[doc = "Update existing ACME account information with CA. Note: not specifying any new account information triggers a refresh."]
pub fn put(&self, params: PutParams) -> Result<String, T::Error> {
let path = self.path.to_string();
self.client.put(&path, ¶ms)
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
pub struct AccountGetOutputAccount {
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
pub struct GetOutput {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub account: Option<AccountGetOutputAccount>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "URL of ACME CA directory endpoint."]
pub directory: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub location: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub tos: Option<String>,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
pub struct PutParams {
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Contact email addresses."]
pub contact: Option<String>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}