Skip to main content

nominal_api/conjure/objects/ingest/api/
internal_ingest_job.rs

1/// Internal ingest job information including the full ingest request details.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct InternalIngestJob {
14    #[serde(rename = "ingestJobRid")]
15    ingest_job_rid: super::IngestJobRid,
16    #[serde(rename = "status")]
17    status: super::IngestJobStatus,
18    #[builder(custom(type = super::IngestJobRequest, convert = Box::new))]
19    #[serde(rename = "ingestJobRequest")]
20    ingest_job_request: Box<super::IngestJobRequest>,
21    #[builder(default, into)]
22    #[serde(rename = "originFiles", skip_serializing_if = "Option::is_none", default)]
23    origin_files: Option<Vec<String>>,
24    #[serde(rename = "createdBy")]
25    created_by: conjure_object::Uuid,
26    #[builder(default, into)]
27    #[serde(rename = "createdByRid", skip_serializing_if = "Option::is_none", default)]
28    created_by_rid: Option<super::super::super::scout::rids::api::UserRid>,
29    #[serde(rename = "orgUuid")]
30    org_uuid: conjure_object::Uuid,
31    #[serde(rename = "ingestType")]
32    ingest_type: super::IngestType,
33    #[builder(default, into)]
34    #[serde(rename = "datasetRid", skip_serializing_if = "Option::is_none", default)]
35    dataset_rid: Option<super::super::super::api::rids::DatasetRid>,
36    #[builder(default, into)]
37    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none", default)]
38    created_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
39}
40impl InternalIngestJob {
41    #[inline]
42    pub fn ingest_job_rid(&self) -> &super::IngestJobRid {
43        &self.ingest_job_rid
44    }
45    #[inline]
46    pub fn status(&self) -> &super::IngestJobStatus {
47        &self.status
48    }
49    #[inline]
50    pub fn ingest_job_request(&self) -> &super::IngestJobRequest {
51        &*self.ingest_job_request
52    }
53    #[inline]
54    pub fn origin_files(&self) -> Option<&[String]> {
55        self.origin_files.as_ref().map(|o| &**o)
56    }
57    #[deprecated(note = "use createdByRid instead")]
58    #[inline]
59    pub fn created_by(&self) -> conjure_object::Uuid {
60        self.created_by
61    }
62    #[inline]
63    pub fn created_by_rid(
64        &self,
65    ) -> Option<&super::super::super::scout::rids::api::UserRid> {
66        self.created_by_rid.as_ref().map(|o| &*o)
67    }
68    #[inline]
69    pub fn org_uuid(&self) -> conjure_object::Uuid {
70        self.org_uuid
71    }
72    #[inline]
73    pub fn ingest_type(&self) -> &super::IngestType {
74        &self.ingest_type
75    }
76    #[inline]
77    pub fn dataset_rid(&self) -> Option<&super::super::super::api::rids::DatasetRid> {
78        self.dataset_rid.as_ref().map(|o| &*o)
79    }
80    #[inline]
81    pub fn created_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
82        self.created_at.as_ref().map(|o| *o)
83    }
84}