Skip to main content

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

1/// Represents a containerized extractor that processes input files using a container.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct ContainerizedExtractor {
17    #[serde(rename = "rid")]
18    rid: super::ContainerizedExtractorRid,
19    #[builder(into)]
20    #[serde(rename = "name")]
21    name: String,
22    #[builder(default, into)]
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
24    description: Option<String>,
25    #[builder(custom(type = super::DockerImageSource, convert = Box::new))]
26    #[serde(rename = "image")]
27    image: Box<super::DockerImageSource>,
28    #[builder(default, into)]
29    #[serde(
30        rename = "containerImageRid",
31        skip_serializing_if = "Option::is_none",
32        default
33    )]
34    container_image_rid: Option<conjure_object::ResourceIdentifier>,
35    #[builder(default, list(item(type = super::FileExtractionInput)))]
36    #[serde(rename = "inputs", skip_serializing_if = "Vec::is_empty", default)]
37    inputs: Vec<super::FileExtractionInput>,
38    #[builder(default, list(item(type = super::FileExtractionParameter)))]
39    #[serde(rename = "parameters", skip_serializing_if = "Vec::is_empty", default)]
40    parameters: Vec<super::FileExtractionParameter>,
41    #[builder(default, map(key(type = String, into), value(type = String, into)))]
42    #[serde(
43        rename = "properties",
44        skip_serializing_if = "std::collections::BTreeMap::is_empty",
45        default
46    )]
47    properties: std::collections::BTreeMap<String, String>,
48    #[builder(default, set(item(type = String, into)))]
49    #[serde(
50        rename = "labels",
51        skip_serializing_if = "std::collections::BTreeSet::is_empty",
52        default
53    )]
54    labels: std::collections::BTreeSet<String>,
55    #[serde(rename = "createdAt")]
56    created_at: conjure_object::DateTime<conjure_object::Utc>,
57    #[serde(rename = "isArchived")]
58    is_archived: bool,
59    #[builder(
60        default,
61        custom(
62            type = impl
63            Into<Option<super::TimestampMetadata>>,
64            convert = |v|v.into().map(Box::new)
65        )
66    )]
67    #[serde(
68        rename = "timestampMetadata",
69        skip_serializing_if = "Option::is_none",
70        default
71    )]
72    timestamp_metadata: Option<Box<super::TimestampMetadata>>,
73    #[serde(rename = "outputFileFormat")]
74    output_file_format: super::FileOutputFormat,
75}
76impl ContainerizedExtractor {
77    /// Unique resource identifier for the extractor.
78    #[inline]
79    pub fn rid(&self) -> &super::ContainerizedExtractorRid {
80        &self.rid
81    }
82    /// The name of the extractor as defined by the user.
83    #[inline]
84    pub fn name(&self) -> &str {
85        &*self.name
86    }
87    /// Optional description of the extractor.
88    #[inline]
89    pub fn description(&self) -> Option<&str> {
90        self.description.as_ref().map(|o| &**o)
91    }
92    /// Deprecated: use containerImageRid instead for self-hosted images.
93    /// Container image used to run the extractor via an external registry.
94    /// When containerImageRid is set, this field contains placeholder values and should be ignored.
95    #[deprecated(note = "Use containerImageRid for self-hosted images.")]
96    #[inline]
97    pub fn image(&self) -> &super::DockerImageSource {
98        &*self.image
99    }
100    /// RID of a self-hosted container image in the internal registry.
101    /// When set, the extractor uses the internal registry; when absent, the legacy image field is used.
102    #[inline]
103    pub fn container_image_rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
104        self.container_image_rid.as_ref().map(|o| &*o)
105    }
106    /// The input files that this extractor requires, mapped to environment variables that store the path to the file.
107    #[inline]
108    pub fn inputs(&self) -> &[super::FileExtractionInput] {
109        &*self.inputs
110    }
111    /// Describes the parameters of the extractor.
112    #[inline]
113    pub fn parameters(&self) -> &[super::FileExtractionParameter] {
114        &*self.parameters
115    }
116    /// Additional properties associated with this extractor.
117    #[inline]
118    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
119        &self.properties
120    }
121    /// Set of labels applied to this extractor.
122    #[inline]
123    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
124        &self.labels
125    }
126    /// Timestamp when this extractor was created.
127    #[inline]
128    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
129        self.created_at
130    }
131    /// Whether this extractor is archived.
132    #[inline]
133    pub fn is_archived(&self) -> bool {
134        self.is_archived
135    }
136    /// Metadata about the intermediate parquet this extractor will produce.
137    /// If not set, timestamp metadata must be provided at ingest time.
138    #[inline]
139    pub fn timestamp_metadata(&self) -> Option<&super::TimestampMetadata> {
140        self.timestamp_metadata.as_ref().map(|o| &**o)
141    }
142    /// The format of the output file. Currently only "parquet", "csv", "parquet.tar" are supported
143    #[inline]
144    pub fn output_file_format(&self) -> &super::FileOutputFormat {
145        &self.output_file_format
146    }
147}