Note: The following fields are mutually exclusive: boolean_constraint, list_constraint. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: boolean_constraint, list_constraint. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: boolean_constraint, list_constraint. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: list_constraint, boolean_constraint. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: list_constraint, boolean_constraint. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: list_constraint, boolean_constraint. If a field in that set is populated, all other fields in the set will automatically be cleared.
#name
defname()->::String
Returns
(::String) — The unique name of the constraint. Format of the name should be
constraints/{constraint_name}
For example, constraints/compute.disableSerialPortAccess.
#name=
defname=(value)->::String
Parameter
value (::String) — The unique name of the constraint. Format of the name should be
constraints/{constraint_name}
For example, constraints/compute.disableSerialPortAccess.
Returns
(::String) — The unique name of the constraint. Format of the name should be
constraints/{constraint_name}
For example, constraints/compute.disableSerialPortAccess.
[[["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::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint (v1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/ruby/docs/reference/google-cloud-asset-v1/latest/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [1.4.0](/ruby/docs/reference/google-cloud-asset-v1/1.4.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [1.3.1](/ruby/docs/reference/google-cloud-asset-v1/1.3.1/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [1.2.0](/ruby/docs/reference/google-cloud-asset-v1/1.2.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [1.1.0](/ruby/docs/reference/google-cloud-asset-v1/1.1.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [1.0.2](/ruby/docs/reference/google-cloud-asset-v1/1.0.2/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.32.0](/ruby/docs/reference/google-cloud-asset-v1/0.32.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.31.0](/ruby/docs/reference/google-cloud-asset-v1/0.31.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.30.0](/ruby/docs/reference/google-cloud-asset-v1/0.30.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.29.3](/ruby/docs/reference/google-cloud-asset-v1/0.29.3/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.28.1](/ruby/docs/reference/google-cloud-asset-v1/0.28.1/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.27.0](/ruby/docs/reference/google-cloud-asset-v1/0.27.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.26.1](/ruby/docs/reference/google-cloud-asset-v1/0.26.1/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.25.0](/ruby/docs/reference/google-cloud-asset-v1/0.25.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.24.0](/ruby/docs/reference/google-cloud-asset-v1/0.24.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.23.0](/ruby/docs/reference/google-cloud-asset-v1/0.23.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.22.0](/ruby/docs/reference/google-cloud-asset-v1/0.22.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.21.1](/ruby/docs/reference/google-cloud-asset-v1/0.21.1/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.20.1](/ruby/docs/reference/google-cloud-asset-v1/0.20.1/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.19.0](/ruby/docs/reference/google-cloud-asset-v1/0.19.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.18.0](/ruby/docs/reference/google-cloud-asset-v1/0.18.0/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint)\n- [0.17.3](/ruby/docs/reference/google-cloud-asset-v1/0.17.3/Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint) \nReference documentation and code samples for the Cloud Asset V1 API class Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint.\n\nThe definition of a constraint. \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### #boolean_constraint\n\n def boolean_constraint() -\u003e ::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::BooleanConstraint\n\n**Returns**\n\n- ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::BooleanConstraint](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-BooleanConstraint)) --- Defines this constraint as being a BooleanConstraint.\n\n\n Note: The following fields are mutually exclusive: `boolean_constraint`, `list_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #boolean_constraint=\n\n def boolean_constraint=(value) -\u003e ::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::BooleanConstraint\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::BooleanConstraint](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-BooleanConstraint)) --- Defines this constraint as being a BooleanConstraint.\n\n\nNote: The following fields are mutually exclusive: `boolean_constraint`, `list_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::BooleanConstraint](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-BooleanConstraint)) --- Defines this constraint as being a BooleanConstraint.\n\n\n Note: The following fields are mutually exclusive: `boolean_constraint`, `list_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #constraint_default\n\n def constraint_default() -\u003e ::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ConstraintDefault\n\n**Returns**\n\n- ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ConstraintDefault](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-ConstraintDefault)) --- The evaluation behavior of this constraint in the absence of 'Policy'.\n\n### #constraint_default=\n\n def constraint_default=(value) -\u003e ::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ConstraintDefault\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ConstraintDefault](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-ConstraintDefault)) --- The evaluation behavior of this constraint in the absence of 'Policy'. \n**Returns**\n\n- ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ConstraintDefault](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-ConstraintDefault)) --- The evaluation behavior of this constraint in the absence of 'Policy'.\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Detailed description of what this `Constraint` controls as well as how and where it is enforced.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Detailed description of what this `Constraint` controls as well as how and where it is enforced. \n**Returns**\n\n- (::String) --- Detailed description of what this `Constraint` controls as well as how and where it is enforced.\n\n### #display_name\n\n def display_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The human readable name of the constraint.\n\n### #display_name=\n\n def display_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The human readable name of the constraint. \n**Returns**\n\n- (::String) --- The human readable name of the constraint.\n\n### #list_constraint\n\n def list_constraint() -\u003e ::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ListConstraint\n\n**Returns**\n\n- ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ListConstraint](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-ListConstraint)) --- Defines this constraint as being a ListConstraint.\n\n\n Note: The following fields are mutually exclusive: `list_constraint`, `boolean_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #list_constraint=\n\n def list_constraint=(value) -\u003e ::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ListConstraint\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ListConstraint](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-ListConstraint)) --- Defines this constraint as being a ListConstraint.\n\n\nNote: The following fields are mutually exclusive: `list_constraint`, `boolean_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- ([::Google::Cloud::Asset::V1::AnalyzerOrgPolicyConstraint::Constraint::ListConstraint](./Google-Cloud-Asset-V1-AnalyzerOrgPolicyConstraint-Constraint-ListConstraint)) --- Defines this constraint as being a ListConstraint.\n\n\n Note: The following fields are mutually exclusive: `list_constraint`, `boolean_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The unique name of the constraint. Format of the name should be\n\n - `constraints/{constraint_name}`\n\n For example, `constraints/compute.disableSerialPortAccess`.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The unique name of the constraint. Format of the name should be\n\n\n - `constraints/{constraint_name}`\n\nFor example, `constraints/compute.disableSerialPortAccess`. \n**Returns**\n\n- (::String) --- The unique name of the constraint. Format of the name should be\n\n - `constraints/{constraint_name}`\n\n For example, `constraints/compute.disableSerialPortAccess`."]]