Skip to main content

nominal_api/conjure/objects/storage/writer/api/
write_structs_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 WriteStructsRequest {
16    #[builder(default, list(item(type = super::StructPoint)))]
17    #[serde(rename = "structs", skip_serializing_if = "Vec::is_empty", default)]
18    structs: Vec<super::StructPoint>,
19    #[builder(default, into)]
20    #[serde(rename = "channel", skip_serializing_if = "Option::is_none", default)]
21    channel: Option<super::super::super::super::api::Channel>,
22}
23impl WriteStructsRequest {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new() -> Self {
27        Self::builder().build()
28    }
29    #[inline]
30    pub fn structs(&self) -> &[super::StructPoint] {
31        &*self.structs
32    }
33    /// If provided, the channel to which to write structs.
34    /// If not provided, defaults to "structs"
35    #[inline]
36    pub fn channel(&self) -> Option<&super::super::super::super::api::Channel> {
37        self.channel.as_ref().map(|o| &*o)
38    }
39}