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<super::super::super::api::rids::ContainerImageRid>,
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(
42        default,
43        map(
44            key(type = super::super::super::api::PropertyName),
45            value(type = super::super::super::api::PropertyValue)
46        )
47    )]
48    #[serde(
49        rename = "properties",
50        skip_serializing_if = "std::collections::BTreeMap::is_empty",
51        default
52    )]
53    properties: std::collections::BTreeMap<
54        super::super::super::api::PropertyName,
55        super::super::super::api::PropertyValue,
56    >,
57    #[builder(default, set(item(type = super::super::super::api::Label)))]
58    #[serde(
59        rename = "labels",
60        skip_serializing_if = "std::collections::BTreeSet::is_empty",
61        default
62    )]
63    labels: std::collections::BTreeSet<super::super::super::api::Label>,
64    #[serde(rename = "createdAt")]
65    created_at: conjure_object::DateTime<conjure_object::Utc>,
66    #[serde(rename = "isArchived")]
67    is_archived: bool,
68    #[builder(
69        default,
70        custom(
71            type = impl
72            Into<Option<super::TimestampMetadata>>,
73            convert = |v|v.into().map(Box::new)
74        )
75    )]
76    #[serde(
77        rename = "timestampMetadata",
78        skip_serializing_if = "Option::is_none",
79        default
80    )]
81    timestamp_metadata: Option<Box<super::TimestampMetadata>>,
82    #[serde(rename = "outputFileFormat")]
83    output_file_format: super::FileOutputFormat,
84}
85impl ContainerizedExtractor {
86    /// Unique resource identifier for the extractor.
87    #[inline]
88    pub fn rid(&self) -> &super::ContainerizedExtractorRid {
89        &self.rid
90    }
91    /// The name of the extractor as defined by the user.
92    #[inline]
93    pub fn name(&self) -> &str {
94        &*self.name
95    }
96    /// Optional description of the extractor.
97    #[inline]
98    pub fn description(&self) -> Option<&str> {
99        self.description.as_ref().map(|o| &**o)
100    }
101    /// Deprecated: use containerImageRid instead for self-hosted images.
102    /// Container image used to run the extractor via an external registry.
103    /// When containerImageRid is set, this field contains placeholder values and should be ignored.
104    #[deprecated(note = "Use containerImageRid for self-hosted images.")]
105    #[inline]
106    pub fn image(&self) -> &super::DockerImageSource {
107        &*self.image
108    }
109    /// RID of a self-hosted container image in the internal registry.
110    /// When set, the extractor uses the internal registry; when absent, the legacy image field is used.
111    #[inline]
112    pub fn container_image_rid(
113        &self,
114    ) -> Option<&super::super::super::api::rids::ContainerImageRid> {
115        self.container_image_rid.as_ref().map(|o| &*o)
116    }
117    /// The input files that this extractor requires, mapped to environment variables that store the path to the file.
118    #[inline]
119    pub fn inputs(&self) -> &[super::FileExtractionInput] {
120        &*self.inputs
121    }
122    /// Describes the parameters of the extractor.
123    #[inline]
124    pub fn parameters(&self) -> &[super::FileExtractionParameter] {
125        &*self.parameters
126    }
127    /// Additional properties associated with this extractor.
128    #[inline]
129    pub fn properties(
130        &self,
131    ) -> &std::collections::BTreeMap<
132        super::super::super::api::PropertyName,
133        super::super::super::api::PropertyValue,
134    > {
135        &self.properties
136    }
137    /// Set of labels applied to this extractor.
138    #[inline]
139    pub fn labels(
140        &self,
141    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
142        &self.labels
143    }
144    /// Timestamp when this extractor was created.
145    #[inline]
146    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
147        self.created_at
148    }
149    /// Whether this extractor is archived.
150    #[inline]
151    pub fn is_archived(&self) -> bool {
152        self.is_archived
153    }
154    /// Metadata about the intermediate parquet this extractor will produce.
155    /// If not set, timestamp metadata must be provided at ingest time.
156    #[inline]
157    pub fn timestamp_metadata(&self) -> Option<&super::TimestampMetadata> {
158        self.timestamp_metadata.as_ref().map(|o| &**o)
159    }
160    /// The format of the output file. Currently only "parquet", "csv", "parquet.tar" are supported
161    #[inline]
162    pub fn output_file_format(&self) -> &super::FileOutputFormat {
163        &self.output_file_format
164    }
165}