Class: PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/prelude_sdk/models/watch_evaluate_response.rb,
sig/prelude_sdk/models/watch_evaluate_response.rbs

Defined Under Namespace

Modules: Outcome

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(outcome:, rule_id:, weight:, blocked_by: nil, name: nil, unavailable: nil) ⇒ Object

Some parameter documentations has been truncated, see PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule for more details.

Parameters:

  • outcome (Symbol, PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome) —

    What the rule concluded.

  • rule_id (String) —

    The rule that produced this result. Present whatever the rule's visibility, so a

  • weight (Integer) —

    What this rule contributes to the recipe's score when it triggers.

  • blocked_by (String) (defaults to: nil) —

    Why the rule could not run, set only when outcome is NOT_EVALUATED.

  • name (String) (defaults to: nil) —

    The rule's name, present for a rule you authored and omitted for a Prelude-manag

  • unavailable (Boolean) (defaults to: nil) —

    The rule could not run for a reason on our side rather than anything about your



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 143

class Rule < PreludeSDK::Internal::Type::BaseModel
  # @!attribute outcome
  #   What the rule concluded.
  #
  #   - `TRIGGERED` - The condition held; `weight` was added to the score.
  #   - `NOT_TRIGGERED` - The condition did not hold.
  #   - `NOT_EVALUATED` - The rule could not run, because something it reads never
  #     arrived. This is not a quieter `NOT_TRIGGERED`: it contributed nothing either
  #     way, and it is why `partial_evidence` is set on the recipe.
  #
  #   @return [Symbol, PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome]
  required :outcome, enum: -> { PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome }

  # @!attribute rule_id
  #   The rule that produced this result. Present whatever the rule's visibility, so a
  #   rule you cannot see the condition of is still one you can reweight, switch off,
  #   or ask us about.
  #
  #   @return [String]
  required :rule_id, String

  # @!attribute weight
  #   What this rule contributes to the recipe's score when it triggers.
  #
  #   @return [Integer]
  required :weight, Integer

  # @!attribute blocked_by
  #   Why the rule could not run, set only when `outcome` is `NOT_EVALUATED`.
  #
  #   A rule you authored names the signal or attribute it waited on, since you wrote
  #   the expression that reads it. A Prelude-managed rule reports `missing_data` and
  #   nothing more: the signal it waited on is part of a condition that is not
  #   disclosed.
  #
  #   @return [String, nil]
  optional :blocked_by, String

  # @!attribute name
  #   The rule's name, present for a rule you authored and omitted for a
  #   Prelude-managed one. A managed rule's name describes what it looks for, which is
  #   as much of the condition as the expression is.
  #
  #   @return [String, nil]
  optional :name, String

  # @!attribute unavailable
  #   The rule could not run for a reason on our side rather than anything about your
  #   request. `outcome` is `NOT_EVALUATED` and the failure is ours to fix.
  #
  #   @return [Boolean, nil]
  optional :unavailable, PreludeSDK::Internal::Type::Boolean

  # @!method initialize(outcome:, rule_id:, weight:, blocked_by: nil, name: nil, unavailable: nil)
  #   Some parameter documentations has been truncated, see
  #   {PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule} for more details.
  #
  #   @param outcome [Symbol, PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome] What the rule concluded.
  #
  #   @param rule_id [String] The rule that produced this result. Present whatever the rule's visibility, so a
  #
  #   @param weight [Integer] What this rule contributes to the recipe's score when it triggers.
  #
  #   @param blocked_by [String] Why the rule could not run, set only when `outcome` is `NOT_EVALUATED`.
  #
  #   @param name [String] The rule's name, present for a rule you authored and omitted for a Prelude-manag
  #
  #   @param unavailable [Boolean] The rule could not run for a reason on our side rather than anything about your

  # What the rule concluded.
  #
  # - `TRIGGERED` - The condition held; `weight` was added to the score.
  # - `NOT_TRIGGERED` - The condition did not hold.
  # - `NOT_EVALUATED` - The rule could not run, because something it reads never
  #   arrived. This is not a quieter `NOT_TRIGGERED`: it contributed nothing either
  #   way, and it is why `partial_evidence` is set on the recipe.
  #
  # @see PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule#outcome
  module Outcome
    extend PreludeSDK::Internal::Type::Enum

    TRIGGERED = :TRIGGERED
    NOT_TRIGGERED = :NOT_TRIGGERED
    NOT_EVALUATED = :NOT_EVALUATED

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#blocked_by ⇒ String?

Why the rule could not run, set only when outcome is NOT_EVALUATED.

A rule you authored names the signal or attribute it waited on, since you wrote the expression that reads it. A Prelude-managed rule reports missing_data and nothing more: the signal it waited on is part of a condition that is not disclosed.

Parameters:

  • (String)

Returns:

  • (String, nil)


179
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 179

optional :blocked_by, String

#name ⇒ String?

The rule's name, present for a rule you authored and omitted for a Prelude-managed one. A managed rule's name describes what it looks for, which is as much of the condition as the expression is.

Parameters:

  • (String)

Returns:

  • (String, nil)


187
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 187

optional :name, String

#outcome ⇒ Symbol, PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome

What the rule concluded.

  • TRIGGERED - The condition held; weight was added to the score.
  • NOT_TRIGGERED - The condition did not hold.
  • NOT_EVALUATED - The rule could not run, because something it reads never arrived. This is not a quieter NOT_TRIGGERED: it contributed nothing either way, and it is why partial_evidence is set on the recipe.

Parameters:

  • value (PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::outcome)

Returns:



154
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 154

required :outcome, enum: -> { PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome }

#rule_id ⇒ String

The rule that produced this result. Present whatever the rule's visibility, so a rule you cannot see the condition of is still one you can reweight, switch off, or ask us about.

Parameters:

  • value (String)

Returns:

  • (String)


162
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 162

required :rule_id, String

#unavailable ⇒ Boolean?

The rule could not run for a reason on our side rather than anything about your request. outcome is NOT_EVALUATED and the failure is ours to fix.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


194
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 194

optional :unavailable, PreludeSDK::Internal::Type::Boolean

#weight ⇒ Integer

What this rule contributes to the recipe's score when it triggers.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


168
# File 'lib/prelude_sdk/models/watch_evaluate_response.rb', line 168

required :weight, Integer

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


132
# File 'sig/prelude_sdk/models/watch_evaluate_response.rbs', line 132

def to_hash: -> {