Skip to main content

nominal_api/conjure/objects/ingest/manifest/
upload_metadata.rs

1/// Metadata about a single file uploaded to S3 by yeeter.
2/// Enriches the original manifest entry with S3 upload information.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct UploadMetadata {
18    #[builder(into)]
19    #[serde(rename = "s3Key")]
20    s3_key: String,
21    #[builder(into)]
22    #[serde(rename = "s3Bucket")]
23    s3_bucket: String,
24    #[builder(custom(type = super::ManifestOutput, convert = Box::new))]
25    #[serde(rename = "manifestOutput")]
26    manifest_output: Box<super::ManifestOutput>,
27}
28impl UploadMetadata {
29    /// Constructs a new instance of the type.
30    #[inline]
31    pub fn new(
32        s3_key: impl Into<String>,
33        s3_bucket: impl Into<String>,
34        manifest_output: super::ManifestOutput,
35    ) -> Self {
36        Self::builder()
37            .s3_key(s3_key)
38            .s3_bucket(s3_bucket)
39            .manifest_output(manifest_output)
40            .build()
41    }
42    /// Full S3 key where the file was uploaded
43    #[inline]
44    pub fn s3_key(&self) -> &str {
45        &*self.s3_key
46    }
47    /// S3 bucket name where the file was uploaded
48    #[inline]
49    pub fn s3_bucket(&self) -> &str {
50        &*self.s3_bucket
51    }
52    /// The original manifest entry from the container's manifest.yaml
53    #[inline]
54    pub fn manifest_output(&self) -> &super::ManifestOutput {
55        &*self.manifest_output
56    }
57}