#[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 DatasetFile {
    #[serde(rename = "id")]
    id: super::super::super::datasource::DatasetFileId,
    #[serde(rename = "datasetRid")]
    dataset_rid: conjure_object::ResourceIdentifier,
    #[builder(into)]
    #[serde(rename = "name")]
    name: String,
    #[builder(custom(type = super::Handle, convert = Box::new))]
    #[serde(rename = "handle")]
    handle: Box<super::Handle>,
    #[builder(default, into)]
    #[serde(rename = "fileSizeBytes", skip_serializing_if = "Option::is_none", default)]
    file_size_bytes: Option<conjure_object::SafeLong>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::Bounds>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "bounds", skip_serializing_if = "Option::is_none", default)]
    bounds: Option<Box<super::Bounds>>,
    #[serde(rename = "uploadedAt")]
    uploaded_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(default, into)]
    #[serde(rename = "ingestedAt", skip_serializing_if = "Option::is_none", default)]
    ingested_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(
        custom(type = super::super::super::api::IngestStatusV2, convert = Box::new)
    )]
    #[serde(rename = "ingestStatus")]
    ingest_status: Box<super::super::super::api::IngestStatusV2>,
    #[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 = "originFilePaths",
        skip_serializing_if = "Option::is_none",
        default
    )]
    origin_file_paths: Option<Vec<String>>,
    #[builder(default, into)]
    #[serde(rename = "ingestJobRid", skip_serializing_if = "Option::is_none", default)]
    ingest_job_rid: Option<conjure_object::ResourceIdentifier>,
    #[builder(default, into)]
    #[serde(rename = "deletedAt", skip_serializing_if = "Option::is_none", default)]
    deleted_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[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 DatasetFile {
    #[inline]
    pub fn id(&self) -> super::super::super::datasource::DatasetFileId {
        self.id
    }
    #[inline]
    pub fn dataset_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.dataset_rid
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn handle(&self) -> &super::Handle {
        &*self.handle
    }
    /// Size in bytes of the stored dataset file; for transforming ingests this is the produced output, not the original upload.
    #[inline]
    pub fn file_size_bytes(&self) -> Option<conjure_object::SafeLong> {
        self.file_size_bytes.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn bounds(&self) -> Option<&super::Bounds> {
        self.bounds.as_ref().map(|o| &**o)
    }
    /// Timestamp that the file was received and stored, but not processed or made available to consumers.
    #[inline]
    pub fn uploaded_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.uploaded_at
    }
    /// Timestamp that the file is ingested at and made available for processing. If the file has failed to be
    /// ingested for any reason or is still being processed, then this value will be empty.
    #[inline]
    pub fn ingested_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.ingested_at.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn ingest_status(&self) -> &super::super::super::api::IngestStatusV2 {
        &*self.ingest_status
    }
    #[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_paths(&self) -> Option<&[String]> {
        self.origin_file_paths.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)
    }
    /// Timestamp that the file is deleted at, only present if the file has been deleted.
    #[inline]
    pub fn deleted_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.deleted_at.as_ref().map(|o| *o)
    }
    /// File-type-specific metadata. For video files, contains timestamp manifest and segment metadata.
    #[inline]
    pub fn metadata(&self) -> Option<&super::DatasetFileMetadata> {
        self.metadata.as_ref().map(|o| &**o)
    }
}
