Reference documentation and code samples for the Access Context Manager V1 API class Google::Identity::AccessContextManager::V1::Condition.
A condition necessary for an AccessLevel to be granted. The Condition is an
AND over its fields. So 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.
(::Array<::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 (i.e. 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.
#ip_subnetworks=
defip_subnetworks=(value)->::Array<::String>
Parameter
value (::Array<::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 (i.e. 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.
Returns
(::Array<::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 (i.e. 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.
#members
defmembers()->::Array<::String>
Returns
(::Array<::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.
#members=
defmembers=(value)->::Array<::String>
Parameter
value (::Array<::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.
Returns
(::Array<::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.
#negate
defnegate()->::Boolean
Returns
(::Boolean) — Whether to negate the Condition. If true, the Condition becomes a NAND over
its non-empty fields, each field must be false for the Condition overall to
be satisfied. Defaults to false.
#negate=
defnegate=(value)->::Boolean
Parameter
value (::Boolean) — Whether to negate the Condition. If true, the Condition becomes a NAND over
its non-empty fields, each field must be false for the Condition overall to
be satisfied. Defaults to false.
Returns
(::Boolean) — Whether to negate the Condition. If true, the Condition becomes a NAND over
its non-empty fields, each field must be false for the Condition overall to
be satisfied. Defaults to false.
#regions
defregions()->::Array<::String>
Returns
(::Array<::String>) — The request must originate from one of the provided countries/regions.
Must be valid ISO 3166-1 alpha-2 codes.
#regions=
defregions=(value)->::Array<::String>
Parameter
value (::Array<::String>) — The request must originate from one of the provided countries/regions.
Must be valid ISO 3166-1 alpha-2 codes.
Returns
(::Array<::String>) — The request must originate from one of the provided countries/regions.
Must be valid ISO 3166-1 alpha-2 codes.
#required_access_levels
defrequired_access_levels()->::Array<::String>
Returns
(::Array<::String>) — A list of other access levels defined in the same Policy, referenced by
resource name. Referencing an AccessLevel which 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"
value (::Array<::String>) — A list of other access levels defined in the same Policy, referenced by
resource name. Referencing an AccessLevel which 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"
Returns
(::Array<::String>) — A list of other access levels defined in the same Policy, referenced by
resource name. Referencing an AccessLevel which 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"
[[["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,["# Access Context Manager V1 API - Class Google::Identity::AccessContextManager::V1::Condition (v0.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.11.0 (latest)](/ruby/docs/reference/google-identity-access_context_manager-v1/latest/Google-Identity-AccessContextManager-V1-Condition)\n- [0.10.1](/ruby/docs/reference/google-identity-access_context_manager-v1/0.10.1/Google-Identity-AccessContextManager-V1-Condition)\n- [0.9.0](/ruby/docs/reference/google-identity-access_context_manager-v1/0.9.0/Google-Identity-AccessContextManager-V1-Condition)\n- [0.8.2](/ruby/docs/reference/google-identity-access_context_manager-v1/0.8.2/Google-Identity-AccessContextManager-V1-Condition)\n- [0.7.2](/ruby/docs/reference/google-identity-access_context_manager-v1/0.7.2/Google-Identity-AccessContextManager-V1-Condition)\n- [0.6.0](/ruby/docs/reference/google-identity-access_context_manager-v1/0.6.0/Google-Identity-AccessContextManager-V1-Condition)\n- [0.5.2](/ruby/docs/reference/google-identity-access_context_manager-v1/0.5.2/Google-Identity-AccessContextManager-V1-Condition)\n- [0.4.0](/ruby/docs/reference/google-identity-access_context_manager-v1/0.4.0/Google-Identity-AccessContextManager-V1-Condition)\n- [0.3.0](/ruby/docs/reference/google-identity-access_context_manager-v1/0.3.0/Google-Identity-AccessContextManager-V1-Condition)\n- [0.2.0](/ruby/docs/reference/google-identity-access_context_manager-v1/0.2.0/Google-Identity-AccessContextManager-V1-Condition)\n- [0.1.2](/ruby/docs/reference/google-identity-access_context_manager-v1/0.1.2/Google-Identity-AccessContextManager-V1-Condition) \nReference documentation and code samples for the Access Context Manager V1 API class Google::Identity::AccessContextManager::V1::Condition.\n\nA condition necessary for an `AccessLevel` to be granted. The Condition is an\nAND over its fields. So a Condition is true if: 1) the request IP is from one\nof the listed subnetworks AND 2) the originating device complies with the\nlisted device policy AND 3) all listed access levels are granted AND 4) the\nrequest was sent at a time allowed by the DateTimeRestriction. \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### #device_policy\n\n def device_policy() -\u003e ::Google::Identity::AccessContextManager::V1::DevicePolicy\n\n**Returns**\n\n- ([::Google::Identity::AccessContextManager::V1::DevicePolicy](./Google-Identity-AccessContextManager-V1-DevicePolicy)) --- Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed.\n\n### #device_policy=\n\n def device_policy=(value) -\u003e ::Google::Identity::AccessContextManager::V1::DevicePolicy\n\n**Parameter**\n\n- **value** ([::Google::Identity::AccessContextManager::V1::DevicePolicy](./Google-Identity-AccessContextManager-V1-DevicePolicy)) --- Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed. \n**Returns**\n\n- ([::Google::Identity::AccessContextManager::V1::DevicePolicy](./Google-Identity-AccessContextManager-V1-DevicePolicy)) --- Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed.\n\n### #ip_subnetworks\n\n def ip_subnetworks() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- 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 (i.e. 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.\n\n### #ip_subnetworks=\n\n def ip_subnetworks=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) --- 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 (i.e. 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. \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- 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 (i.e. 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.\n\n### #members\n\n def members() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- 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.\n\n### #members=\n\n def members=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) --- 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. \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- 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.\n\n### #negate\n\n def negate() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false.\n\n### #negate=\n\n def negate=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false. \n**Returns**\n\n- (::Boolean) --- Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false.\n\n### #regions\n\n def regions() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The request must originate from one of the provided countries/regions. Must be valid ISO 3166-1 alpha-2 codes.\n\n### #regions=\n\n def regions=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) --- The request must originate from one of the provided countries/regions. Must be valid ISO 3166-1 alpha-2 codes. \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The request must originate from one of the provided countries/regions. Must be valid ISO 3166-1 alpha-2 codes.\n\n### #required_access_levels\n\n def required_access_levels() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- A list of other access levels defined in the same `Policy`, referenced by resource name. Referencing an `AccessLevel` which 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\"`\n\n### #required_access_levels=\n\n def required_access_levels=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) --- A list of other access levels defined in the same `Policy`, referenced by resource name. Referencing an `AccessLevel` which 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\"` \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- A list of other access levels defined in the same `Policy`, referenced by resource name. Referencing an `AccessLevel` which 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\"`"]]