#[non_exhaustive]pub struct GenerateAccessTokenRequest {
pub workstation: String,
pub port: i32,
pub expiration: Option<Expiration>,
/* private fields */
}Expand description
Request message for GenerateAccessToken.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
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.
port: i32Optional. Port for which the access token should be generated. If specified, the generated access token grants access only to the specified port of the workstation. If specified, values must be within the range [1 - 65535]. If not specified, the generated access token grants access to all ports of the workstation.
expiration: Option<Expiration>Desired expiration or lifetime of the access token.
Implementations§
Source§impl GenerateAccessTokenRequest
impl GenerateAccessTokenRequest
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(format!("projects/{project_id}/locations/{location_id}/workstationClusters/{workstation_cluster_id}/workstationConfigs/{workstation_config_id}/workstations/{workstation_id}"));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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Source§impl Message for GenerateAccessTokenRequest
impl Message for GenerateAccessTokenRequest
Source§impl PartialEq for GenerateAccessTokenRequest
impl PartialEq for GenerateAccessTokenRequest
Source§fn eq(&self, other: &GenerateAccessTokenRequest) -> bool
fn eq(&self, other: &GenerateAccessTokenRequest) -> bool
self and other values to be equal, and is used by ==.