Skip to main content

nominal_api/conjure/objects/scout/catalog/
retention_policy.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 RetentionPolicy {
16    #[serde(rename = "type")]
17    type_: super::RetentionPolicyType,
18    #[builder(default, into)]
19    #[serde(rename = "expiryDays", skip_serializing_if = "Option::is_none", default)]
20    expiry_days: Option<i32>,
21}
22impl RetentionPolicy {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(type_: super::RetentionPolicyType) -> Self {
26        Self::builder().type_(type_).build()
27    }
28    #[inline]
29    pub fn type_(&self) -> &super::RetentionPolicyType {
30        &self.type_
31    }
32    #[inline]
33    pub fn expiry_days(&self) -> Option<i32> {
34        self.expiry_days.as_ref().map(|o| *o)
35    }
36}