proxmox_api/generated/cluster/acme/
account.rs1pub mod name;
2pub struct AccountClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> AccountClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/account"),
14 }
15 }
16}
17impl<T> AccountClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "ACMEAccount index."]
22 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl<T> AccountClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Register a new ACME account with CA."]
32 pub fn post(&self, params: PostParams) -> Result<String, T::Error> {
33 let path = self.path.to_string();
34 self.client.post(&path, ¶ms)
35 }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
38pub struct GetOutputItems {
39 #[serde(
40 flatten,
41 default,
42 skip_serializing_if = "::std::collections::HashMap::is_empty"
43 )]
44 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
45}
46impl PostParams {
47 pub fn new(contact: String) -> Self {
48 Self {
49 contact,
50 directory: Default::default(),
51 eab_hmac_key: Default::default(),
52 eab_kid: Default::default(),
53 name: Default::default(),
54 tos_url: Default::default(),
55 additional_properties: Default::default(),
56 }
57 }
58}
59#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
60pub struct PostParams {
61 #[doc = "Contact email addresses."]
62 pub contact: String,
63 #[serde(skip_serializing_if = "Option::is_none", default)]
64 #[doc = "URL of ACME CA directory endpoint."]
65 pub directory: Option<String>,
66 #[serde(rename = "eab-hmac-key")]
67 #[serde(skip_serializing_if = "Option::is_none", default)]
68 #[doc = "HMAC key for External Account Binding."]
69 pub eab_hmac_key: Option<String>,
70 #[serde(rename = "eab-kid")]
71 #[serde(skip_serializing_if = "Option::is_none", default)]
72 #[doc = "Key Identifier for External Account Binding."]
73 pub eab_kid: Option<String>,
74 #[serde(skip_serializing_if = "Option::is_none", default)]
75 #[doc = "ACME account config file name."]
76 pub name: Option<String>,
77 #[serde(skip_serializing_if = "Option::is_none", default)]
78 #[doc = "URL of CA TermsOfService - setting this indicates agreement."]
79 pub tos_url: Option<String>,
80 #[serde(
81 flatten,
82 default,
83 skip_serializing_if = "::std::collections::HashMap::is_empty"
84 )]
85 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
86}
87impl<T> AccountClient<T>
88where
89 T: crate::client::Client,
90{
91 pub fn name(&self, name: &str) -> name::NameClient<T> {
92 name::NameClient::<T>::new(self.client.clone(), &self.path, name)
93 }
94}