#[non_exhaustive]pub struct Policy {
pub name: String,
pub spec: Option<PolicySpec>,
pub alternate: Option<AlternatePolicySpec>,
pub dry_run_spec: Option<PolicySpec>,
pub etag: String,
/* private fields */
}Expand description
Defines an organization policy which is used to specify constraints for configurations of Google Cloud resources.
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: StringImmutable. The resource name of the policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
policy configures:
projects/{project_number}/policies/{constraint_name}folders/{folder_id}/policies/{constraint_name}organizations/{organization_id}/policies/{constraint_name}
For example, projects/123/policies/compute.disableSerialPortAccess.
Note: projects/{project_id}/policies/{constraint_name} is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
spec: Option<PolicySpec>Basic information about the organization policy.
alternate: Option<AlternatePolicySpec>Deprecated.
dry_run_spec: Option<PolicySpec>Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it’s enforced.
etag: StringOptional. An opaque tag indicating the current state of the policy, used for concurrency control. This ‘etag’ is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn set_spec<T>(self, v: T) -> Selfwhere
T: Into<PolicySpec>,
pub fn set_spec<T>(self, v: T) -> Selfwhere
T: Into<PolicySpec>,
Sourcepub fn set_or_clear_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<PolicySpec>,
pub fn set_or_clear_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<PolicySpec>,
Sourcepub fn set_alternate<T>(self, v: T) -> Selfwhere
T: Into<AlternatePolicySpec>,
👎Deprecated
pub fn set_alternate<T>(self, v: T) -> Selfwhere
T: Into<AlternatePolicySpec>,
Sourcepub fn set_or_clear_alternate<T>(self, v: Option<T>) -> Selfwhere
T: Into<AlternatePolicySpec>,
👎Deprecated
pub fn set_or_clear_alternate<T>(self, v: Option<T>) -> Selfwhere
T: Into<AlternatePolicySpec>,
Sourcepub fn set_dry_run_spec<T>(self, v: T) -> Selfwhere
T: Into<PolicySpec>,
pub fn set_dry_run_spec<T>(self, v: T) -> Selfwhere
T: Into<PolicySpec>,
Sets the value of dry_run_spec.
§Example
use google_cloud_orgpolicy_v2::model::PolicySpec;
let x = Policy::new().set_dry_run_spec(PolicySpec::default()/* use setters */);Sourcepub fn set_or_clear_dry_run_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<PolicySpec>,
pub fn set_or_clear_dry_run_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<PolicySpec>,
Sets or clears the value of dry_run_spec.
§Example
use google_cloud_orgpolicy_v2::model::PolicySpec;
let x = Policy::new().set_or_clear_dry_run_spec(Some(PolicySpec::default()/* use setters */));
let x = Policy::new().set_or_clear_dry_run_spec(None::<PolicySpec>);