Skip to main content

nominal_api_conjure/conjure/objects/ingest/api/
ingest_transform.rs

1/// A single transform within an ingest job: one unit of extraction/processing work. Surfaces
2/// status, type, and error details so callers can monitor and alert on ingest pipelines.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct IngestTransform {
18    #[serde(rename = "ingestTransformRid")]
19    ingest_transform_rid: super::IngestTransformRid,
20    #[serde(rename = "ingestJobRid")]
21    ingest_job_rid: super::IngestJobRid,
22    #[serde(rename = "transformType")]
23    transform_type: super::IngestTransformType,
24    #[serde(rename = "status")]
25    status: super::IngestTransformStatus,
26    #[serde(rename = "createdAt")]
27    created_at: conjure_object::DateTime<conjure_object::Utc>,
28    #[serde(rename = "updatedAt")]
29    updated_at: conjure_object::DateTime<conjure_object::Utc>,
30    #[builder(default, into)]
31    #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none", default)]
32    error_message: Option<String>,
33    #[builder(default, into)]
34    #[serde(rename = "finishedAt", skip_serializing_if = "Option::is_none", default)]
35    finished_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
36    #[builder(default, into)]
37    #[serde(rename = "extractorRid", skip_serializing_if = "Option::is_none", default)]
38    extractor_rid: Option<super::ContainerizedExtractorRid>,
39    #[builder(default, list(item(type = String, into)))]
40    #[serde(rename = "sourcePaths", skip_serializing_if = "Vec::is_empty", default)]
41    source_paths: Vec<String>,
42}
43impl IngestTransform {
44    #[inline]
45    pub fn ingest_transform_rid(&self) -> &super::IngestTransformRid {
46        &self.ingest_transform_rid
47    }
48    /// The ingest job this transform belongs to.
49    #[inline]
50    pub fn ingest_job_rid(&self) -> &super::IngestJobRid {
51        &self.ingest_job_rid
52    }
53    #[inline]
54    pub fn transform_type(&self) -> &super::IngestTransformType {
55        &self.transform_type
56    }
57    #[inline]
58    pub fn status(&self) -> &super::IngestTransformStatus {
59        &self.status
60    }
61    #[inline]
62    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
63        self.created_at
64    }
65    #[inline]
66    pub fn updated_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
67        self.updated_at
68    }
69    /// The failure detail recorded when the transform terminated. Present only for FAILED
70    /// transforms. May contain customer-derived content and is therefore not safe to log.
71    #[inline]
72    pub fn error_message(&self) -> Option<&str> {
73        self.error_message.as_ref().map(|o| &**o)
74    }
75    /// The time the transform reached a terminal status (COMPLETED or FAILED). Absent while the
76    /// transform is still QUEUED or IN_PROGRESS.
77    #[inline]
78    pub fn finished_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
79        self.finished_at.as_ref().map(|o| *o)
80    }
81    /// The containerized extractor running this transform. Present only for CONTAINERIZED transforms.
82    #[inline]
83    pub fn extractor_rid(&self) -> Option<&super::ContainerizedExtractorRid> {
84        self.extractor_rid.as_ref().map(|o| &*o)
85    }
86    /// Locators of the transform's input file(s): S3/GCS paths, presigned URLs (query string
87    /// stripped so no signing credentials are carried), or File Store file-revision rids.
88    /// CONTAINERIZED transforms may have several inputs, ordered by the container environment
89    /// variable they bind to; other types have exactly one. Empty when this server version
90    /// cannot interpret the stored payload. May contain customer-derived content and is
91    /// therefore not safe to log.
92    #[inline]
93    pub fn source_paths(&self) -> &[String] {
94        &*self.source_paths
95    }
96}