#[non_exhaustive]pub struct GenerateAccessTokenRequest {
pub workstation: String,
pub expiration: Option<Expiration>,
/* private fields */
}Expand description
Request message for GenerateAccessToken.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workstation: StringRequired. Name of the workstation for which the access token should be generated.
expiration: Option<Expiration>Desired expiration or lifetime of the access token.
Implementations§
Source§impl GenerateAccessTokenRequest
impl GenerateAccessTokenRequest
pub fn new() -> Self
Sourcepub fn set_workstation<T: Into<String>>(self, v: T) -> Self
pub fn set_workstation<T: Into<String>>(self, v: T) -> Self
Sets the value of workstation.
§Example
ⓘ
let x = GenerateAccessTokenRequest::new().set_workstation("example");Sourcepub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
pub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
Sets the value of expiration.
Note that all the setters affecting expiration are mutually
exclusive.
§Example
ⓘ
use wkt::Timestamp;
let x = GenerateAccessTokenRequest::new().set_expiration(Some(
google_cloud_workstations_v1::model::generate_access_token_request::Expiration::ExpireTime(Timestamp::default().into())));Sourcepub fn expire_time(&self) -> Option<&Box<Timestamp>>
pub fn expire_time(&self) -> Option<&Box<Timestamp>>
The value of expiration
if it holds a ExpireTime, None if the field is not set or
holds a different branch.
Sourcepub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
pub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
Sets the value of expiration
to hold a ExpireTime.
Note that all the setters affecting expiration are
mutually exclusive.
§Example
ⓘ
use wkt::Timestamp;
let x = GenerateAccessTokenRequest::new().set_expire_time(Timestamp::default()/* use setters */);
assert!(x.expire_time().is_some());
assert!(x.ttl().is_none());Sourcepub fn ttl(&self) -> Option<&Box<Duration>>
pub fn ttl(&self) -> Option<&Box<Duration>>
The value of expiration
if it holds a Ttl, None if the field is not set or
holds a different branch.
Sourcepub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self
pub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self
Sets the value of expiration
to hold a Ttl.
Note that all the setters affecting expiration are
mutually exclusive.
§Example
ⓘ
use wkt::Duration;
let x = GenerateAccessTokenRequest::new().set_ttl(Duration::default()/* use setters */);
assert!(x.ttl().is_some());
assert!(x.expire_time().is_none());Trait Implementations§
Source§impl Clone for GenerateAccessTokenRequest
impl Clone for GenerateAccessTokenRequest
Source§fn clone(&self) -> GenerateAccessTokenRequest
fn clone(&self) -> GenerateAccessTokenRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenerateAccessTokenRequest
impl Debug for GenerateAccessTokenRequest
Source§impl Default for GenerateAccessTokenRequest
impl Default for GenerateAccessTokenRequest
Source§fn default() -> GenerateAccessTokenRequest
fn default() -> GenerateAccessTokenRequest
Returns the “default value” for a type. Read more
Source§impl Message for GenerateAccessTokenRequest
impl Message for GenerateAccessTokenRequest
impl StructuralPartialEq for GenerateAccessTokenRequest
Auto Trait Implementations§
impl Freeze for GenerateAccessTokenRequest
impl RefUnwindSafe for GenerateAccessTokenRequest
impl Send for GenerateAccessTokenRequest
impl Sync for GenerateAccessTokenRequest
impl Unpin for GenerateAccessTokenRequest
impl UnsafeUnpin for GenerateAccessTokenRequest
impl UnwindSafe for GenerateAccessTokenRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more