Skip to main content

nominal_api/conjure/objects/secrets/api/
secret.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct Secret {
16    #[serde(rename = "rid")]
17    rid: super::SecretRid,
18    #[builder(into)]
19    #[serde(rename = "name")]
20    name: String,
21    #[builder(into)]
22    #[serde(rename = "description")]
23    description: String,
24    #[serde(rename = "createdBy")]
25    created_by: conjure_object::ResourceIdentifier,
26    #[builder(default, map(key(type = String, into), value(type = String, into)))]
27    #[serde(
28        rename = "properties",
29        skip_serializing_if = "std::collections::BTreeMap::is_empty",
30        default
31    )]
32    properties: std::collections::BTreeMap<String, String>,
33    #[builder(default, set(item(type = String, into)))]
34    #[serde(
35        rename = "labels",
36        skip_serializing_if = "std::collections::BTreeSet::is_empty",
37        default
38    )]
39    labels: std::collections::BTreeSet<String>,
40    #[serde(rename = "createdAt")]
41    created_at: conjure_object::DateTime<conjure_object::Utc>,
42    #[serde(rename = "isArchived")]
43    is_archived: bool,
44}
45impl Secret {
46    #[inline]
47    pub fn rid(&self) -> &super::SecretRid {
48        &self.rid
49    }
50    #[inline]
51    pub fn name(&self) -> &str {
52        &*self.name
53    }
54    #[inline]
55    pub fn description(&self) -> &str {
56        &*self.description
57    }
58    #[inline]
59    pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
60        &self.created_by
61    }
62    #[inline]
63    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
64        &self.properties
65    }
66    #[inline]
67    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
68        &self.labels
69    }
70    #[inline]
71    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
72        self.created_at
73    }
74    #[inline]
75    pub fn is_archived(&self) -> bool {
76        self.is_archived
77    }
78}