#[non_exhaustive]pub struct ApprovalRequest {
pub name: String,
pub requested_resource_name: String,
pub requested_resource_properties: Option<ResourceProperties>,
pub requested_reason: Option<AccessReason>,
pub requested_locations: Option<AccessLocations>,
pub request_time: Option<Timestamp>,
pub requested_expiration: Option<Timestamp>,
pub decision: Option<Decision>,
/* private fields */
}Expand description
A request for the customer to approve access to a resource.
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.name: StringThe resource name of the request. Format is “{projects|folders|organizations}/{id}/approvalRequests/{approval_request}”.
requested_resource_name: StringThe resource for which approval is being requested. The format of the resource name is defined at https://cloud.google.com/apis/design/resource_names. The resource name here may either be a “full” resource name (e.g. “//library.googleapis.com/shelves/shelf1/books/book2”) or a “relative” resource name (e.g. “shelves/shelf1/books/book2”) as described in the resource name specification.
requested_resource_properties: Option<ResourceProperties>Properties related to the resource represented by requested_resource_name.
requested_reason: Option<AccessReason>The justification for which approval is being requested.
requested_locations: Option<AccessLocations>The locations for which approval is being requested.
request_time: Option<Timestamp>The time at which approval was requested.
requested_expiration: Option<Timestamp>The requested expiration for the approval. If the request is approved, access will be granted from the time of approval until the expiration time.
decision: Option<Decision>The current decision on the approval request.
Implementations§
Source§impl ApprovalRequest
impl ApprovalRequest
pub fn new() -> Self
Sourcepub fn set_requested_resource_name<T: Into<String>>(self, v: T) -> Self
pub fn set_requested_resource_name<T: Into<String>>(self, v: T) -> Self
Sets the value of requested_resource_name.
§Example
let x = ApprovalRequest::new().set_requested_resource_name("example");Sourcepub fn set_requested_resource_properties<T>(self, v: T) -> Selfwhere
T: Into<ResourceProperties>,
pub fn set_requested_resource_properties<T>(self, v: T) -> Selfwhere
T: Into<ResourceProperties>,
Sets the value of requested_resource_properties.
§Example
use google_cloud_accessapproval_v1::model::ResourceProperties;
let x = ApprovalRequest::new().set_requested_resource_properties(ResourceProperties::default()/* use setters */);Sourcepub fn set_or_clear_requested_resource_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourceProperties>,
pub fn set_or_clear_requested_resource_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourceProperties>,
Sets or clears the value of requested_resource_properties.
§Example
use google_cloud_accessapproval_v1::model::ResourceProperties;
let x = ApprovalRequest::new().set_or_clear_requested_resource_properties(Some(ResourceProperties::default()/* use setters */));
let x = ApprovalRequest::new().set_or_clear_requested_resource_properties(None::<ResourceProperties>);Sourcepub fn set_requested_reason<T>(self, v: T) -> Selfwhere
T: Into<AccessReason>,
pub fn set_requested_reason<T>(self, v: T) -> Selfwhere
T: Into<AccessReason>,
Sets the value of requested_reason.
§Example
use google_cloud_accessapproval_v1::model::AccessReason;
let x = ApprovalRequest::new().set_requested_reason(AccessReason::default()/* use setters */);Sourcepub fn set_or_clear_requested_reason<T>(self, v: Option<T>) -> Selfwhere
T: Into<AccessReason>,
pub fn set_or_clear_requested_reason<T>(self, v: Option<T>) -> Selfwhere
T: Into<AccessReason>,
Sets or clears the value of requested_reason.
§Example
use google_cloud_accessapproval_v1::model::AccessReason;
let x = ApprovalRequest::new().set_or_clear_requested_reason(Some(AccessReason::default()/* use setters */));
let x = ApprovalRequest::new().set_or_clear_requested_reason(None::<AccessReason>);Sourcepub fn set_requested_locations<T>(self, v: T) -> Selfwhere
T: Into<AccessLocations>,
pub fn set_requested_locations<T>(self, v: T) -> Selfwhere
T: Into<AccessLocations>,
Sets the value of requested_locations.
§Example
use google_cloud_accessapproval_v1::model::AccessLocations;
let x = ApprovalRequest::new().set_requested_locations(AccessLocations::default()/* use setters */);Sourcepub fn set_or_clear_requested_locations<T>(self, v: Option<T>) -> Selfwhere
T: Into<AccessLocations>,
pub fn set_or_clear_requested_locations<T>(self, v: Option<T>) -> Selfwhere
T: Into<AccessLocations>,
Sets or clears the value of requested_locations.
§Example
use google_cloud_accessapproval_v1::model::AccessLocations;
let x = ApprovalRequest::new().set_or_clear_requested_locations(Some(AccessLocations::default()/* use setters */));
let x = ApprovalRequest::new().set_or_clear_requested_locations(None::<AccessLocations>);Sourcepub fn set_request_time<T>(self, v: T) -> Self
pub fn set_request_time<T>(self, v: T) -> Self
Sets the value of request_time.
§Example
use wkt::Timestamp;
let x = ApprovalRequest::new().set_request_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_request_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_request_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of request_time.
§Example
use wkt::Timestamp;
let x = ApprovalRequest::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
let x = ApprovalRequest::new().set_or_clear_request_time(None::<Timestamp>);Sourcepub fn set_requested_expiration<T>(self, v: T) -> Self
pub fn set_requested_expiration<T>(self, v: T) -> Self
Sets the value of requested_expiration.
§Example
use wkt::Timestamp;
let x = ApprovalRequest::new().set_requested_expiration(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_requested_expiration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_requested_expiration<T>(self, v: Option<T>) -> Self
Sets or clears the value of requested_expiration.
§Example
use wkt::Timestamp;
let x = ApprovalRequest::new().set_or_clear_requested_expiration(Some(Timestamp::default()/* use setters */));
let x = ApprovalRequest::new().set_or_clear_requested_expiration(None::<Timestamp>);Sourcepub fn set_decision<T: Into<Option<Decision>>>(self, v: T) -> Self
pub fn set_decision<T: Into<Option<Decision>>>(self, v: T) -> Self
Sets the value of decision.
Note that all the setters affecting decision are mutually
exclusive.
§Example
use google_cloud_accessapproval_v1::model::ApproveDecision;
let x = ApprovalRequest::new().set_decision(Some(
google_cloud_accessapproval_v1::model::approval_request::Decision::Approve(ApproveDecision::default().into())));Sourcepub fn approve(&self) -> Option<&Box<ApproveDecision>>
pub fn approve(&self) -> Option<&Box<ApproveDecision>>
The value of decision
if it holds a Approve, None if the field is not set or
holds a different branch.
Sourcepub fn set_approve<T: Into<Box<ApproveDecision>>>(self, v: T) -> Self
pub fn set_approve<T: Into<Box<ApproveDecision>>>(self, v: T) -> Self
Sets the value of decision
to hold a Approve.
Note that all the setters affecting decision are
mutually exclusive.
§Example
use google_cloud_accessapproval_v1::model::ApproveDecision;
let x = ApprovalRequest::new().set_approve(ApproveDecision::default()/* use setters */);
assert!(x.approve().is_some());
assert!(x.dismiss().is_none());Sourcepub fn dismiss(&self) -> Option<&Box<DismissDecision>>
pub fn dismiss(&self) -> Option<&Box<DismissDecision>>
The value of decision
if it holds a Dismiss, None if the field is not set or
holds a different branch.
Sourcepub fn set_dismiss<T: Into<Box<DismissDecision>>>(self, v: T) -> Self
pub fn set_dismiss<T: Into<Box<DismissDecision>>>(self, v: T) -> Self
Sets the value of decision
to hold a Dismiss.
Note that all the setters affecting decision are
mutually exclusive.
§Example
use google_cloud_accessapproval_v1::model::DismissDecision;
let x = ApprovalRequest::new().set_dismiss(DismissDecision::default()/* use setters */);
assert!(x.dismiss().is_some());
assert!(x.approve().is_none());Trait Implementations§
Source§impl Clone for ApprovalRequest
impl Clone for ApprovalRequest
Source§fn clone(&self) -> ApprovalRequest
fn clone(&self) -> ApprovalRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more