#[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 CreateSpatialRequest {
#[builder(into)]
#[serde(rename = "title")]
title: String,
#[serde(rename = "daggerUuid")]
dagger_uuid: conjure_object::Uuid,
#[builder(custom(type = super::SpatialTypeMetadata, convert = Box::new))]
#[serde(rename = "typeMetadata")]
type_metadata: Box<super::SpatialTypeMetadata>,
#[builder(default, set(item(type = super::super::super::super::api::Label)))]
#[serde(
rename = "labels",
skip_serializing_if = "std::collections::BTreeSet::is_empty",
default
)]
labels: std::collections::BTreeSet<super::super::super::super::api::Label>,
#[builder(
default,
map(
key(type = super::super::super::super::api::PropertyName),
value(type = super::super::super::super::api::PropertyValue)
)
)]
#[serde(
rename = "properties",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
properties: std::collections::BTreeMap<
super::super::super::super::api::PropertyName,
super::super::super::super::api::PropertyValue,
>,
#[builder(default, set(item(type = super::super::super::rids::api::MarkingRid)))]
#[serde(
rename = "markingRids",
skip_serializing_if = "std::collections::BTreeSet::is_empty",
default
)]
marking_rids: std::collections::BTreeSet<super::super::super::rids::api::MarkingRid>,
#[builder(default, into)]
#[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
description: Option<String>,
#[builder(
default,
custom(
type = impl
Into<Option<super::super::super::super::api::Timestamp>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none", default)]
start_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
#[builder(
default,
custom(
type = impl
Into<Option<super::super::super::super::api::Timestamp>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "endTimestamp", skip_serializing_if = "Option::is_none", default)]
end_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
#[builder(
default,
custom(
type = impl
Into<Option<super::super::super::super::api::Handle>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "sourceHandle", skip_serializing_if = "Option::is_none", default)]
source_handle: Option<Box<super::super::super::super::api::Handle>>,
#[builder(default, into)]
#[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
workspace: Option<super::super::super::super::api::rids::WorkspaceRid>,
}
impl CreateSpatialRequest {
#[inline]
pub fn new(
title: impl Into<String>,
dagger_uuid: conjure_object::Uuid,
type_metadata: super::SpatialTypeMetadata,
) -> Self {
Self::builder()
.title(title)
.dagger_uuid(dagger_uuid)
.type_metadata(type_metadata)
.build()
}
#[inline]
pub fn title(&self) -> &str {
&*self.title
}
#[inline]
pub fn dagger_uuid(&self) -> conjure_object::Uuid {
self.dagger_uuid
}
#[inline]
pub fn type_metadata(&self) -> &super::SpatialTypeMetadata {
&*self.type_metadata
}
#[inline]
pub fn labels(
&self,
) -> &std::collections::BTreeSet<super::super::super::super::api::Label> {
&self.labels
}
#[inline]
pub fn properties(
&self,
) -> &std::collections::BTreeMap<
super::super::super::super::api::PropertyName,
super::super::super::super::api::PropertyValue,
> {
&self.properties
}
#[inline]
pub fn marking_rids(
&self,
) -> &std::collections::BTreeSet<super::super::super::rids::api::MarkingRid> {
&self.marking_rids
}
#[inline]
pub fn description(&self) -> Option<&str> {
self.description.as_ref().map(|o| &**o)
}
#[inline]
pub fn start_timestamp(
&self,
) -> Option<&super::super::super::super::api::Timestamp> {
self.start_timestamp.as_ref().map(|o| &**o)
}
#[inline]
pub fn end_timestamp(&self) -> Option<&super::super::super::super::api::Timestamp> {
self.end_timestamp.as_ref().map(|o| &**o)
}
#[inline]
pub fn source_handle(&self) -> Option<&super::super::super::super::api::Handle> {
self.source_handle.as_ref().map(|o| &**o)
}
#[inline]
pub fn workspace(
&self,
) -> Option<&super::super::super::super::api::rids::WorkspaceRid> {
self.workspace.as_ref().map(|o| &*o)
}
}