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

Custom constraint definition. Defines this as a managed constraint.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinition

Returns a new instance of GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinition.



196
197
198
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 196

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

Instance Attribute Details

#action_typeString

Allow or deny type. Corresponds to the JSON property actionType

Returns:

  • (String)


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

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)


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

def condition
  @condition
end

#method_typesArray<String>

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

Returns:

  • (Array<String>)


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

def method_types
  @method_types
end

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

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter. Corresponds to the JSON property parameters



188
189
190
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 188

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>)


194
195
196
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 194

def resource_types
  @resource_types
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



201
202
203
204
205
206
207
# File 'lib/google/apis/orgpolicy_v2/classes.rb', line 201

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