(::Google::Cloud::OrgPolicy::V2::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.
value (::Google::Cloud::OrgPolicy::V2::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.
Returns
(::Google::Cloud::OrgPolicy::V2::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
defetag()->::String
Returns
(::String) — Optional. 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.
#etag=
defetag=(value)->::String
Parameter
value (::String) — Optional. 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.
Returns
(::String) — Optional. 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.
#name
defname()->::String
Returns
(::String) — Immutable. 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:
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.
#name=
defname=(value)->::String
Parameter
value (::String) — Immutable. 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:
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.
Returns
(::String) — Immutable. 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:
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Organization Policy V2 API - Class Google::Cloud::OrgPolicy::V2::Policy (v1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/ruby/docs/reference/google-cloud-org_policy-v2/latest/Google-Cloud-OrgPolicy-V2-Policy)\n- [1.4.1](/ruby/docs/reference/google-cloud-org_policy-v2/1.4.1/Google-Cloud-OrgPolicy-V2-Policy)\n- [1.3.0](/ruby/docs/reference/google-cloud-org_policy-v2/1.3.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [1.2.0](/ruby/docs/reference/google-cloud-org_policy-v2/1.2.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [1.1.0](/ruby/docs/reference/google-cloud-org_policy-v2/1.1.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [1.0.1](/ruby/docs/reference/google-cloud-org_policy-v2/1.0.1/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.10.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.10.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.9.2](/ruby/docs/reference/google-cloud-org_policy-v2/0.9.2/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.8.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.8.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.7.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.7.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.6.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.6.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.5.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.5.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.4.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.4.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.3.0](/ruby/docs/reference/google-cloud-org_policy-v2/0.3.0/Google-Cloud-OrgPolicy-V2-Policy)\n- [0.2.6](/ruby/docs/reference/google-cloud-org_policy-v2/0.2.6/Google-Cloud-OrgPolicy-V2-Policy) \nReference documentation and code samples for the Organization Policy V2 API class Google::Cloud::OrgPolicy::V2::Policy.\n\nDefines an organization policy which is used to specify constraints\nfor configurations of Google Cloud resources. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #alternate\n\n def alternate() -\u003e ::Google::Cloud::OrgPolicy::V2::AlternatePolicySpec\n\n**Returns**\n\n- ([::Google::Cloud::OrgPolicy::V2::AlternatePolicySpec](./Google-Cloud-OrgPolicy-V2-AlternatePolicySpec)) --- Deprecated.\n\n### #alternate=\n\n def alternate=(value) -\u003e ::Google::Cloud::OrgPolicy::V2::AlternatePolicySpec\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OrgPolicy::V2::AlternatePolicySpec](./Google-Cloud-OrgPolicy-V2-AlternatePolicySpec)) --- Deprecated. \n**Returns**\n\n- ([::Google::Cloud::OrgPolicy::V2::AlternatePolicySpec](./Google-Cloud-OrgPolicy-V2-AlternatePolicySpec)) --- Deprecated.\n\n### #dry_run_spec\n\n def dry_run_spec() -\u003e ::Google::Cloud::OrgPolicy::V2::PolicySpec\n\n**Returns**\n\n- ([::Google::Cloud::OrgPolicy::V2::PolicySpec](./Google-Cloud-OrgPolicy-V2-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.\n\n### #dry_run_spec=\n\n def dry_run_spec=(value) -\u003e ::Google::Cloud::OrgPolicy::V2::PolicySpec\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OrgPolicy::V2::PolicySpec](./Google-Cloud-OrgPolicy-V2-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. \n**Returns**\n\n- ([::Google::Cloud::OrgPolicy::V2::PolicySpec](./Google-Cloud-OrgPolicy-V2-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.\n\n### #etag\n\n def etag() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. 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.\n\n### #etag=\n\n def etag=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. 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. \n**Returns**\n\n- (::String) --- Optional. 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.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Immutable. 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:\n\n\n - `projects/{project_number}/policies/{constraint_name}`\n - `folders/{folder_id}/policies/{constraint_name}`\n - `organizations/{organization_id}/policies/{constraint_name}`\n\n For example, `projects/123/policies/compute.disableSerialPortAccess`.\n\n Note: `projects/{project_id}/policies/{constraint_name}` is also an\n acceptable name for API requests, but responses will return the name using\n the equivalent project number.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Immutable. 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:\n\n\n - `projects/{project_number}/policies/{constraint_name}`\n - `folders/{folder_id}/policies/{constraint_name}`\n - `organizations/{organization_id}/policies/{constraint_name}`\n\n For example, `projects/123/policies/compute.disableSerialPortAccess`.\n\n Note: `projects/{project_id}/policies/{constraint_name}` is also an\n acceptable name for API requests, but responses will return the name using\nthe equivalent project number. \n**Returns**\n\n- (::String) --- Immutable. 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:\n\n\n - `projects/{project_number}/policies/{constraint_name}`\n - `folders/{folder_id}/policies/{constraint_name}`\n - `organizations/{organization_id}/policies/{constraint_name}`\n\n For example, `projects/123/policies/compute.disableSerialPortAccess`.\n\n Note: `projects/{project_id}/policies/{constraint_name}` is also an\n acceptable name for API requests, but responses will return the name using\n the equivalent project number.\n\n### #spec\n\n def spec() -\u003e ::Google::Cloud::OrgPolicy::V2::PolicySpec\n\n**Returns**\n\n- ([::Google::Cloud::OrgPolicy::V2::PolicySpec](./Google-Cloud-OrgPolicy-V2-PolicySpec)) --- Basic information about the organization policy.\n\n### #spec=\n\n def spec=(value) -\u003e ::Google::Cloud::OrgPolicy::V2::PolicySpec\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OrgPolicy::V2::PolicySpec](./Google-Cloud-OrgPolicy-V2-PolicySpec)) --- Basic information about the organization policy. \n**Returns**\n\n- ([::Google::Cloud::OrgPolicy::V2::PolicySpec](./Google-Cloud-OrgPolicy-V2-PolicySpec)) --- Basic information about the organization policy."]]