Skip to main content

nominal_api/conjure/objects/scout/savedviews/api/
update_saved_view_request.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct UpdateSavedViewRequest {
13    #[builder(default, into)]
14    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
15    title: Option<String>,
16    #[builder(
17        default,
18        custom(
19            type = impl
20            Into<Option<super::UpdateSymbol>>,
21            convert = |v|v.into().map(Box::new)
22        )
23    )]
24    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none", default)]
25    symbol: Option<Box<super::UpdateSymbol>>,
26    #[builder(
27        default,
28        custom(
29            type = impl
30            Into<Option<super::UpdateColor>>,
31            convert = |v|v.into().map(Box::new)
32        )
33    )]
34    #[serde(rename = "color", skip_serializing_if = "Option::is_none", default)]
35    color: Option<Box<super::UpdateColor>>,
36    #[builder(
37        default,
38        custom(
39            type = impl
40            Into<Option<super::SearchState>>,
41            convert = |v|v.into().map(Box::new)
42        )
43    )]
44    #[serde(rename = "searchState", skip_serializing_if = "Option::is_none", default)]
45    search_state: Option<Box<super::SearchState>>,
46    #[builder(
47        default,
48        custom(
49            type = impl
50            Into<Option<super::DisplayState>>,
51            convert = |v|v.into().map(Box::new)
52        )
53    )]
54    #[serde(rename = "displayState", skip_serializing_if = "Option::is_none", default)]
55    display_state: Option<Box<super::DisplayState>>,
56    #[builder(default, into)]
57    #[serde(rename = "index", skip_serializing_if = "Option::is_none", default)]
58    index: Option<i32>,
59}
60impl UpdateSavedViewRequest {
61    /// Constructs a new instance of the type.
62    #[inline]
63    pub fn new() -> Self {
64        Self::builder().build()
65    }
66    #[inline]
67    pub fn title(&self) -> Option<&str> {
68        self.title.as_ref().map(|o| &**o)
69    }
70    #[inline]
71    pub fn symbol(&self) -> Option<&super::UpdateSymbol> {
72        self.symbol.as_ref().map(|o| &**o)
73    }
74    #[inline]
75    pub fn color(&self) -> Option<&super::UpdateColor> {
76        self.color.as_ref().map(|o| &**o)
77    }
78    #[inline]
79    pub fn search_state(&self) -> Option<&super::SearchState> {
80        self.search_state.as_ref().map(|o| &**o)
81    }
82    #[inline]
83    pub fn display_state(&self) -> Option<&super::DisplayState> {
84        self.display_state.as_ref().map(|o| &**o)
85    }
86    #[inline]
87    pub fn index(&self) -> Option<i32> {
88        self.index.as_ref().map(|o| *o)
89    }
90}