Class: Google::Apis::SaasservicemgmtV1beta1::EvaluationRule
- Inherits:
-
Object
- Object
- Google::Apis::SaasservicemgmtV1beta1::EvaluationRule
- 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
-
#allocation_id ⇒ String
Optional.
-
#condition ⇒ String
Required.
-
#id ⇒ String
Required.
-
#target ⇒ String
Optional.
-
#variant_id ⇒ String
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ EvaluationRule
constructor
A new instance of EvaluationRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ EvaluationRule
Returns a new instance of EvaluationRule.
367 368 369 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 367 def initialize(**args) update!(**args) end |
Instance Attribute Details
#allocation_id ⇒ String
Optional. The ID of an allocation to target.
Corresponds to the JSON property allocationId
341 342 343 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 341 def allocation_id @allocation_id end |
#condition ⇒ String
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
348 349 350 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 348 def condition @condition end |
#id ⇒ String
Required. Evaluation rule ID. Max length: 128 bytes.
Corresponds to the JSON property id
353 354 355 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 353 def id @id end |
#target ⇒ String
Optional. Deprecated: Use rule_target instead. 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
360 361 362 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 360 def target @target end |
#variant_id ⇒ String
Optional. The name of a variant to target.
Corresponds to the JSON property variantId
365 366 367 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 365 def variant_id @variant_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
372 373 374 375 376 377 378 |
# File 'lib/google/apis/saasservicemgmt_v1beta1/classes.rb', line 372 def update!(**args) @allocation_id = args[:allocation_id] if args.key?(:allocation_id) @condition = args[:condition] if args.key?(:condition) @id = args[:id] if args.key?(:id) @target = args[:target] if args.key?(:target) @variant_id = args[:variant_id] if args.key?(:variant_id) end |