/// Internal ingest job information including the full ingest request details.
#[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 InternalIngestJob {
    #[serde(rename = "ingestJobRid")]
    ingest_job_rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "status")]
    status: super::IngestJobStatus,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::IngestJobRequest>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "ingestJobRequest",
        skip_serializing_if = "Option::is_none",
        default
    )]
    ingest_job_request: Option<Box<super::IngestJobRequest>>,
    #[builder(default, into)]
    #[serde(rename = "originFiles", skip_serializing_if = "Option::is_none", default)]
    origin_files: Option<Vec<String>>,
    #[serde(rename = "createdBy")]
    created_by: conjure_object::Uuid,
    #[builder(default, into)]
    #[serde(rename = "createdByRid", skip_serializing_if = "Option::is_none", default)]
    created_by_rid: Option<super::super::super::scout::rids::api::UserRid>,
    #[serde(rename = "orgUuid")]
    org_uuid: conjure_object::Uuid,
    #[serde(rename = "ingestType")]
    ingest_type: super::IngestType,
    #[builder(default, into)]
    #[serde(rename = "datasetRid", skip_serializing_if = "Option::is_none", default)]
    dataset_rid: Option<conjure_object::ResourceIdentifier>,
    #[builder(default, into)]
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none", default)]
    created_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(default, into)]
    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none", default)]
    start_time: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(default, into)]
    #[serde(rename = "endTime", skip_serializing_if = "Option::is_none", default)]
    end_time: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(default, into)]
    #[serde(
        rename = "producedFileCount",
        skip_serializing_if = "Option::is_none",
        default
    )]
    produced_file_count: Option<i32>,
}
impl InternalIngestJob {
    #[inline]
    pub fn ingest_job_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.ingest_job_rid
    }
    #[inline]
    pub fn status(&self) -> &super::IngestJobStatus {
        &self.status
    }
    #[inline]
    pub fn ingest_job_request(&self) -> Option<&super::IngestJobRequest> {
        self.ingest_job_request.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn origin_files(&self) -> Option<&[String]> {
        self.origin_files.as_ref().map(|o| &**o)
    }
    #[deprecated(note = "use createdByRid instead")]
    #[inline]
    pub fn created_by(&self) -> conjure_object::Uuid {
        self.created_by
    }
    #[inline]
    pub fn created_by_rid(
        &self,
    ) -> Option<&super::super::super::scout::rids::api::UserRid> {
        self.created_by_rid.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn org_uuid(&self) -> conjure_object::Uuid {
        self.org_uuid
    }
    #[inline]
    pub fn ingest_type(&self) -> &super::IngestType {
        &self.ingest_type
    }
    #[inline]
    pub fn dataset_rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.dataset_rid.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn created_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.created_at.as_ref().map(|o| *o)
    }
    /// The time the job transitioned to IN_PROGRESS. Absent for jobs that have not started running yet
    /// (SUBMITTED, QUEUED).
    #[inline]
    pub fn start_time(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.start_time.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn end_time(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.end_time.as_ref().map(|o| *o)
    }
    /// Count of dataset files produced by this ingest job.
    #[inline]
    pub fn produced_file_count(&self) -> Option<i32> {
        self.produced_file_count.as_ref().map(|o| *o)
    }
}
