Struct googapis::google::cloud::orgpolicy::v2::Constraint [−][src]
pub struct Constraint {
pub name: String,
pub display_name: String,
pub description: String,
pub constraint_default: i32,
pub constraint_type: Option<ConstraintType>,
}
Expand description
A constraint
describes a way to restrict resource’s configuration. For
example, you could enforce a constraint that controls which cloud services
can be activated across an organization, or whether a Compute Engine instance
can have serial port connections established. Constraints
can be configured
by the organization’s policy adminstrator to fit the needs of the organzation
by setting a policy
that includes constraints
at different locations in
the organization’s resource hierarchy. Policies are inherited down the
resource hierarchy from higher levels, but can also be overridden. For
details about the inheritance rules please read about
[policies
][google.cloud.OrgPolicy.v2.Policy].
Constraints
have a default behavior determined by the constraint_default
field, which is the enforcement behavior that is used in the absence of a
policy
being defined or inherited for the resource in question.
Fields
name: String
Immutable. The resource name of the Constraint. Must be in one of the following forms:
projects/{project_number}/constraints/{constraint_name}
folders/{folder_id}/constraints/{constraint_name}
organizations/{organization_id}/constraints/{constraint_name}
For example, “/projects/123/constraints/compute.disableSerialPortAccess”.
display_name: String
The human readable name.
Mutable.
description: String
Detailed description of what this Constraint
controls as well as how and
where it is enforced.
Mutable.
constraint_default: i32
The evaluation behavior of this constraint in the absence of ‘Policy’.
constraint_type: Option<ConstraintType>
The type of restrictions for this Constraint
.
Immutable after creation.
Implementations
Returns the enum value of constraint_default
, or the default if the field is set to an invalid enum value.
Sets constraint_default
to the provided enum value.
Trait Implementations
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
Returns the encoded length of the message without a length delimiter.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self
. Read more
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more