Reference documentation and code samples for the Cloud Asset V1 API class Google::Identity::AccessContextManager::V1::AccessPolicy.
AccessPolicy is a container for AccessLevels (which define the necessary
attributes to use Google Cloud services) and ServicePerimeters (which
define regions of services able to freely pass data within a perimeter). An
access policy is globally visible within an organization, and the
restrictions it specifies apply to all projects within an organization.
(::String) — Output only. An opaque identifier for the current version of the
AccessPolicy. This will always be a strongly validated etag, meaning that
two Access Polices will be identical if and only if their etags are
identical. Clients should not expect this to be in any specific format.
#etag=
defetag=(value)->::String
Parameter
value (::String) — Output only. An opaque identifier for the current version of the
AccessPolicy. This will always be a strongly validated etag, meaning that
two Access Polices will be identical if and only if their etags are
identical. Clients should not expect this to be in any specific format.
Returns
(::String) — Output only. An opaque identifier for the current version of the
AccessPolicy. This will always be a strongly validated etag, meaning that
two Access Polices will be identical if and only if their etags are
identical. Clients should not expect this to be in any specific format.
#name
defname()->::String
Returns
(::String) — Output only. Resource name of the AccessPolicy. Format:
accessPolicies/{access_policy}
#name=
defname=(value)->::String
Parameter
value (::String) — Output only. Resource name of the AccessPolicy. Format:
accessPolicies/{access_policy}
Returns
(::String) — Output only. Resource name of the AccessPolicy. Format:
accessPolicies/{access_policy}
#parent
defparent()->::String
Returns
(::String) — Required. The parent of this AccessPolicy in the Cloud Resource
Hierarchy. Currently immutable once created. Format:
organizations/{organization_id}
#parent=
defparent=(value)->::String
Parameter
value (::String) — Required. The parent of this AccessPolicy in the Cloud Resource
Hierarchy. Currently immutable once created. Format:
organizations/{organization_id}
Returns
(::String) — Required. The parent of this AccessPolicy in the Cloud Resource
Hierarchy. Currently immutable once created. Format:
organizations/{organization_id}
#scopes
defscopes()->::Array<::String>
Returns
(::Array<::String>) —
The scopes of a policy define which resources an ACM policy can restrict,
and where ACM resources can be referenced.
For example, a policy with scopes=["folders/123"] has the following
behavior:
vpcsc perimeters can only restrict projects within folders/123
access levels can only be referenced by resources within folders/123.
If empty, there are no limitations on which resources can be restricted by
an ACM policy, and there are no limitations on where ACM resources can be
referenced.
Only one policy can include a given scope (attempting to create a second
policy which includes "folders/123" will result in an error).
Currently, scopes cannot be modified after a policy is created.
Currently, policies can only have a single scope.
Format: list of folders/{folder_number} or projects/{project_number}
#scopes=
defscopes=(value)->::Array<::String>
Parameter
value (::Array<::String>) —
The scopes of a policy define which resources an ACM policy can restrict,
and where ACM resources can be referenced.
For example, a policy with scopes=["folders/123"] has the following
behavior:
vpcsc perimeters can only restrict projects within folders/123
access levels can only be referenced by resources within folders/123.
If empty, there are no limitations on which resources can be restricted by
an ACM policy, and there are no limitations on where ACM resources can be
referenced.
Only one policy can include a given scope (attempting to create a second
policy which includes "folders/123" will result in an error).
Currently, scopes cannot be modified after a policy is created.
Currently, policies can only have a single scope.
Format: list of folders/{folder_number} or projects/{project_number}
Returns
(::Array<::String>) —
The scopes of a policy define which resources an ACM policy can restrict,
and where ACM resources can be referenced.
For example, a policy with scopes=["folders/123"] has the following
behavior:
vpcsc perimeters can only restrict projects within folders/123
access levels can only be referenced by resources within folders/123.
If empty, there are no limitations on which resources can be restricted by
an ACM policy, and there are no limitations on where ACM resources can be
referenced.
Only one policy can include a given scope (attempting to create a second
policy which includes "folders/123" will result in an error).
Currently, scopes cannot be modified after a policy is created.
Currently, policies can only have a single scope.
Format: list of folders/{folder_number} or projects/{project_number}
#title
deftitle()->::String
Returns
(::String) — Required. Human readable title. Does not affect behavior.
#title=
deftitle=(value)->::String
Parameter
value (::String) — Required. Human readable title. Does not affect behavior.
Returns
(::String) — Required. Human readable title. Does not affect behavior.
[[["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-09-09 UTC."],[],[],null,["# Cloud Asset V1 API - Class Google::Identity::AccessContextManager::V1::AccessPolicy (v1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/ruby/docs/reference/google-cloud-asset-v1/latest/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [1.4.0](/ruby/docs/reference/google-cloud-asset-v1/1.4.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [1.3.1](/ruby/docs/reference/google-cloud-asset-v1/1.3.1/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [1.2.0](/ruby/docs/reference/google-cloud-asset-v1/1.2.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [1.1.0](/ruby/docs/reference/google-cloud-asset-v1/1.1.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [1.0.2](/ruby/docs/reference/google-cloud-asset-v1/1.0.2/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.32.0](/ruby/docs/reference/google-cloud-asset-v1/0.32.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.31.0](/ruby/docs/reference/google-cloud-asset-v1/0.31.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.30.0](/ruby/docs/reference/google-cloud-asset-v1/0.30.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.29.3](/ruby/docs/reference/google-cloud-asset-v1/0.29.3/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.28.1](/ruby/docs/reference/google-cloud-asset-v1/0.28.1/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.27.0](/ruby/docs/reference/google-cloud-asset-v1/0.27.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.26.1](/ruby/docs/reference/google-cloud-asset-v1/0.26.1/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.25.0](/ruby/docs/reference/google-cloud-asset-v1/0.25.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.24.0](/ruby/docs/reference/google-cloud-asset-v1/0.24.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.23.0](/ruby/docs/reference/google-cloud-asset-v1/0.23.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.22.0](/ruby/docs/reference/google-cloud-asset-v1/0.22.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.21.1](/ruby/docs/reference/google-cloud-asset-v1/0.21.1/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.20.1](/ruby/docs/reference/google-cloud-asset-v1/0.20.1/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.19.0](/ruby/docs/reference/google-cloud-asset-v1/0.19.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.18.0](/ruby/docs/reference/google-cloud-asset-v1/0.18.0/Google-Identity-AccessContextManager-V1-AccessPolicy)\n- [0.17.3](/ruby/docs/reference/google-cloud-asset-v1/0.17.3/Google-Identity-AccessContextManager-V1-AccessPolicy) \nReference documentation and code samples for the Cloud Asset V1 API class Google::Identity::AccessContextManager::V1::AccessPolicy.\n\n`AccessPolicy` is a container for `AccessLevels` (which define the necessary\nattributes to use Google Cloud services) and `ServicePerimeters` (which\ndefine regions of services able to freely pass data within a perimeter). An\naccess policy is globally visible within an organization, and the\nrestrictions it specifies apply to all projects within an organization. \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### #create_time\n\n def create_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. Time the `AccessPolicy` was created in UTC.\n\n### #create_time=\n\n def create_time=(value) -\u003e ::Google::Protobuf::Timestamp\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. Time the `AccessPolicy` was created in UTC. \n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. Time the `AccessPolicy` was created in UTC.\n\n### #etag\n\n def etag() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. An opaque identifier for the current version of the `AccessPolicy`. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.\n\n### #etag=\n\n def etag=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Output only. An opaque identifier for the current version of the `AccessPolicy`. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format. \n**Returns**\n\n- (::String) --- Output only. An opaque identifier for the current version of the `AccessPolicy`. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{access_policy}`\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{access_policy}` \n**Returns**\n\n- (::String) --- Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{access_policy}`\n\n### #parent\n\n def parent() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once created. Format: `organizations/{organization_id}`\n\n### #parent=\n\n def parent=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once created. Format: `organizations/{organization_id}` \n**Returns**\n\n- (::String) --- Required. The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once created. Format: `organizations/{organization_id}`\n\n### #scopes\n\n def scopes() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The scopes of a policy define which resources an ACM policy can restrict,\n and where ACM resources can be referenced.\n For example, a policy with scopes=\\[\"folders/123\"\\] has the following\n behavior:\n\n - vpcsc perimeters can only restrict projects within folders/123\n - access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes \"folders/123\" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of `folders/{folder_number}` or `projects/{project_number}`\n\n### #scopes=\n\n def scopes=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) ---\n\n The scopes of a policy define which resources an ACM policy can restrict,\n and where ACM resources can be referenced.\n For example, a policy with scopes=\\[\"folders/123\"\\] has the following\n behavior:\n - vpcsc perimeters can only restrict projects within folders/123\n- access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes \"folders/123\" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of `folders/{folder_number}` or `projects/{project_number}` \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The scopes of a policy define which resources an ACM policy can restrict,\n and where ACM resources can be referenced.\n For example, a policy with scopes=\\[\"folders/123\"\\] has the following\n behavior:\n\n - vpcsc perimeters can only restrict projects within folders/123\n - access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes \"folders/123\" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of `folders/{folder_number}` or `projects/{project_number}`\n\n### #title\n\n def title() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Human readable title. Does not affect behavior.\n\n### #title=\n\n def title=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Human readable title. Does not affect behavior. \n**Returns**\n\n- (::String) --- Required. Human readable title. Does not affect behavior.\n\n### #update_time\n\n def update_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. Time the `AccessPolicy` was updated in UTC.\n\n### #update_time=\n\n def update_time=(value) -\u003e ::Google::Protobuf::Timestamp\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. Time the `AccessPolicy` was updated in UTC. \n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. Time the `AccessPolicy` was updated in UTC."]]