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<super::super::super::api::rids::ContainerImageRid>,
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: super::super::super::api::rids::WorkspaceRid,
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: super::super::super::api::rids::WorkspaceRid,
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(
121        &self,
122    ) -> Option<&super::super::super::api::rids::ContainerImageRid> {
123        self.container_image_rid.as_ref().map(|o| &*o)
124    }
125    /// payload must match input defined in containerized extraction
126    #[inline]
127    pub fn inputs(&self) -> &[super::FileExtractionInput] {
128        &*self.inputs
129    }
130    /// Describes the parameters of the extractor.
131    #[inline]
132    pub fn parameters(&self) -> &[super::FileExtractionParameter] {
133        &*self.parameters
134    }
135    #[inline]
136    pub fn properties(
137        &self,
138    ) -> &std::collections::BTreeMap<
139        super::super::super::api::PropertyName,
140        super::super::super::api::PropertyValue,
141    > {
142        &self.properties
143    }
144    #[inline]
145    pub fn labels(
146        &self,
147    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
148        &self.labels
149    }
150    /// The workspace in which to create the extractor
151    #[inline]
152    pub fn workspace(&self) -> &super::super::super::api::rids::WorkspaceRid {
153        &self.workspace
154    }
155    /// Metadata about the intermediate parquet this extractor will produce.
156    /// If not set, timestamp metadata must be provided at ingest time.
157    #[inline]
158    pub fn timestamp_metadata(&self) -> Option<&super::TimestampMetadata> {
159        self.timestamp_metadata.as_ref().map(|o| &**o)
160    }
161    /// The format of the output file. Currently only "parquet", "csv", "parquet.tar" are supported
162    #[inline]
163    pub fn output_file_format(&self) -> Option<&super::FileOutputFormat> {
164        self.output_file_format.as_ref().map(|o| &*o)
165    }
166}