- [Resource: AccessLevel](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel.SCHEMA_REPRESENTATION)
- [BasicLevel](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#BasicLevel)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#BasicLevel.SCHEMA_REPRESENTATION)
- [Condition](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#Condition)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#Condition.SCHEMA_REPRESENTATION)
- [DevicePolicy](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#DevicePolicy)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#DevicePolicy.SCHEMA_REPRESENTATION)
- [OsConstraint](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#OsConstraint)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#OsConstraint.SCHEMA_REPRESENTATION)
- [VpcNetworkSource](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcNetworkSource)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcNetworkSource.SCHEMA_REPRESENTATION)
- [VpcSubNetwork](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcSubNetwork)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcSubNetwork.SCHEMA_REPRESENTATION)
- [ConditionCombiningFunction](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#ConditionCombiningFunction)
- [CustomLevel](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#CustomLevel)
  - [JSON representation](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#CustomLevel.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#METHODS_SUMMARY)

## Resource: AccessLevel

An `AccessLevel` is a label that can be applied to requests to Google Cloud services, along with a list of requirements necessary for the label to be applied.

| JSON representation |
|---|
| ``` { "name": string, "title": string, "description": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "basic": { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#BasicLevel`) }, "custom": { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#CustomLevel`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. Resource name for the `AccessLevel`. Format: `accessPolicies/{access_policy}/accessLevels/{accessLevel}`. The `accessLevel` component must begin with a letter, followed by alphanumeric characters or `_`. Its maximum length is 50 characters. After you create an `AccessLevel`, you cannot change its `name`. |
| `title` | `string` Human-readable title. Must be unique within the policy. |
| `description` | `string` Description of the `AccessLevel` and its use. Does not affect behavior. |
| Required. Describes the necessary conditions for the level to apply. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `basic` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#BasicLevel`)`` A `BasicLevel` composed of `Conditions`. |
| `custom` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#CustomLevel`)`` A `CustomLevel` written in the Common Expression Language. |
| End of mutually exclusive fields. ||

## BasicLevel

`BasicLevel` is an `AccessLevel` using a set of recommended features.

| JSON representation |
|---|
| ``` { "conditions": [ { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#Condition`) } ], "combiningFunction": enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#ConditionCombiningFunction`) } ``` |

| Fields ||
|---|---|
| `conditions[]` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#Condition`)`` Required. A list of requirements for the `AccessLevel` to be granted. |
| `combiningFunction` | ``enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#ConditionCombiningFunction`)`` How the `conditions` list should be combined to determine if a request is granted this `AccessLevel`. If `AND` is used, each `Condition` in `conditions` must be satisfied for the `AccessLevel` to be applied. If `OR` is used, at least one `Condition` in `conditions` must be satisfied for the `AccessLevel` to be applied. Default behavior is `AND`. |

## Condition

A condition necessary for an `AccessLevel` to be granted. The `Condition` is an AND over its fields. A `Condition` is true if: 1) the request IP is from one of the listed subnetworks, AND 2) the originating device complies with the listed device policy, AND 3) all listed access levels are granted, AND 4) the request was sent at a time allowed by the `DateTimeRestriction`.

| JSON representation |
|---|
| ``` { "ipSubnetworks": [ string ], "devicePolicy": { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#DevicePolicy`) }, "requiredAccessLevels": [ string ], "negate": boolean, "members": [ string ], "regions": [ string ], "vpcNetworkSources": [ { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcNetworkSource`) } ] } ``` |

| Fields ||
|---|---|
| `ipSubnetworks[]` | `string` CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for a CIDR IP address block, the specified IP address portion must be properly truncated (that is, all the host bits must be zero) or the input is considered malformed. For example, `"192.0.2.0/24"` is accepted, but `"192.0.2.1/24"` is not. Similarly, for IPv6, `"2001:db8::/32"` is accepted, whereas `"2001:db8::1/32"` is not. The originating IP of a request must be in one of the listed subnets in order for this `Condition` to be true. If empty, all IP addresses are allowed. |
| `devicePolicy` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#DevicePolicy`)`` Device-specific restrictions. All restrictions must hold for the `Condition` to be true. If not specified, all devices are allowed. |
| `requiredAccessLevels[]` | `string` A list of other access levels defined in the same `Policy`, referenced by resource name. Referencing an `AccessLevel` that does not exist is an error. All access levels listed must be granted for the `Condition` to be true. Example: `"accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` |
| `negate` | `boolean` Whether to negate the `Condition`. If `true`, the `Condition` becomes a NAND over its non-empty fields. Any non-empty field criteria evaluating to `false` will result in the `Condition` being satisfied. Defaults to `false`. |
| `members[]` | `string` The request must be made by one of the provided user or service accounts. Groups are not supported. Syntax: `user:{emailid}` `serviceAccount:{emailid}` If not specified, a request may come from any user. |
| `regions[]` | `string` The request must originate from one of the provided countries/regions. Must be valid ISO 3166-1 alpha-2 codes. |
| `vpcNetworkSources[]` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcNetworkSource`)`` The request must originate from one of the provided VPC networks in Google Cloud. Cannot specify this field together with `ipSubnetworks`. |

## DevicePolicy

`DevicePolicy` specifies device-specific restrictions necessary to acquire a given access level. A `DevicePolicy` specifies requirements for requests from devices to be granted access levels; it does not do any enforcement on the device. `DevicePolicy` acts as an AND over all specified fields, and each repeated field is an OR over its elements. Any unset fields are ignored. For example, if the proto is `{ osType : DESKTOP_WINDOWS, osType :
DESKTOP_LINUX, encryption_status: ENCRYPTED}`, then the `DevicePolicy` will be true for requests originating from encrypted Linux desktops and encrypted Windows desktops.

| JSON representation |
|---|
| ``` { "requireScreenlock": boolean, "allowedEncryptionStatuses": [ enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/DeviceEncryptionStatus`) ], "osConstraints": [ { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#OsConstraint`) } ], "allowedDeviceManagementLevels": [ enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/DeviceManagementLevel`) ], "requireAdminApproval": boolean, "requireCorpOwned": boolean } ``` |

| Fields ||
|---|---|
| `requireScreenlock` | `boolean` Whether or not screenlock is required for the `DevicePolicy` to be true. Defaults to `false`. |
| `allowedEncryptionStatuses[]` | ``enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/DeviceEncryptionStatus`)`` Allowed encryption statuses. An empty list allows all statuses. |
| `osConstraints[]` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#OsConstraint`)`` Allowed OS versions. An empty list allows all types and all versions. |
| `allowedDeviceManagementLevels[]` | ``enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/DeviceManagementLevel`)`` Allowed device management levels. An empty list allows all management levels. |
| `requireAdminApproval` | `boolean` Whether the device needs to be approved by the customer admin. |
| `requireCorpOwned` | `boolean` Whether the device needs to be corp-owned. |

## OsConstraint

A restriction on the OS type and version of devices making requests.

| JSON representation |
|---|
| ``` { "osType": enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/OsType`), "minimumVersion": string, "requireVerifiedChromeOs": boolean } ``` |

| Fields ||
|---|---|
| `osType` | ``enum (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/OsType`)`` Required. The allowed OS type. |
| `minimumVersion` | `string` The minimum allowed OS version. If not set, any version of this OS satisfies the constraint. Format: `"major.minor.patch"`. Examples: `"10.5.301"`, `"9.2.1"`. |
| `requireVerifiedChromeOs` | `boolean` Only allows requests from devices with a verified Chrome OS. Verification includes requirements that the device is enterprise-managed, conforms to domain policies, and the caller has permission to call the API targeted by the request. |

## VpcNetworkSource

The originating network source in Google Cloud.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "vpcSubnetwork": { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcSubNetwork`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The type of the originating network source of the request. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `vpcSubnetwork` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#VpcSubNetwork`)`` Sub-segment ranges of a VPC network. |
| End of mutually exclusive fields. ||

## VpcSubNetwork

Sub-segment ranges inside of a VPC network.

| JSON representation |
|---|
| ``` { "network": string, "vpcIpSubnetworks": [ string ] } ``` |

| Fields ||
|---|---|
| `network` | `string` Required. Network name. If the network is not part of the organization, the `compute.network.get` permission must be granted to the caller. Format: `//compute.googleapis.com/projects/{PROJECT_ID}/global/networks/{NETWORK_NAME}` Example: `//compute.googleapis.com/projects/my-project/global/networks/network-1` |
| `vpcIpSubnetworks[]` | `string` CIDR block IP subnetwork specification. The IP address must be an IPv4 address and can be a public or private IP address. Note that for a CIDR IP address block, the specified IP address portion must be properly truncated (that is, all the host bits must be zero) or the input is considered malformed. For example, `"192.0.2.0/24"` is accepted, but `"192.0.2.1/24"` is not. If empty, all IP addresses are allowed. |

## ConditionCombiningFunction

Options for how the `conditions` list should be combined to determine if this `AccessLevel` is applied. Default is `AND`.

| Enums ||
|---|---|
| `AND` | All `Conditions` must be true for the `BasicLevel` to be true. |
| `OR` | If at least one `Condition` is true, then the `BasicLevel` is true. |

## CustomLevel

`CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language to represent the necessary conditions for the level to apply to a request. See CEL spec at: <https://github.com/google/cel-spec>

| JSON representation |
|---|
| ``` { "expr": { object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/Binding#Expr`) } } ``` |

| Fields ||
|---|---|
| `expr` | ``object (`https://docs.cloud.google.com/access-context-manager/docs/reference/rest/Shared.Types/Binding#Expr`)`` Required. A Cloud CEL expression evaluating to a boolean. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/create` | Creates an `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel`. |
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/delete` | Deletes an `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel` based on the resource name. |
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/get` | Gets an `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel` based on the resource name. |
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/list` | Lists all `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel` for an access policy. |
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/patch` | Updates an `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel`. |
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/replaceAll` | Replaces all existing `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel` in an `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies#AccessPolicy` with the `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels#AccessLevel` provided. |
| ### `https://docs.cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels/testIamPermissions` | Returns the IAM permissions that the caller has on the specified Access Context Manager resource. |