Skip to main content

nominal_api/conjure/objects/ingest/workflow/api/
validated_file_input.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 ValidatedFileInput {
16    #[builder(
17        custom(
18            type = super::super::super::super::scout::catalog::S3Handle,
19            convert = Box::new
20        )
21    )]
22    #[serde(rename = "handle")]
23    handle: Box<super::super::super::super::scout::catalog::S3Handle>,
24    #[builder(into)]
25    #[serde(rename = "fileName")]
26    file_name: String,
27    #[builder(into)]
28    #[serde(rename = "envVar")]
29    env_var: String,
30}
31impl ValidatedFileInput {
32    /// Constructs a new instance of the type.
33    #[inline]
34    pub fn new(
35        handle: super::super::super::super::scout::catalog::S3Handle,
36        file_name: impl Into<String>,
37        env_var: impl Into<String>,
38    ) -> Self {
39        Self::builder().handle(handle).file_name(file_name).env_var(env_var).build()
40    }
41    /// Path to the input file in S3.
42    #[inline]
43    pub fn handle(&self) -> &super::super::super::super::scout::catalog::S3Handle {
44        &*self.handle
45    }
46    /// Name of the file that will be placed on disk.
47    #[inline]
48    pub fn file_name(&self) -> &str {
49        &*self.file_name
50    }
51    /// Environment variable that will store the path to the file.
52    #[inline]
53    pub fn env_var(&self) -> &str {
54        &*self.env_var
55    }
56}