Skip to main content

nominal_api/conjure/objects/ingest/api/
sign_download_response.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 SignDownloadResponse {
16    #[builder(into)]
17    #[serde(rename = "url")]
18    url: String,
19    #[serde(rename = "expiresAt")]
20    expires_at: conjure_object::DateTime<conjure_object::Utc>,
21}
22impl SignDownloadResponse {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(
26        url: impl Into<String>,
27        expires_at: conjure_object::DateTime<conjure_object::Utc>,
28    ) -> Self {
29        Self::builder().url(url).expires_at(expires_at).build()
30    }
31    /// Short-lived signed GET URL. Expires after 15 minutes.
32    #[inline]
33    pub fn url(&self) -> &str {
34        &*self.url
35    }
36    /// Absolute expiry timestamp. Callers must stop using the URL after this.
37    #[inline]
38    pub fn expires_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
39        self.expires_at
40    }
41}