Skip to main content

Grant

#[non_exhaustive]
pub struct Grant { pub name: String, pub create_time: Option<Timestamp>, pub update_time: Option<Timestamp>, pub requester: String, pub requested_duration: Option<Duration>, pub justification: Option<Justification>, pub state: State, pub timeline: Option<Timeline>, pub privileged_access: Option<PrivilegedAccess>, pub audit_trail: Option<AuditTrail>, pub additional_email_recipients: Vec<String>, pub externally_modified: bool, /* private fields */ }
Expand description

A grant represents a request from a user for obtaining the access specified in an entitlement they are eligible for.

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.
§name: String

Identifier. Name of this grant. Possible formats:

  • organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}
  • folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}
  • projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}

The last segment of this name ({grant-id}) is autogenerated.

§create_time: Option<Timestamp>

Output only. Create time stamp.

§update_time: Option<Timestamp>

Output only. Update time stamp.

§requester: String

Output only. Username of the user who created this grant.

§requested_duration: Option<Duration>

Required. The amount of time access is needed for. This value should be less than the max_request_duration value of the entitlement.

§justification: Option<Justification>

Optional. Justification of why this access is needed.

§state: State

Output only. Current state of this grant.

§timeline: Option<Timeline>

Output only. Timeline of this grant.

§privileged_access: Option<PrivilegedAccess>

Output only. The access that would be granted by this grant.

§audit_trail: Option<AuditTrail>

Output only. Audit trail of access provided by this grant. If unspecified then access was never granted.

§additional_email_recipients: Vec<String>

Optional. Additional email addresses to notify for all the actions performed on the grant.

§externally_modified: bool

Output only. Flag set by the PAM system to indicate that policy bindings made by this grant have been modified from outside PAM.

After it is set, this flag remains set forever irrespective of the grant state. A true value here indicates that PAM no longer has any certainty on the access a user has because of this grant.

Implementations§

Source§

impl Grant

Source

pub fn new() -> Self

Creates a new default instance.

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Grant::new().set_name("example");
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Grant::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = Grant::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Grant::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = Grant::new().set_update_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of update_time.

§Example
use wkt::Timestamp;
let x = Grant::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Grant::new().set_or_clear_update_time(None::<Timestamp>);
Source

pub fn set_requester<T: Into<String>>(self, v: T) -> Self

Sets the value of requester.

§Example
let x = Grant::new().set_requester("example");
Source

pub fn set_requested_duration<T>(self, v: T) -> Self
where T: Into<Duration>,

Sets the value of requested_duration.

§Example
use wkt::Duration;
let x = Grant::new().set_requested_duration(Duration::default()/* use setters */);
Source

pub fn set_or_clear_requested_duration<T>(self, v: Option<T>) -> Self
where T: Into<Duration>,

Sets or clears the value of requested_duration.

§Example
use wkt::Duration;
let x = Grant::new().set_or_clear_requested_duration(Some(Duration::default()/* use setters */));
let x = Grant::new().set_or_clear_requested_duration(None::<Duration>);
Source

pub fn set_justification<T>(self, v: T) -> Self
where T: Into<Justification>,

Sets the value of justification.

§Example
use google_cloud_privilegedaccessmanager_v1::model::Justification;
let x = Grant::new().set_justification(Justification::default()/* use setters */);
Source

pub fn set_or_clear_justification<T>(self, v: Option<T>) -> Self
where T: Into<Justification>,

Sets or clears the value of justification.

§Example
use google_cloud_privilegedaccessmanager_v1::model::Justification;
let x = Grant::new().set_or_clear_justification(Some(Justification::default()/* use setters */));
let x = Grant::new().set_or_clear_justification(None::<Justification>);
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_privilegedaccessmanager_v1::model::grant::State;
let x0 = Grant::new().set_state(State::ApprovalAwaited);
let x1 = Grant::new().set_state(State::Denied);
let x2 = Grant::new().set_state(State::Scheduled);
Source

pub fn set_timeline<T>(self, v: T) -> Self
where T: Into<Timeline>,

Sets the value of timeline.

§Example
use google_cloud_privilegedaccessmanager_v1::model::grant::Timeline;
let x = Grant::new().set_timeline(Timeline::default()/* use setters */);
Source

pub fn set_or_clear_timeline<T>(self, v: Option<T>) -> Self
where T: Into<Timeline>,

Sets or clears the value of timeline.

§Example
use google_cloud_privilegedaccessmanager_v1::model::grant::Timeline;
let x = Grant::new().set_or_clear_timeline(Some(Timeline::default()/* use setters */));
let x = Grant::new().set_or_clear_timeline(None::<Timeline>);
Source

pub fn set_privileged_access<T>(self, v: T) -> Self

Sets the value of privileged_access.

§Example
use google_cloud_privilegedaccessmanager_v1::model::PrivilegedAccess;
let x = Grant::new().set_privileged_access(PrivilegedAccess::default()/* use setters */);
Source

pub fn set_or_clear_privileged_access<T>(self, v: Option<T>) -> Self

Sets or clears the value of privileged_access.

§Example
use google_cloud_privilegedaccessmanager_v1::model::PrivilegedAccess;
let x = Grant::new().set_or_clear_privileged_access(Some(PrivilegedAccess::default()/* use setters */));
let x = Grant::new().set_or_clear_privileged_access(None::<PrivilegedAccess>);
Source

pub fn set_audit_trail<T>(self, v: T) -> Self
where T: Into<AuditTrail>,

Sets the value of audit_trail.

§Example
use google_cloud_privilegedaccessmanager_v1::model::grant::AuditTrail;
let x = Grant::new().set_audit_trail(AuditTrail::default()/* use setters */);
Source

pub fn set_or_clear_audit_trail<T>(self, v: Option<T>) -> Self
where T: Into<AuditTrail>,

Sets or clears the value of audit_trail.

§Example
use google_cloud_privilegedaccessmanager_v1::model::grant::AuditTrail;
let x = Grant::new().set_or_clear_audit_trail(Some(AuditTrail::default()/* use setters */));
let x = Grant::new().set_or_clear_audit_trail(None::<AuditTrail>);
Source

pub fn set_additional_email_recipients<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of additional_email_recipients.

§Example
let x = Grant::new().set_additional_email_recipients(["a", "b", "c"]);
Source

pub fn set_externally_modified<T: Into<bool>>(self, v: T) -> Self

Sets the value of externally_modified.

§Example
let x = Grant::new().set_externally_modified(true);

Trait Implementations§

Source§

impl Clone for Grant

Source§

fn clone(&self) -> Grant

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Grant

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Grant

Source§

fn default() -> Grant

Returns the “default value” for a type. Read more
Source§

impl Message for Grant

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Grant

Source§

fn eq(&self, other: &Grant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Grant

Auto Trait Implementations§

§

impl Freeze for Grant

§

impl RefUnwindSafe for Grant

§

impl Send for Grant

§

impl Sync for Grant

§

impl Unpin for Grant

§

impl UnsafeUnpin for Grant

§

impl UnwindSafe for Grant

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,