Skip to main content

proxmox_api/generated/cluster/acme/
meta.rs

1#[derive(Debug, Clone)]
2pub struct MetaClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> MetaClient<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, "/meta"),
14        }
15    }
16}
17impl<T> MetaClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Retrieve ACME Directory Meta Information"]
22    #[doc = ""]
23    #[doc = "Permission check: perm(\"/nodes/{node}\", [\"Sys.Audit\"])"]
24    pub async fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
25        let path = self.path.to_string();
26        self.client.get(&path, &params).await
27    }
28}
29#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
30pub struct GetOutput {
31    #[serde(rename = "caaIdentities")]
32    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
33    #[doc = "Hostnames referring to the ACME servers."]
34    #[doc = ""]
35    pub caaidentities: Vec<String>,
36    #[serde(rename = "externalAccountRequired")]
37    #[serde(
38        serialize_with = "crate::types::serialize_bool_optional",
39        deserialize_with = "crate::types::deserialize_bool_optional"
40    )]
41    #[serde(skip_serializing_if = "Option::is_none", default)]
42    #[doc = "EAB Required"]
43    #[doc = ""]
44    pub externalaccountrequired: Option<bool>,
45    #[serde(rename = "termsOfService")]
46    #[serde(skip_serializing_if = "Option::is_none", default)]
47    #[doc = "ACME TermsOfService URL."]
48    #[doc = ""]
49    pub termsofservice: Option<String>,
50    #[serde(skip_serializing_if = "Option::is_none", default)]
51    #[doc = "URL to more information about the ACME server."]
52    #[doc = ""]
53    pub website: Option<String>,
54    #[serde(
55        flatten,
56        default,
57        skip_serializing_if = "::std::collections::HashMap::is_empty"
58    )]
59    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
62pub struct GetParams {
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    #[doc = "URL of ACME CA directory endpoint."]
65    #[doc = ""]
66    pub directory: Option<DirectoryStr>,
67    #[serde(
68        flatten,
69        default,
70        skip_serializing_if = "::std::collections::HashMap::is_empty"
71    )]
72    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
73}
74#[derive(Debug, Clone, PartialEq, PartialOrd)]
75pub struct DirectoryStr {
76    value: String,
77}
78impl crate::types::bounded_string::BoundedString for DirectoryStr {
79    const MIN_LENGTH: Option<usize> = None::<usize>;
80    const MAX_LENGTH: Option<usize> = None::<usize>;
81    const DEFAULT: Option<&'static str> = Some("https://acme-v02.api.letsencrypt.org/directory");
82    const PATTERN: Option<&'static str> = Some("^https?://.*");
83    const TYPE_DESCRIPTION: &'static str =
84        "a string with pattern r\"^https?://.*\" and no length constraints";
85    fn get_value(&self) -> &str {
86        &self.value
87    }
88    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
89        Self::validate(&value)?;
90        Ok(Self { value })
91    }
92}
93impl std::convert::TryFrom<String> for DirectoryStr {
94    type Error = crate::types::bounded_string::BoundedStringError;
95    fn try_from(value: String) -> Result<Self, Self::Error> {
96        crate::types::bounded_string::BoundedString::new(value)
97    }
98}
99impl ::serde::Serialize for DirectoryStr {
100    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
101    where
102        S: ::serde::Serializer,
103    {
104        crate::types::bounded_string::serialize_bounded_string(self, serializer)
105    }
106}
107impl<'de> ::serde::Deserialize<'de> for DirectoryStr {
108    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
109    where
110        D: ::serde::Deserializer<'de>,
111    {
112        crate::types::bounded_string::deserialize_bounded_string(deserializer)
113    }
114}