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(
46        default,
47        map(
48            key(type = super::super::super::api::PropertyName),
49            value(type = super::super::super::api::PropertyValue)
50        )
51    )]
52    #[serde(
53        rename = "properties",
54        skip_serializing_if = "std::collections::BTreeMap::is_empty",
55        default
56    )]
57    properties: std::collections::BTreeMap<
58        super::super::super::api::PropertyName,
59        super::super::super::api::PropertyValue,
60    >,
61    #[builder(default, set(item(type = super::super::super::api::Label)))]
62    #[serde(
63        rename = "labels",
64        skip_serializing_if = "std::collections::BTreeSet::is_empty",
65        default
66    )]
67    labels: std::collections::BTreeSet<super::super::super::api::Label>,
68    #[serde(rename = "workspace")]
69    workspace: conjure_object::ResourceIdentifier,
70    #[builder(
71        default,
72        custom(
73            type = impl
74            Into<Option<super::TimestampMetadata>>,
75            convert = |v|v.into().map(Box::new)
76        )
77    )]
78    #[serde(
79        rename = "timestampMetadata",
80        skip_serializing_if = "Option::is_none",
81        default
82    )]
83    timestamp_metadata: Option<Box<super::TimestampMetadata>>,
84    #[builder(default, into)]
85    #[serde(
86        rename = "outputFileFormat",
87        skip_serializing_if = "Option::is_none",
88        default
89    )]
90    output_file_format: Option<super::FileOutputFormat>,
91}
92impl RegisterContainerizedExtractorRequest {
93    /// Constructs a new instance of the type.
94    #[inline]
95    pub fn new(
96        name: impl Into<String>,
97        workspace: conjure_object::ResourceIdentifier,
98    ) -> Self {
99        Self::builder().name(name).workspace(workspace).build()
100    }
101    #[inline]
102    pub fn name(&self) -> &str {
103        &*self.name
104    }
105    #[inline]
106    pub fn description(&self) -> Option<&str> {
107        self.description.as_ref().map(|o| &**o)
108    }
109    /// Deprecated: use containerImageRid instead for self-hosted images.
110    /// Container image for the extractor. Used for external registries.
111    /// Ignored when containerImageRid is set.
112    #[deprecated(note = "Use containerImageRid for self-hosted images.")]
113    #[inline]
114    pub fn image(&self) -> Option<&super::DockerImageSource> {
115        self.image.as_ref().map(|o| &**o)
116    }
117    /// RID of a self-hosted container image. When set, the extractor uses the internal registry
118    /// and the image field is ignored.
119    #[inline]
120    pub fn container_image_rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
121        self.container_image_rid.as_ref().map(|o| &*o)
122    }
123    /// payload must match input defined in containerized extraction
124    #[inline]
125    pub fn inputs(&self) -> &[super::FileExtractionInput] {
126        &*self.inputs
127    }
128    /// Describes the parameters of the extractor.
129    #[inline]
130    pub fn parameters(&self) -> &[super::FileExtractionParameter] {
131        &*self.parameters
132    }
133    #[inline]
134    pub fn properties(
135        &self,
136    ) -> &std::collections::BTreeMap<
137        super::super::super::api::PropertyName,
138        super::super::super::api::PropertyValue,
139    > {
140        &self.properties
141    }
142    #[inline]
143    pub fn labels(
144        &self,
145    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
146        &self.labels
147    }
148    /// The workspace in which to create the extractor
149    #[inline]
150    pub fn workspace(&self) -> &conjure_object::ResourceIdentifier {
151        &self.workspace
152    }
153    /// Metadata about the intermediate parquet this extractor will produce.
154    /// If not set, timestamp metadata must be provided at ingest time.
155    #[inline]
156    pub fn timestamp_metadata(&self) -> Option<&super::TimestampMetadata> {
157        self.timestamp_metadata.as_ref().map(|o| &**o)
158    }
159    /// The format of the output file. Currently only "parquet", "csv", "parquet.tar" are supported
160    #[inline]
161    pub fn output_file_format(&self) -> Option<&super::FileOutputFormat> {
162        self.output_file_format.as_ref().map(|o| &*o)
163    }
164}