#[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 IngestMcapRequest {
    #[builder(default, list(item(type = super::IngestSource)))]
    #[serde(rename = "sources", skip_serializing_if = "Vec::is_empty", default)]
    sources: Vec<super::IngestSource>,
    #[builder(default, list(item(type = super::McapChannelConfig)))]
    #[serde(rename = "channelConfig", skip_serializing_if = "Vec::is_empty", default)]
    channel_config: Vec<super::McapChannelConfig>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::McapChannels>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "channels", skip_serializing_if = "Option::is_none", default)]
    channels: Option<Box<super::McapChannels>>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(default, into)]
    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
    title: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
    workspace: Option<conjure_object::ResourceIdentifier>,
}
impl IngestMcapRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    /// List of files in S3 to be ingested. These should be ordered by time, as data will be ingested and
    /// concatenated across all the files.
    /// Note: only a single files are currently supported, this field is mostly for forward compatibility.
    #[inline]
    pub fn sources(&self) -> &[super::IngestSource] {
        &*self.sources
    }
    #[inline]
    pub fn channel_config(&self) -> &[super::McapChannelConfig] {
        &*self.channel_config
    }
    /// Config to define which channels in the mcap should be ingested. The default is to ingest only
    /// channels with config, otherwise the mcap may not be supported.
    #[inline]
    pub fn channels(&self) -> Option<&super::McapChannels> {
        self.channels.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    #[inline]
    pub fn title(&self) -> Option<&str> {
        self.title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    /// The workspace in which to create the dataset or video. If not provided, the dataset or video
    /// will be created in the default workspace for the user's organization, if the default
    /// workspace for the organization is configured.
    #[inline]
    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.workspace.as_ref().map(|o| &*o)
    }
}
