Google Cloud Org Policy V2 Client - Class CustomConstraintDefinition (1.2.1)

Reference documentation and code samples for the Google Cloud Org Policy V2 Client class CustomConstraintDefinition.

Custom constraint definition. Defines this as a managed constraint.

Generated from protobuf message google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition

Namespace

Google \ Cloud \ OrgPolicy \ V2 \ Constraint

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ resource_types array

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example: * * compute.googleapis.com/Instance.

↳ method_types array

All the operations being applied for this constraint.

↳ condition string

Org policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+") or, resource.management.auto_upgrade == true The max length of the condition is 1000 characters.

↳ action_type int

Allow or deny type.

↳ parameters array|Google\Protobuf\Internal\MapField

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

getResourceTypes

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example:

  • compute.googleapis.com/Instance.
Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setResourceTypes

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example:

  • compute.googleapis.com/Instance.
Parameter
Name Description
var string[]
Returns
Type Description
$this

getMethodTypes

All the operations being applied for this constraint.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setMethodTypes

All the operations being applied for this constraint.

Parameter
Name Description
var int[]
Returns
Type Description
$this

getCondition

Org policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+") or, resource.management.auto_upgrade == true The max length of the condition is 1000 characters.

Returns
Type Description
string

setCondition

Org policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+") or, resource.management.auto_upgrade == true The max length of the condition is 1000 characters.

Parameter
Name Description
var string
Returns
Type Description
$this

getActionType

Allow or deny type.

Returns
Type Description
int

setActionType

Allow or deny type.

Parameter
Name Description
var int
Returns
Type Description
$this

getParameters

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

Returns
Type Description
Google\Protobuf\Internal\MapField

setParameters

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this