- [Resource: AccessPolicy](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy)
  - [JSON representation](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.SCHEMA_REPRESENTATION)
  - [AccessPolicyDetails](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.AccessPolicyDetails)
    - [JSON representation](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.AccessPolicyDetails.SCHEMA_REPRESENTATION)
  - [AccessPolicyRule](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.AccessPolicyRule)
    - [JSON representation](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.AccessPolicyRule.SCHEMA_REPRESENTATION)
  - [Effect](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.Effect)
  - [Operation](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.Operation)
    - [JSON representation](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#AccessPolicy.Operation.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/iam/docs/reference/rest/v3/folders.locations.accessPolicies.md.txt#METHODS_SUMMARY)

## Resource: AccessPolicy

An IAM Unified Access Policy resource.

| JSON representation |
|---|
| ``` { "name": string, "uid": string, "etag": string, "displayName": string, "annotations": { string: string, ... }, "createTime": string, "updateTime": string, "details": { object (`AccessPolicyDetails`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of the Unified Access Policy. The following formats are supported: - `projects/{projectId}/locations/{location}/accessPolicies/{unified_access_policy_id}` - `projects/{projectNumber}/locations/{location}/accessPolicies/{unified_access_policy_id}` - `folders/{folderId}/locations/{location}/accessPolicies/{unified_access_policy_id}` - `organizations/{organizationId}/locations/{location}/accessPolicies/{unified_access_policy_id}` |
| `uid` | `string` Output only. The globally unique ID of the Unified Access Policy. |
| `etag` | `string` Optional. The etag for the Unified Access Policy. If this is provided on update, it must match the server's etag. |
| `displayName` | `string` Optional. The description of the Unified Access Policy. This description can be a maximum of 63 characters. |
| `annotations` | `map (key: string, value: string)` Optional. User-defined annotations. See <https://google.aip.dev/148#annotations> for more details such as format and size limitations. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `createTime` | ``string (`Timestamp` format)`` Output only. The time when the Unified Access Policy was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`Timestamp` format)`` Output only. The time when the Unified Access Policy was most recently updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `details` | ``object (`AccessPolicyDetails`)`` Optional. The details for the Unified Access Policy. |

### AccessPolicyDetails

Unified Access Policy details.

| JSON representation |
|---|
| ``` { "rules": [ { object (`AccessPolicyRule`) } ] } ``` |

| Fields ||
|---|---|
| `rules[]` | ``object (`AccessPolicyRule`)`` Required. A list of Unified Access Policy rules. |

### AccessPolicyRule

Unified Access Policy rule that determines the behavior of the policy.

| JSON representation |
|---|
| ``` { "principals": [ string ], "excludedPrincipals": [ string ], "operation": { object (`Operation`) }, "conditions": { string: { object (`Expr`) }, ... }, "description": string, "effect": enum (`Effect`) } ``` |

| Fields ||
|---|---|
| `principals[]` | `string` Required. The principals to include in the rule. This field can contain the following values: - `principal://goog/subject/{email_id}`: A specific Google Account. Includes Gmail, Cloud Identity, and Google Workspace user accounts. For example, `principal://goog/subject/alice@example.com`. - `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`: A Google Cloud service account. For example, `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`. - `principalSet://goog/group/{groupId}`: A Google group. For example, `principalSet://goog/group/admins@example.com`. - `principalSet://goog/cloudIdentityCustomerId/{customerId}`: All of the principals associated with the specified Google Workspace or Cloud Identity customer ID. For example, `principalSet://goog/cloudIdentityCustomerId/C01Abc35`. - `principalSet://goog/public:all`: A special identifier that represents any principal that is on the internet, even if they do not have a Google Account or are not logged in. This value is only supported in rules with the `DENY` effect. - `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. - `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{groupId}`: All workforce identities in a group. - `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. - `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. - `principal://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. - `principalSet://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/group/{groupId}`: A workload identity pool group. - `principalSet://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. - `principalSet://iam.googleapis.com/projects/{projectNumber}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. - `principal://{trust_domain}/{agent_resource_path}/{agent_id}`: A single, specific agent identity. - `principalSet://{trust_domain}/*`: All agent identities that belong to a particular trust domain. - `principalSet://{trust_domain}/attribute.{attribute_name}/{attribute_value}`: All agents with a particular attribute. If an identifier that was previously used in a rule is soft deleted, then a `deleted` prefix is automatically added to the identifier. Users can't add new identifiers with this syntax. - `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific Google Account that was deleted recently. For example, `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If the Google Account is recovered, this identifier reverts to the standard identifier for a Google Account. - `deleted:principalSet://goog/group/{groupId}?uid={uid}`: A Google group that was deleted recently. For example, `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If the Google group is restored, this identifier reverts to the standard identifier for a Google group. - `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`: A Google Cloud service account that was deleted recently. For example, `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`. If the service account is undeleted, this identifier reverts to the standard identifier for a service account. - `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A workforce identity that was deleted recently. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. If the workforce identity is undeleted, this identifier reverts to the standard identifier for a workforce identity. |
| `excludedPrincipals[]` | `string` Optional. The principals to exclude from the rule, even if they are listed in the `principals`. For example, you could add a Google group to the `principals`, then exclude specific users who belong to that group. |
| `operation` | ``object (`Operation`)`` Required. Attributes that are used to determine whether this rule applies to a request. |
| `conditions` | ``map (key: string, value: object (`Expr`))`` Optional. The conditions that determine whether this rule applies to a request. Conditions are identified by their key, which is the FQDN of the service that they are relevant to. For example: "conditions": { "iam.googleapis.com": { "expression": {cel_expression} } } Each rule is evaluated independently. If this rule does not apply to a request, other rules might still apply. The following keys are supported: - `eventarc.googleapis.com`: Can use `CEL` functions that evaluate resource fields. - `iam.googleapis.com`: Can use `CEL` functions that evaluate [resource tags](https://cloud.google.com/iam/help/conditions/resource-tags) and combine them using boolean and logical operators. Other functions and operators are not supported. - `iap.googleapis.com`: Can use `CEL` functions and [attributes](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/policies/cel-attributes-uap.md.txt) that evaluate destination resources for requests that use the `iap.googleapis.com/resources.egressViaIAP` permission. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `description` | `string` Optional. Customer-specified description of the rule. This description can be a maximum of 256 characters. |
| `effect` | ``enum (`Effect`)`` Required. The effect of the rule. |

### Effect

An effect to describe how the rule affects access.

| Enums ||
|---|---|
| `EFFECT_UNSPECIFIED` | The effect is unspecified. |
| `DENY` | The rule will deny access if it evaluates to true. |
| `ALLOW` | The rule will grant access if it evaluates to true. |

### Operation

Attributes that are used to determine whether this rule applies to a request.

| JSON representation |
|---|
| ``` { "permissions": [ string ], "excludedPermissions": [ string ] } ``` |

| Fields ||
|---|---|
| `permissions[]` | `string` Optional. The permissions to include in the rule. Rules with the `ALLOW` effect grant the specified permissions. Rules with the `DENY` effect deny the specified permissions. The following formats are supported: - Individual permissions: Individual permissions use the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}` is the fully qualified domain name for the service. For example, `eventarc.googleapis.com/messageBuses.publish`. - Roles: Only supported in rules with the `ALLOW` effect. Roles use the format `role:{role_name}`. For example, `role:roles/logging.logsViewer`. If you include a role name in a rule, then the rule includes all of the permissions in that role. - Permission groups: Sets of permissions, such as `aiplatform.googleapis.com/*.*`. Permission groups are sets of permissions that match a specified pattern. There are some restrictions on the permission groups you can reference and the permissions included in those groups. For more information, see [Permission groups](https://docs.cloud.google.com/iam/help/uap/permission-groups). An empty list doesn't match any `permissions`. |
| `excludedPermissions[]` | `string` Optional. Specifies the permissions to exclude from the rule. If a permission appears in `permissions` *and* in `excludedPermissions`, then it will *not* be subject to the rule effect. The excluded permissions can be specified using the same syntax as `permissions`. |

| ## Methods ||
|---|---|
| ### `create` | Creates a Unified Access Policy, and returns a long running operation. |
| ### `delete` | Deletes a Unified Access Policy. |
| ### `get` | Gets a Unified Access Policy. |
| ### `list` | Lists Unified Access Policies. |
| ### `patch` | Updates a Unified Access Policy. |
| ### `searchPolicyBindings` | Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy. |