#[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 AddFileToDataset {
    #[builder(custom(type = super::Handle, convert = Box::new))]
    #[serde(rename = "handle")]
    handle: Box<super::Handle>,
    #[serde(rename = "fileSize")]
    file_size: conjure_object::SafeLong,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::TimestampMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "timestampMetadata",
        skip_serializing_if = "Option::is_none",
        default
    )]
    timestamp_metadata: Option<Box<super::TimestampMetadata>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::IngestTagMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "ingestTagMetadata",
        skip_serializing_if = "Option::is_none",
        default
    )]
    ingest_tag_metadata: Option<Box<super::IngestTagMetadata>>,
    #[builder(default, into)]
    #[serde(
        rename = "originFileHandles",
        skip_serializing_if = "Option::is_none",
        default
    )]
    origin_file_handles: Option<Vec<super::S3Handle>>,
    #[builder(default, into)]
    #[serde(rename = "ingestJobRid", skip_serializing_if = "Option::is_none", default)]
    ingest_job_rid: Option<conjure_object::ResourceIdentifier>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::DatasetFileMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none", default)]
    metadata: Option<Box<super::DatasetFileMetadata>>,
}
impl AddFileToDataset {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(handle: super::Handle, file_size: conjure_object::SafeLong) -> Self {
        Self::builder().handle(handle).file_size(file_size).build()
    }
    #[inline]
    pub fn handle(&self) -> &super::Handle {
        &*self.handle
    }
    /// The size of the file in bytes.
    #[inline]
    pub fn file_size(&self) -> conjure_object::SafeLong {
        self.file_size
    }
    #[inline]
    pub fn timestamp_metadata(&self) -> Option<&super::TimestampMetadata> {
        self.timestamp_metadata.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn ingest_tag_metadata(&self) -> Option<&super::IngestTagMetadata> {
        self.ingest_tag_metadata.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn origin_file_handles(&self) -> Option<&[super::S3Handle]> {
        self.origin_file_handles.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn ingest_job_rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.ingest_job_rid.as_ref().map(|o| &*o)
    }
    /// File-type-specific metadata. For video files, contains timestamp manifest.
    #[inline]
    pub fn metadata(&self) -> Option<&super::DatasetFileMetadata> {
        self.metadata.as_ref().map(|o| &**o)
    }
}
