Class: Google::Apis::SaasservicemgmtV1beta1::EvaluationRule

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

Overview

EvaluationRule defines a single rule for evaluating a feature flag. A rule consists of a condition that, if met, assigns a specific variant or allocation to the user.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ EvaluationRule

Returns a new instance of EvaluationRule.



356
357
358
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 356

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

Instance Attribute Details

#conditionString

Required. A Common Expression Language (CEL) expression that evaluates to a boolean. The expression is evaluated against the provided context. If it returns true, the rule's target is applied. Corresponds to the JSON property condition

Returns:

  • (String)


343
344
345
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 343

def condition
  @condition
end

#idString

Required. Evaluation rule ID. Max length: 128 bytes. Corresponds to the JSON property id

Returns:

  • (String)


348
349
350
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 348

def id
  @id
end

#targetString

Required. The target variant or allocation to apply if the condition is met. This should match the name of a defined variant or allocation's ID. Corresponds to the JSON property target

Returns:

  • (String)


354
355
356
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 354

def target
  @target
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



361
362
363
364
365
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 361

def update!(**args)
  @condition = args[:condition] if args.key?(:condition)
  @id = args[:id] if args.key?(:id)
  @target = args[:target] if args.key?(:target)
end