Skip to main content

nominal_api/conjure/objects/ingest/workflow/api/
object_locator.rs

1/// Locator for files in an object store.
2/// Clients are expected to have auth and origin/region configured independently.
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 ObjectLocator {
18    #[builder(into)]
19    #[serde(rename = "bucket")]
20    bucket: String,
21    #[builder(into)]
22    #[serde(rename = "objectName")]
23    object_name: String,
24}
25impl ObjectLocator {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new(bucket: impl Into<String>, object_name: impl Into<String>) -> Self {
29        Self::builder().bucket(bucket).object_name(object_name).build()
30    }
31    #[inline]
32    pub fn bucket(&self) -> &str {
33        &*self.bucket
34    }
35    #[inline]
36    pub fn object_name(&self) -> &str {
37        &*self.object_name
38    }
39}