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

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: Verdict Classes: Rule

Instance Attribute Summary collapse

Class Method 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 ⇒ Object



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

def initialize: (

Instance Attribute Details

#determined_by ⇒ String?

The preempting rule that set verdict, present only when a rule rather than the score decided it. Without it a recipe can report a score under its threshold and still flag, with nothing in the payload accounting for the difference.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :determined_by, String

#partial_evidence ⇒ Boolean

At least one rule could not be evaluated, so the score rests on less than the whole recipe. The score is still returned — a partial verdict is more useful than none — but it is labeled rather than passed off as whole.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

required :partial_evidence, PreludeSDK::Internal::Type::Boolean

#recipe_id ⇒ String

The recipe that produced this result.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :recipe_id, String

#rules ⇒ Array<PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule>

One result per rule in the recipe, in membership order. Every rule runs — a score is only meaningful when complete, so there is no short-circuit on the first trigger.



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

required :rules,
-> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule] }

#score ⇒ Integer

The sum of the weights of the rules that triggered, clamped to the range -100 to 100. Two scores at a bound are not comparable.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :score, Integer

#threshold ⇒ Integer

The score at or above which this recipe flags.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :threshold, Integer

#verdict ⇒ Symbol, PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict

This recipe's own verdict. Normally the score against the threshold, unless a preempting rule fired — see determined_by.

Parameters:

  • value (PreludeSDK::Models::WatchEvaluateResponse::Recipe::verdict)

Returns:



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

required :verdict, enum: -> { PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


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

def to_hash: -> {