Skip to main content

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

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