#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CreateSavedViewRequest {
#[builder(into)]
#[serde(rename = "title")]
title: String,
#[builder(
default,
custom(
type = impl
Into<Option<super::super::super::api::Symbol>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "symbol", skip_serializing_if = "Option::is_none", default)]
symbol: Option<Box<super::super::super::api::Symbol>>,
#[builder(
default,
custom(
type = impl
Into<Option<super::super::super::api::Color>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "color", skip_serializing_if = "Option::is_none", default)]
color: Option<Box<super::super::super::api::Color>>,
#[builder(custom(type = super::SearchState, convert = Box::new))]
#[serde(rename = "searchState")]
search_state: Box<super::SearchState>,
#[builder(custom(type = super::DisplayState, convert = Box::new))]
#[serde(rename = "displayState")]
display_state: Box<super::DisplayState>,
#[builder(default, into)]
#[serde(rename = "workspaceRid", skip_serializing_if = "Option::is_none", default)]
workspace_rid: Option<super::super::super::super::api::rids::WorkspaceRid>,
}
impl CreateSavedViewRequest {
#[inline]
pub fn new(
title: impl Into<String>,
search_state: super::SearchState,
display_state: super::DisplayState,
) -> Self {
Self::builder()
.title(title)
.search_state(search_state)
.display_state(display_state)
.build()
}
#[inline]
pub fn title(&self) -> &str {
&*self.title
}
#[inline]
pub fn symbol(&self) -> Option<&super::super::super::api::Symbol> {
self.symbol.as_ref().map(|o| &**o)
}
#[inline]
pub fn color(&self) -> Option<&super::super::super::api::Color> {
self.color.as_ref().map(|o| &**o)
}
#[inline]
pub fn search_state(&self) -> &super::SearchState {
&*self.search_state
}
#[inline]
pub fn display_state(&self) -> &super::DisplayState {
&*self.display_state
}
#[inline]
pub fn workspace_rid(
&self,
) -> Option<&super::super::super::super::api::rids::WorkspaceRid> {
self.workspace_rid.as_ref().map(|o| &*o)
}
}