Skip to main content

nominal_api/conjure/objects/scout/notebook/api/
update_notebook_metadata_request.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 UpdateNotebookMetadataRequest {
16    #[builder(default, into)]
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
18    title: Option<String>,
19    #[builder(
20        default,
21        custom(
22            type = impl
23            Into<Option<super::NotebookDataScope>>,
24            convert = |v|v.into().map(Box::new)
25        )
26    )]
27    #[serde(rename = "dataScope", skip_serializing_if = "Option::is_none", default)]
28    data_scope: Option<Box<super::NotebookDataScope>>,
29    #[builder(default, into)]
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
31    description: Option<String>,
32    #[builder(default, into)]
33    #[serde(rename = "properties", skip_serializing_if = "Option::is_none", default)]
34    properties: Option<std::collections::BTreeMap<String, String>>,
35    #[builder(default, into)]
36    #[serde(rename = "labels", skip_serializing_if = "Option::is_none", default)]
37    labels: Option<std::collections::BTreeSet<String>>,
38    #[builder(default, into)]
39    #[serde(rename = "isDraft", skip_serializing_if = "Option::is_none", default)]
40    is_draft: Option<bool>,
41    #[builder(
42        default,
43        custom(
44            type = impl
45            Into<Option<super::super::super::super::api::ThemeAwareImage>>,
46            convert = |v|v.into().map(Box::new)
47        )
48    )]
49    #[serde(rename = "previewImage", skip_serializing_if = "Option::is_none", default)]
50    preview_image: Option<Box<super::super::super::super::api::ThemeAwareImage>>,
51    #[builder(default, into)]
52    #[serde(rename = "isLocked", skip_serializing_if = "Option::is_none", default)]
53    is_locked: Option<bool>,
54}
55impl UpdateNotebookMetadataRequest {
56    /// Constructs a new instance of the type.
57    #[inline]
58    pub fn new() -> Self {
59        Self::builder().build()
60    }
61    #[inline]
62    pub fn title(&self) -> Option<&str> {
63        self.title.as_ref().map(|o| &**o)
64    }
65    /// Optional for backcompatibility.
66    #[inline]
67    pub fn data_scope(&self) -> Option<&super::NotebookDataScope> {
68        self.data_scope.as_ref().map(|o| &**o)
69    }
70    #[inline]
71    pub fn description(&self) -> Option<&str> {
72        self.description.as_ref().map(|o| &**o)
73    }
74    #[inline]
75    pub fn properties(&self) -> Option<&std::collections::BTreeMap<String, String>> {
76        self.properties.as_ref().map(|o| &*o)
77    }
78    #[inline]
79    pub fn labels(&self) -> Option<&std::collections::BTreeSet<String>> {
80        self.labels.as_ref().map(|o| &*o)
81    }
82    #[inline]
83    pub fn is_draft(&self) -> Option<bool> {
84        self.is_draft.as_ref().map(|o| *o)
85    }
86    /// Theme-aware preview image for the workbook. When provided, replaces the existing preview image.
87    #[inline]
88    pub fn preview_image(
89        &self,
90    ) -> Option<&super::super::super::super::api::ThemeAwareImage> {
91        self.preview_image.as_ref().map(|o| &**o)
92    }
93    /// Whether to lock or unlock the workbook. If omitted, the original lock state will remain unchanged.
94    /// When provided, the server derives the locking user from the auth header and generates the lock
95    /// timestamp at write time.
96    #[inline]
97    pub fn is_locked(&self) -> Option<bool> {
98        self.is_locked.as_ref().map(|o| *o)
99    }
100}