acme_types/v2/
directory.rs1#[cfg(feature = "json")]
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Debug)]
8#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
9pub struct Directory {
10 #[cfg_attr(feature = "json", serde(rename = "newNonce"))]
12 pub new_nonce: String,
13 #[cfg_attr(feature = "json", serde(rename = "newAccount"))]
15 pub new_account: String,
16 #[cfg_attr(feature = "json", serde(rename = "newOrder"))]
18 pub new_order: String,
19 #[cfg_attr(feature = "json", serde(skip_serializing_if = "Option::is_none"))]
21 #[cfg_attr(feature = "json", serde(rename = "newAuthz"))]
22 pub new_authorization: Option<String>,
23 #[cfg_attr(feature = "json", serde(rename = "revokeCert"))]
25 pub revoke_certificate: String,
26 #[cfg_attr(feature = "json", serde(rename = "keyChange"))]
28 pub key_change: String,
29 #[cfg_attr(feature = "json", serde(skip_serializing_if = "Option::is_none"))]
31 #[cfg_attr(feature = "json", serde(rename = "meta"))]
32 pub metadata: Option<DirectoryMetadata>,
33}
34
35#[cfg(feature = "json")]
36impl Directory {
37 pub fn from_str(s: &str) -> Result<Directory, serde_json::error::Error> {
39 serde_json::from_str(s)
40 }
41
42 pub fn to_string(&self) -> Result<String, serde_json::error::Error> {
44 serde_json::to_string(self)
45 }
46}
47
48#[derive(Clone, Debug)]
52#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
53pub struct DirectoryMetadata {
54 #[cfg_attr(feature = "json", serde(skip_serializing_if = "Option::is_none"))]
56 #[cfg_attr(feature = "json", serde(rename = "termsOfService"))]
57 pub terms_of_service: Option<String>,
58 #[cfg_attr(feature = "json", serde(skip_serializing_if = "Option::is_none"))]
60 pub website: Option<String>,
61 #[cfg_attr(feature = "json", serde(skip_serializing_if = "Option::is_none"))]
63 #[cfg_attr(feature = "json", serde(rename = "caaIdentities"))]
64 pub caa_identities: Option<Vec<String>>,
65 #[cfg_attr(feature = "json", serde(skip_serializing_if = "Option::is_none"))]
67 #[cfg_attr(feature = "json", serde(rename = "externalAccountRequired"))]
68 pub external_account_required: Option<bool>,
69}