Class: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinition

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/orgpolicy_v2/classes.rb,
lib/google/apis/orgpolicy_v2/representations.rb,
lib/google/apis/orgpolicy_v2/representations.rb

Overview

Currently used for Managed Constraints. This represents a subset of fields missing from Constraint proto that are required to describe CustomConstraint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinition

Returns a new instance of GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinition.



184
185
186
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 184

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#action_typeString

Allow or deny type. Corresponds to the JSON property actionType

Returns:

  • (String)


158
159
160
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 158

def action_type
  @action_type
end

#conditionString

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. Corresponds to the JSON property condition

Returns:

  • (String)


165
166
167
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 165

def condition
  @condition
end

#method_typesArray<String>

All the operations being applied for this constraint. Corresponds to the JSON property methodTypes

Returns:

  • (Array<String>)


170
171
172
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 170

def method_types
  @method_types
end

#parametersHash<String,Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameter>

Stores Structure of parameters used by Constraint condition. Key of map represents name of the parameter. Corresponds to the JSON property parameters



176
177
178
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 176

def parameters
  @parameters
end

#resource_typesArray<String>

The resource instance type on which this policy applies. Format will be of the form : / Example: * compute.googleapis.com/Instance. Corresponds to the JSON property resourceTypes

Returns:

  • (Array<String>)


182
183
184
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 182

def resource_types
  @resource_types
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



189
190
191
192
193
194
195
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 189

def update!(**args)
  @action_type = args[:action_type] if args.key?(:action_type)
  @condition = args[:condition] if args.key?(:condition)
  @method_types = args[:method_types] if args.key?(:method_types)
  @parameters = args[:parameters] if args.key?(:parameters)
  @resource_types = args[:resource_types] if args.key?(:resource_types)
end