#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CreateAttachmentRequest {
#[serde(rename = "s3Path")]
s3_path: super::super::super::api::S3Path,
#[builder(into)]
#[serde(rename = "title")]
title: String,
#[builder(into)]
#[serde(rename = "description")]
description: String,
#[builder(
default,
map(
key(type = super::super::super::api::PropertyName),
value(type = super::super::super::api::PropertyValue)
)
)]
#[serde(
rename = "properties",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
properties: std::collections::BTreeMap<
super::super::super::api::PropertyName,
super::super::super::api::PropertyValue,
>,
#[builder(default, set(item(type = super::super::super::api::Label)))]
#[serde(
rename = "labels",
skip_serializing_if = "std::collections::BTreeSet::is_empty",
default
)]
labels: std::collections::BTreeSet<super::super::super::api::Label>,
#[builder(default, into)]
#[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
workspace: Option<super::super::super::api::rids::WorkspaceRid>,
}
impl CreateAttachmentRequest {
#[inline]
pub fn new(
s3_path: super::super::super::api::S3Path,
title: impl Into<String>,
description: impl Into<String>,
) -> Self {
Self::builder().s3_path(s3_path).title(title).description(description).build()
}
#[inline]
pub fn s3_path(&self) -> &super::super::super::api::S3Path {
&self.s3_path
}
#[inline]
pub fn title(&self) -> &str {
&*self.title
}
#[inline]
pub fn description(&self) -> &str {
&*self.description
}
#[inline]
pub fn properties(
&self,
) -> &std::collections::BTreeMap<
super::super::super::api::PropertyName,
super::super::super::api::PropertyValue,
> {
&self.properties
}
#[inline]
pub fn labels(
&self,
) -> &std::collections::BTreeSet<super::super::super::api::Label> {
&self.labels
}
#[inline]
pub fn workspace(&self) -> Option<&super::super::super::api::rids::WorkspaceRid> {
self.workspace.as_ref().map(|o| &*o)
}
}