Skip to main content

nominal_api/conjure/objects/authorization/
issue_sandbox_token_request.rs

1/// Request a short-lived bearer token for the sandbox workspace configured on
2/// the gatekeeper service. Intended for in-cluster integration test runners.
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    Copy
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct IssueSandboxTokenRequest {
19    #[builder(default, into)]
20    #[serde(
21        rename = "requestedTtlSeconds",
22        skip_serializing_if = "Option::is_none",
23        default
24    )]
25    requested_ttl_seconds: Option<conjure_object::SafeLong>,
26}
27impl IssueSandboxTokenRequest {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new() -> Self {
31        Self::builder().build()
32    }
33    /// Desired token lifetime in seconds. Capped server-side at 3600 (1h).
34    /// Omit to use the server default (the cap). Non-positive values are
35    /// rejected with SandboxTokenUnavailable rather than silently
36    /// upgraded to the cap.
37    #[inline]
38    pub fn requested_ttl_seconds(&self) -> Option<conjure_object::SafeLong> {
39        self.requested_ttl_seconds.as_ref().map(|o| *o)
40    }
41}