prelude-sdk 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +3 -5
- data/lib/prelude_sdk/client.rb +4 -0
- data/lib/prelude_sdk/internal/type/base_model.rb +5 -5
- data/lib/prelude_sdk/models/intel/kyc_match_params.rb +96 -0
- data/lib/prelude_sdk/models/intel/kyc_match_response.rb +305 -0
- data/lib/prelude_sdk/models/notify_reply_params.rb +60 -0
- data/lib/prelude_sdk/models/notify_reply_response.rb +65 -0
- data/lib/prelude_sdk/models/signals.rb +125 -0
- data/lib/prelude_sdk/models/target.rb +39 -0
- data/lib/prelude_sdk/models/verification/phone/history_list_params.rb +177 -0
- data/lib/prelude_sdk/models/verification/phone/history_list_response.rb +286 -0
- data/lib/prelude_sdk/models/verification/phone/history_retrieve_params.rb +24 -0
- data/lib/prelude_sdk/models/verification/phone/history_retrieve_response.rb +910 -0
- data/lib/prelude_sdk/models/verification/phone/phone_verification_carrier.rb +29 -0
- data/lib/prelude_sdk/models/verification/phone/phone_verification_money.rb +35 -0
- data/lib/prelude_sdk/models/verification/phone/phone_verification_psd2_transaction.rb +29 -0
- data/lib/prelude_sdk/models/verification_check_params.rb +3 -38
- data/lib/prelude_sdk/models/verification_create_params.rb +6 -161
- data/lib/prelude_sdk/models/verification_create_response.rb +59 -33
- data/lib/prelude_sdk/models/verification_management/sandbox_add_phone_number_params.rb +37 -0
- data/lib/prelude_sdk/models/verification_management/sandbox_add_phone_number_response.rb +27 -0
- data/lib/prelude_sdk/models/verification_management/sandbox_delete_phone_number_params.rb +22 -0
- data/lib/prelude_sdk/models/verification_management/sandbox_delete_phone_number_response.rb +19 -0
- data/lib/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_params.rb +16 -0
- data/lib/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_response.rb +47 -0
- data/lib/prelude_sdk/models/watch_evaluate_params.rb +68 -0
- data/lib/prelude_sdk/models/watch_evaluate_response.rb +318 -0
- data/lib/prelude_sdk/models/watch_predict_params.rb +6 -160
- data/lib/prelude_sdk/models/watch_predict_response.rb +53 -30
- data/lib/prelude_sdk/models/watch_send_events_params.rb +3 -38
- data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +3 -38
- data/lib/prelude_sdk/models.rb +14 -0
- data/lib/prelude_sdk/resources/intel/kyc.rb +62 -0
- data/lib/prelude_sdk/resources/intel.rb +20 -0
- data/lib/prelude_sdk/resources/notify.rb +35 -0
- data/lib/prelude_sdk/resources/verification/phone/history.rb +104 -0
- data/lib/prelude_sdk/resources/verification/phone.rb +21 -0
- data/lib/prelude_sdk/resources/verification.rb +7 -3
- data/lib/prelude_sdk/resources/verification_management/sandbox.rb +99 -0
- data/lib/prelude_sdk/resources/verification_management.rb +5 -0
- data/lib/prelude_sdk/resources/watch.rb +45 -2
- data/lib/prelude_sdk/version.rb +1 -1
- data/lib/prelude_sdk.rb +26 -0
- data/rbi/prelude_sdk/client.rbi +3 -0
- data/rbi/prelude_sdk/models/intel/kyc_match_params.rbi +147 -0
- data/rbi/prelude_sdk/models/intel/kyc_match_response.rbi +736 -0
- data/rbi/prelude_sdk/models/notify_reply_params.rbi +87 -0
- data/rbi/prelude_sdk/models/notify_reply_response.rbi +94 -0
- data/rbi/prelude_sdk/models/signals.rbi +200 -0
- data/rbi/prelude_sdk/models/target.rbi +61 -0
- data/rbi/prelude_sdk/models/verification/phone/history_list_params.rbi +436 -0
- data/rbi/prelude_sdk/models/verification/phone/history_list_response.rbi +661 -0
- data/rbi/prelude_sdk/models/verification/phone/history_retrieve_params.rbi +42 -0
- data/rbi/prelude_sdk/models/verification/phone/history_retrieve_response.rbi +2290 -0
- data/rbi/prelude_sdk/models/verification/phone/phone_verification_carrier.rbi +39 -0
- data/rbi/prelude_sdk/models/verification/phone/phone_verification_money.rbi +46 -0
- data/rbi/prelude_sdk/models/verification/phone/phone_verification_psd2_transaction.rbi +68 -0
- data/rbi/prelude_sdk/models/verification_check_params.rbi +4 -85
- data/rbi/prelude_sdk/models/verification_create_params.rbi +8 -328
- data/rbi/prelude_sdk/models/verification_create_response.rbi +143 -65
- data/rbi/prelude_sdk/models/verification_management/sandbox_add_phone_number_params.rbi +58 -0
- data/rbi/prelude_sdk/models/verification_management/sandbox_add_phone_number_response.rbi +42 -0
- data/rbi/prelude_sdk/models/verification_management/sandbox_delete_phone_number_params.rbi +43 -0
- data/rbi/prelude_sdk/models/verification_management/sandbox_delete_phone_number_response.rbi +32 -0
- data/rbi/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_params.rbi +34 -0
- data/rbi/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_response.rbi +101 -0
- data/rbi/prelude_sdk/models/watch_evaluate_params.rbi +109 -0
- data/rbi/prelude_sdk/models/watch_evaluate_response.rbi +596 -0
- data/rbi/prelude_sdk/models/watch_predict_params.rbi +8 -320
- data/rbi/prelude_sdk/models/watch_predict_response.rbi +135 -62
- data/rbi/prelude_sdk/models/watch_send_events_params.rbi +4 -93
- data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +4 -95
- data/rbi/prelude_sdk/models.rbi +14 -0
- data/rbi/prelude_sdk/resources/intel/kyc.rbi +61 -0
- data/rbi/prelude_sdk/resources/intel.rbi +17 -0
- data/rbi/prelude_sdk/resources/notify.rbi +31 -0
- data/rbi/prelude_sdk/resources/verification/phone/history.rbi +112 -0
- data/rbi/prelude_sdk/resources/verification/phone.rbi +18 -0
- data/rbi/prelude_sdk/resources/verification.rbi +6 -3
- data/rbi/prelude_sdk/resources/verification_management/sandbox.rbi +76 -0
- data/rbi/prelude_sdk/resources/verification_management.rbi +4 -0
- data/rbi/prelude_sdk/resources/watch.rbi +49 -2
- data/sig/prelude_sdk/client.rbs +2 -0
- data/sig/prelude_sdk/models/intel/kyc_match_params.rbs +91 -0
- data/sig/prelude_sdk/models/intel/kyc_match_response.rbs +276 -0
- data/sig/prelude_sdk/models/notify_reply_params.rbs +50 -0
- data/sig/prelude_sdk/models/notify_reply_response.rbs +54 -0
- data/sig/prelude_sdk/models/signals.rbs +101 -0
- data/sig/prelude_sdk/models/target.rbs +29 -0
- data/sig/prelude_sdk/models/verification/phone/history_list_params.rbs +187 -0
- data/sig/prelude_sdk/models/verification/phone/history_list_response.rbs +241 -0
- data/sig/prelude_sdk/models/verification/phone/history_retrieve_params.rbs +27 -0
- data/sig/prelude_sdk/models/verification/phone/history_retrieve_response.rbs +887 -0
- data/sig/prelude_sdk/models/verification/phone/phone_verification_carrier.rbs +23 -0
- data/sig/prelude_sdk/models/verification/phone/phone_verification_money.rbs +21 -0
- data/sig/prelude_sdk/models/verification/phone/phone_verification_psd2_transaction.rbs +37 -0
- data/sig/prelude_sdk/models/verification_check_params.rbs +4 -37
- data/sig/prelude_sdk/models/verification_create_params.rbs +9 -142
- data/sig/prelude_sdk/models/verification_create_response.rbs +32 -14
- data/sig/prelude_sdk/models/verification_management/sandbox_add_phone_number_params.rbs +30 -0
- data/sig/prelude_sdk/models/verification_management/sandbox_add_phone_number_response.rbs +18 -0
- data/sig/prelude_sdk/models/verification_management/sandbox_delete_phone_number_params.rbs +26 -0
- data/sig/prelude_sdk/models/verification_management/sandbox_delete_phone_number_response.rbs +15 -0
- data/sig/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_params.rbs +17 -0
- data/sig/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_response.rbs +45 -0
- data/sig/prelude_sdk/models/watch_evaluate_params.rbs +52 -0
- data/sig/prelude_sdk/models/watch_evaluate_response.rbs +202 -0
- data/sig/prelude_sdk/models/watch_predict_params.rbs +9 -142
- data/sig/prelude_sdk/models/watch_predict_response.rbs +32 -14
- data/sig/prelude_sdk/models/watch_send_events_params.rbs +4 -37
- data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +4 -37
- data/sig/prelude_sdk/models.rbs +14 -0
- data/sig/prelude_sdk/resources/intel/kyc.rbs +23 -0
- data/sig/prelude_sdk/resources/intel.rbs +9 -0
- data/sig/prelude_sdk/resources/notify.rbs +9 -0
- data/sig/prelude_sdk/resources/verification/phone/history.rbs +32 -0
- data/sig/prelude_sdk/resources/verification/phone.rbs +11 -0
- data/sig/prelude_sdk/resources/verification.rbs +5 -3
- data/sig/prelude_sdk/resources/verification_management/sandbox.rbs +24 -0
- data/sig/prelude_sdk/resources/verification_management.rbs +2 -0
- data/sig/prelude_sdk/resources/watch.rbs +11 -2
- metadata +80 -2
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
class WatchEvaluateParams < PreludeSDK::Internal::Type::BaseModel
|
|
6
|
+
extend PreludeSDK::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include PreludeSDK::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(PreludeSDK::WatchEvaluateParams, PreludeSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The flow to evaluate. A flow names the moment you are guarding and selects the
|
|
15
|
+
# recipes that run.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :flow_id
|
|
18
|
+
|
|
19
|
+
# The identifier to score — a phone number or email address.
|
|
20
|
+
sig { returns(PreludeSDK::Target) }
|
|
21
|
+
attr_reader :target
|
|
22
|
+
|
|
23
|
+
sig { params(target: PreludeSDK::Target::OrHash).void }
|
|
24
|
+
attr_writer :target
|
|
25
|
+
|
|
26
|
+
# Values for the attributes the flow's recipes declare, keyed without the `attr.`
|
|
27
|
+
# namespace a rule uses to reference them.
|
|
28
|
+
#
|
|
29
|
+
# An attribute a recipe declares and this request omits is treated as missing
|
|
30
|
+
# evidence, not as an empty value: the rules reading it report `NOT_EVALUATED`
|
|
31
|
+
# rather than being scored as though the condition were false. A key no recipe in
|
|
32
|
+
# the flow declares is ignored rather than rejected, so one payload can serve
|
|
33
|
+
# flows that read different attributes.
|
|
34
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
35
|
+
attr_reader :attributes
|
|
36
|
+
|
|
37
|
+
sig { params(attributes: T::Hash[Symbol, String]).void }
|
|
38
|
+
attr_writer :attributes
|
|
39
|
+
|
|
40
|
+
# The identifier of the dispatch that came from the front-end SDK. Signals it
|
|
41
|
+
# carries fill in anything the request did not state; the request wins where both
|
|
42
|
+
# supply a value.
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_reader :dispatch_id
|
|
45
|
+
|
|
46
|
+
sig { params(dispatch_id: String).void }
|
|
47
|
+
attr_writer :dispatch_id
|
|
48
|
+
|
|
49
|
+
# The signals used for anti-fraud. For more details, refer to
|
|
50
|
+
# [Signals](/verify/v2/documentation/prevent-fraud#signals).
|
|
51
|
+
sig { returns(T.nilable(PreludeSDK::Signals)) }
|
|
52
|
+
attr_reader :signals
|
|
53
|
+
|
|
54
|
+
sig { params(signals: PreludeSDK::Signals::OrHash).void }
|
|
55
|
+
attr_writer :signals
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
flow_id: String,
|
|
60
|
+
target: PreludeSDK::Target::OrHash,
|
|
61
|
+
attributes: T::Hash[Symbol, String],
|
|
62
|
+
dispatch_id: String,
|
|
63
|
+
signals: PreludeSDK::Signals::OrHash,
|
|
64
|
+
request_options: PreludeSDK::RequestOptions::OrHash
|
|
65
|
+
).returns(T.attached_class)
|
|
66
|
+
end
|
|
67
|
+
def self.new(
|
|
68
|
+
# The flow to evaluate. A flow names the moment you are guarding and selects the
|
|
69
|
+
# recipes that run.
|
|
70
|
+
flow_id:,
|
|
71
|
+
# The identifier to score — a phone number or email address.
|
|
72
|
+
target:,
|
|
73
|
+
# Values for the attributes the flow's recipes declare, keyed without the `attr.`
|
|
74
|
+
# namespace a rule uses to reference them.
|
|
75
|
+
#
|
|
76
|
+
# An attribute a recipe declares and this request omits is treated as missing
|
|
77
|
+
# evidence, not as an empty value: the rules reading it report `NOT_EVALUATED`
|
|
78
|
+
# rather than being scored as though the condition were false. A key no recipe in
|
|
79
|
+
# the flow declares is ignored rather than rejected, so one payload can serve
|
|
80
|
+
# flows that read different attributes.
|
|
81
|
+
attributes: nil,
|
|
82
|
+
# The identifier of the dispatch that came from the front-end SDK. Signals it
|
|
83
|
+
# carries fill in anything the request did not state; the request wins where both
|
|
84
|
+
# supply a value.
|
|
85
|
+
dispatch_id: nil,
|
|
86
|
+
# The signals used for anti-fraud. For more details, refer to
|
|
87
|
+
# [Signals](/verify/v2/documentation/prevent-fraud#signals).
|
|
88
|
+
signals: nil,
|
|
89
|
+
request_options: {}
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
sig do
|
|
94
|
+
override.returns(
|
|
95
|
+
{
|
|
96
|
+
flow_id: String,
|
|
97
|
+
target: PreludeSDK::Target,
|
|
98
|
+
attributes: T::Hash[Symbol, String],
|
|
99
|
+
dispatch_id: String,
|
|
100
|
+
signals: PreludeSDK::Signals,
|
|
101
|
+
request_options: PreludeSDK::RequestOptions
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
def to_hash
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
class WatchEvaluateResponse < PreludeSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
PreludeSDK::Models::WatchEvaluateResponse,
|
|
10
|
+
PreludeSDK::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The evaluation identifier.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# What the evaluation suggests you do, being the most severe action across the
|
|
19
|
+
# recipes that ran. Advisory: enforcement is yours.
|
|
20
|
+
#
|
|
21
|
+
# - `ALLOW` - Let the request through.
|
|
22
|
+
# - `BLOCK` - Refuse the request.
|
|
23
|
+
# - `CHALLENGE` - Let the request through behind an additional check.
|
|
24
|
+
sig do
|
|
25
|
+
returns(PreludeSDK::Models::WatchEvaluateResponse::Action::TaggedSymbol)
|
|
26
|
+
end
|
|
27
|
+
attr_accessor :action
|
|
28
|
+
|
|
29
|
+
# One result per recipe that ran. A recipe the flow names but that is not in
|
|
30
|
+
# service is absent rather than reported as having passed.
|
|
31
|
+
sig do
|
|
32
|
+
returns(T::Array[PreludeSDK::Models::WatchEvaluateResponse::Recipe])
|
|
33
|
+
end
|
|
34
|
+
attr_accessor :recipes
|
|
35
|
+
|
|
36
|
+
# The evaluation-level verdict, being the most severe verdict across the recipes
|
|
37
|
+
# that ran.
|
|
38
|
+
#
|
|
39
|
+
# - `PASS` - No recipe flagged.
|
|
40
|
+
# - `FLAG` - At least one recipe flagged.
|
|
41
|
+
sig do
|
|
42
|
+
returns(
|
|
43
|
+
PreludeSDK::Models::WatchEvaluateResponse::Verdict::TaggedSymbol
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
attr_accessor :verdict
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
params(
|
|
50
|
+
id: String,
|
|
51
|
+
action: PreludeSDK::Models::WatchEvaluateResponse::Action::OrSymbol,
|
|
52
|
+
recipes:
|
|
53
|
+
T::Array[PreludeSDK::Models::WatchEvaluateResponse::Recipe::OrHash],
|
|
54
|
+
verdict: PreludeSDK::Models::WatchEvaluateResponse::Verdict::OrSymbol
|
|
55
|
+
).returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
# The evaluation identifier.
|
|
59
|
+
id:,
|
|
60
|
+
# What the evaluation suggests you do, being the most severe action across the
|
|
61
|
+
# recipes that ran. Advisory: enforcement is yours.
|
|
62
|
+
#
|
|
63
|
+
# - `ALLOW` - Let the request through.
|
|
64
|
+
# - `BLOCK` - Refuse the request.
|
|
65
|
+
# - `CHALLENGE` - Let the request through behind an additional check.
|
|
66
|
+
action:,
|
|
67
|
+
# One result per recipe that ran. A recipe the flow names but that is not in
|
|
68
|
+
# service is absent rather than reported as having passed.
|
|
69
|
+
recipes:,
|
|
70
|
+
# The evaluation-level verdict, being the most severe verdict across the recipes
|
|
71
|
+
# that ran.
|
|
72
|
+
#
|
|
73
|
+
# - `PASS` - No recipe flagged.
|
|
74
|
+
# - `FLAG` - At least one recipe flagged.
|
|
75
|
+
verdict:
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
sig do
|
|
80
|
+
override.returns(
|
|
81
|
+
{
|
|
82
|
+
id: String,
|
|
83
|
+
action:
|
|
84
|
+
PreludeSDK::Models::WatchEvaluateResponse::Action::TaggedSymbol,
|
|
85
|
+
recipes:
|
|
86
|
+
T::Array[PreludeSDK::Models::WatchEvaluateResponse::Recipe],
|
|
87
|
+
verdict:
|
|
88
|
+
PreludeSDK::Models::WatchEvaluateResponse::Verdict::TaggedSymbol
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
def to_hash
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# What the evaluation suggests you do, being the most severe action across the
|
|
96
|
+
# recipes that ran. Advisory: enforcement is yours.
|
|
97
|
+
#
|
|
98
|
+
# - `ALLOW` - Let the request through.
|
|
99
|
+
# - `BLOCK` - Refuse the request.
|
|
100
|
+
# - `CHALLENGE` - Let the request through behind an additional check.
|
|
101
|
+
module Action
|
|
102
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
103
|
+
|
|
104
|
+
TaggedSymbol =
|
|
105
|
+
T.type_alias do
|
|
106
|
+
T.all(Symbol, PreludeSDK::Models::WatchEvaluateResponse::Action)
|
|
107
|
+
end
|
|
108
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
109
|
+
|
|
110
|
+
ALLOW =
|
|
111
|
+
T.let(
|
|
112
|
+
:ALLOW,
|
|
113
|
+
PreludeSDK::Models::WatchEvaluateResponse::Action::TaggedSymbol
|
|
114
|
+
)
|
|
115
|
+
BLOCK =
|
|
116
|
+
T.let(
|
|
117
|
+
:BLOCK,
|
|
118
|
+
PreludeSDK::Models::WatchEvaluateResponse::Action::TaggedSymbol
|
|
119
|
+
)
|
|
120
|
+
CHALLENGE =
|
|
121
|
+
T.let(
|
|
122
|
+
:CHALLENGE,
|
|
123
|
+
PreludeSDK::Models::WatchEvaluateResponse::Action::TaggedSymbol
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
sig do
|
|
127
|
+
override.returns(
|
|
128
|
+
T::Array[
|
|
129
|
+
PreludeSDK::Models::WatchEvaluateResponse::Action::TaggedSymbol
|
|
130
|
+
]
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
def self.values
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
class Recipe < PreludeSDK::Internal::Type::BaseModel
|
|
138
|
+
OrHash =
|
|
139
|
+
T.type_alias do
|
|
140
|
+
T.any(
|
|
141
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe,
|
|
142
|
+
PreludeSDK::Internal::AnyHash
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# At least one rule could not be evaluated, so the score rests on less than the
|
|
147
|
+
# whole recipe. The score is still returned — a partial verdict is more useful
|
|
148
|
+
# than none — but it is labeled rather than passed off as whole.
|
|
149
|
+
sig { returns(T::Boolean) }
|
|
150
|
+
attr_accessor :partial_evidence
|
|
151
|
+
|
|
152
|
+
# The recipe that produced this result.
|
|
153
|
+
sig { returns(String) }
|
|
154
|
+
attr_accessor :recipe_id
|
|
155
|
+
|
|
156
|
+
# One result per rule in the recipe, in membership order. Every rule runs — a
|
|
157
|
+
# score is only meaningful when complete, so there is no short-circuit on the
|
|
158
|
+
# first trigger. The exception is a recipe whose verdict a preempting rule has
|
|
159
|
+
# already determined, where a rule that could no longer change it may report
|
|
160
|
+
# `SKIPPED` instead.
|
|
161
|
+
sig do
|
|
162
|
+
returns(
|
|
163
|
+
T::Array[PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule]
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
attr_accessor :rules
|
|
167
|
+
|
|
168
|
+
# The sum of the weights of the rules that triggered, clamped to the range -100
|
|
169
|
+
# to 100. Two scores at a bound are not comparable.
|
|
170
|
+
sig { returns(Integer) }
|
|
171
|
+
attr_accessor :score
|
|
172
|
+
|
|
173
|
+
# The score at or above which this recipe flags.
|
|
174
|
+
sig { returns(Integer) }
|
|
175
|
+
attr_accessor :threshold
|
|
176
|
+
|
|
177
|
+
# This recipe's own verdict. Normally the score against the threshold, unless a
|
|
178
|
+
# preempting rule fired — see `determined_by`.
|
|
179
|
+
sig do
|
|
180
|
+
returns(
|
|
181
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict::TaggedSymbol
|
|
182
|
+
)
|
|
183
|
+
end
|
|
184
|
+
attr_accessor :verdict
|
|
185
|
+
|
|
186
|
+
# The preempting rule that set `verdict`, present only when a rule rather than the
|
|
187
|
+
# score decided it. Without it a recipe can report a score under its threshold and
|
|
188
|
+
# still flag, with nothing in the payload accounting for the difference.
|
|
189
|
+
sig { returns(T.nilable(String)) }
|
|
190
|
+
attr_reader :determined_by
|
|
191
|
+
|
|
192
|
+
sig { params(determined_by: String).void }
|
|
193
|
+
attr_writer :determined_by
|
|
194
|
+
|
|
195
|
+
sig do
|
|
196
|
+
params(
|
|
197
|
+
partial_evidence: T::Boolean,
|
|
198
|
+
recipe_id: String,
|
|
199
|
+
rules:
|
|
200
|
+
T::Array[
|
|
201
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::OrHash
|
|
202
|
+
],
|
|
203
|
+
score: Integer,
|
|
204
|
+
threshold: Integer,
|
|
205
|
+
verdict:
|
|
206
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict::OrSymbol,
|
|
207
|
+
determined_by: String
|
|
208
|
+
).returns(T.attached_class)
|
|
209
|
+
end
|
|
210
|
+
def self.new(
|
|
211
|
+
# At least one rule could not be evaluated, so the score rests on less than the
|
|
212
|
+
# whole recipe. The score is still returned — a partial verdict is more useful
|
|
213
|
+
# than none — but it is labeled rather than passed off as whole.
|
|
214
|
+
partial_evidence:,
|
|
215
|
+
# The recipe that produced this result.
|
|
216
|
+
recipe_id:,
|
|
217
|
+
# One result per rule in the recipe, in membership order. Every rule runs — a
|
|
218
|
+
# score is only meaningful when complete, so there is no short-circuit on the
|
|
219
|
+
# first trigger. The exception is a recipe whose verdict a preempting rule has
|
|
220
|
+
# already determined, where a rule that could no longer change it may report
|
|
221
|
+
# `SKIPPED` instead.
|
|
222
|
+
rules:,
|
|
223
|
+
# The sum of the weights of the rules that triggered, clamped to the range -100
|
|
224
|
+
# to 100. Two scores at a bound are not comparable.
|
|
225
|
+
score:,
|
|
226
|
+
# The score at or above which this recipe flags.
|
|
227
|
+
threshold:,
|
|
228
|
+
# This recipe's own verdict. Normally the score against the threshold, unless a
|
|
229
|
+
# preempting rule fired — see `determined_by`.
|
|
230
|
+
verdict:,
|
|
231
|
+
# The preempting rule that set `verdict`, present only when a rule rather than the
|
|
232
|
+
# score decided it. Without it a recipe can report a score under its threshold and
|
|
233
|
+
# still flag, with nothing in the payload accounting for the difference.
|
|
234
|
+
determined_by: nil
|
|
235
|
+
)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
sig do
|
|
239
|
+
override.returns(
|
|
240
|
+
{
|
|
241
|
+
partial_evidence: T::Boolean,
|
|
242
|
+
recipe_id: String,
|
|
243
|
+
rules:
|
|
244
|
+
T::Array[
|
|
245
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule
|
|
246
|
+
],
|
|
247
|
+
score: Integer,
|
|
248
|
+
threshold: Integer,
|
|
249
|
+
verdict:
|
|
250
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict::TaggedSymbol,
|
|
251
|
+
determined_by: String
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
end
|
|
255
|
+
def to_hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
class Rule < PreludeSDK::Internal::Type::BaseModel
|
|
259
|
+
OrHash =
|
|
260
|
+
T.type_alias do
|
|
261
|
+
T.any(
|
|
262
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule,
|
|
263
|
+
PreludeSDK::Internal::AnyHash
|
|
264
|
+
)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# What the rule concluded.
|
|
268
|
+
#
|
|
269
|
+
# - `TRIGGERED` - The condition held; `weight` was added to the score.
|
|
270
|
+
# - `NOT_TRIGGERED` - The condition did not hold.
|
|
271
|
+
# - `NOT_EVALUATED` - The rule could not run, because something it reads never
|
|
272
|
+
# arrived. This is not a quieter `NOT_TRIGGERED`: it contributed nothing either
|
|
273
|
+
# way, and it is why `partial_evidence` is set on the recipe.
|
|
274
|
+
# - `SKIPPED` - The rule was not run, because another rule had already determined
|
|
275
|
+
# the recipe's verdict — see `determined_by`. Nothing was missing and nothing
|
|
276
|
+
# failed, so `partial_evidence` is not set: `determined_by` is what accounts for
|
|
277
|
+
# the recipe's score resting on fewer rules.
|
|
278
|
+
sig do
|
|
279
|
+
returns(
|
|
280
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol
|
|
281
|
+
)
|
|
282
|
+
end
|
|
283
|
+
attr_accessor :outcome
|
|
284
|
+
|
|
285
|
+
# The rule that produced this result. Present whatever the rule's visibility, so a
|
|
286
|
+
# rule you cannot see the condition of is still one you can reweight, switch off,
|
|
287
|
+
# or ask us about.
|
|
288
|
+
sig { returns(String) }
|
|
289
|
+
attr_accessor :rule_id
|
|
290
|
+
|
|
291
|
+
# Who authored the rule, which is what says how much of the rest of this result
|
|
292
|
+
# you get.
|
|
293
|
+
#
|
|
294
|
+
# - `MANAGED` - Prelude-owned, shared with customers: `name` and `version_id` are
|
|
295
|
+
# omitted, and `blocked_by` reports only `missing_data`.
|
|
296
|
+
# - `CUSTOM` - Yours: every field is returned.
|
|
297
|
+
sig do
|
|
298
|
+
returns(
|
|
299
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type::TaggedSymbol
|
|
300
|
+
)
|
|
301
|
+
end
|
|
302
|
+
attr_accessor :type
|
|
303
|
+
|
|
304
|
+
# What this rule contributes to the recipe's score when it triggers.
|
|
305
|
+
sig { returns(Integer) }
|
|
306
|
+
attr_accessor :weight
|
|
307
|
+
|
|
308
|
+
# Why the rule could not run, set only when `outcome` is `NOT_EVALUATED`.
|
|
309
|
+
#
|
|
310
|
+
# A rule you authored names the signal or attribute it waited on, since you wrote
|
|
311
|
+
# the expression that reads it. A Prelude-managed rule reports `missing_data` and
|
|
312
|
+
# nothing more: the signal it waited on is part of a condition that is not
|
|
313
|
+
# disclosed.
|
|
314
|
+
sig { returns(T.nilable(String)) }
|
|
315
|
+
attr_reader :blocked_by
|
|
316
|
+
|
|
317
|
+
sig { params(blocked_by: String).void }
|
|
318
|
+
attr_writer :blocked_by
|
|
319
|
+
|
|
320
|
+
# The rule's name, present for a rule you authored and omitted for a
|
|
321
|
+
# Prelude-managed one. A managed rule's name describes what it looks for, which is
|
|
322
|
+
# as much of the condition as the expression is.
|
|
323
|
+
sig { returns(T.nilable(String)) }
|
|
324
|
+
attr_reader :name
|
|
325
|
+
|
|
326
|
+
sig { params(name: String).void }
|
|
327
|
+
attr_writer :name
|
|
328
|
+
|
|
329
|
+
# The rule could not run for a reason on our side rather than anything about your
|
|
330
|
+
# request. `outcome` is `NOT_EVALUATED` and the failure is ours to fix.
|
|
331
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
332
|
+
attr_reader :unavailable
|
|
333
|
+
|
|
334
|
+
sig { params(unavailable: T::Boolean).void }
|
|
335
|
+
attr_writer :unavailable
|
|
336
|
+
|
|
337
|
+
# The version of the rule that scored — the one this recipe is pinned to, or the
|
|
338
|
+
# version current at evaluation time when it is not pinned. Present for a rule you
|
|
339
|
+
# authored, and omitted for a Prelude-managed one.
|
|
340
|
+
sig { returns(T.nilable(String)) }
|
|
341
|
+
attr_reader :version_id
|
|
342
|
+
|
|
343
|
+
sig { params(version_id: String).void }
|
|
344
|
+
attr_writer :version_id
|
|
345
|
+
|
|
346
|
+
sig do
|
|
347
|
+
params(
|
|
348
|
+
outcome:
|
|
349
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::OrSymbol,
|
|
350
|
+
rule_id: String,
|
|
351
|
+
type:
|
|
352
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type::OrSymbol,
|
|
353
|
+
weight: Integer,
|
|
354
|
+
blocked_by: String,
|
|
355
|
+
name: String,
|
|
356
|
+
unavailable: T::Boolean,
|
|
357
|
+
version_id: String
|
|
358
|
+
).returns(T.attached_class)
|
|
359
|
+
end
|
|
360
|
+
def self.new(
|
|
361
|
+
# What the rule concluded.
|
|
362
|
+
#
|
|
363
|
+
# - `TRIGGERED` - The condition held; `weight` was added to the score.
|
|
364
|
+
# - `NOT_TRIGGERED` - The condition did not hold.
|
|
365
|
+
# - `NOT_EVALUATED` - The rule could not run, because something it reads never
|
|
366
|
+
# arrived. This is not a quieter `NOT_TRIGGERED`: it contributed nothing either
|
|
367
|
+
# way, and it is why `partial_evidence` is set on the recipe.
|
|
368
|
+
# - `SKIPPED` - The rule was not run, because another rule had already determined
|
|
369
|
+
# the recipe's verdict — see `determined_by`. Nothing was missing and nothing
|
|
370
|
+
# failed, so `partial_evidence` is not set: `determined_by` is what accounts for
|
|
371
|
+
# the recipe's score resting on fewer rules.
|
|
372
|
+
outcome:,
|
|
373
|
+
# The rule that produced this result. Present whatever the rule's visibility, so a
|
|
374
|
+
# rule you cannot see the condition of is still one you can reweight, switch off,
|
|
375
|
+
# or ask us about.
|
|
376
|
+
rule_id:,
|
|
377
|
+
# Who authored the rule, which is what says how much of the rest of this result
|
|
378
|
+
# you get.
|
|
379
|
+
#
|
|
380
|
+
# - `MANAGED` - Prelude-owned, shared with customers: `name` and `version_id` are
|
|
381
|
+
# omitted, and `blocked_by` reports only `missing_data`.
|
|
382
|
+
# - `CUSTOM` - Yours: every field is returned.
|
|
383
|
+
type:,
|
|
384
|
+
# What this rule contributes to the recipe's score when it triggers.
|
|
385
|
+
weight:,
|
|
386
|
+
# Why the rule could not run, set only when `outcome` is `NOT_EVALUATED`.
|
|
387
|
+
#
|
|
388
|
+
# A rule you authored names the signal or attribute it waited on, since you wrote
|
|
389
|
+
# the expression that reads it. A Prelude-managed rule reports `missing_data` and
|
|
390
|
+
# nothing more: the signal it waited on is part of a condition that is not
|
|
391
|
+
# disclosed.
|
|
392
|
+
blocked_by: nil,
|
|
393
|
+
# The rule's name, present for a rule you authored and omitted for a
|
|
394
|
+
# Prelude-managed one. A managed rule's name describes what it looks for, which is
|
|
395
|
+
# as much of the condition as the expression is.
|
|
396
|
+
name: nil,
|
|
397
|
+
# The rule could not run for a reason on our side rather than anything about your
|
|
398
|
+
# request. `outcome` is `NOT_EVALUATED` and the failure is ours to fix.
|
|
399
|
+
unavailable: nil,
|
|
400
|
+
# The version of the rule that scored — the one this recipe is pinned to, or the
|
|
401
|
+
# version current at evaluation time when it is not pinned. Present for a rule you
|
|
402
|
+
# authored, and omitted for a Prelude-managed one.
|
|
403
|
+
version_id: nil
|
|
404
|
+
)
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
sig do
|
|
408
|
+
override.returns(
|
|
409
|
+
{
|
|
410
|
+
outcome:
|
|
411
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol,
|
|
412
|
+
rule_id: String,
|
|
413
|
+
type:
|
|
414
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type::TaggedSymbol,
|
|
415
|
+
weight: Integer,
|
|
416
|
+
blocked_by: String,
|
|
417
|
+
name: String,
|
|
418
|
+
unavailable: T::Boolean,
|
|
419
|
+
version_id: String
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
end
|
|
423
|
+
def to_hash
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
# What the rule concluded.
|
|
427
|
+
#
|
|
428
|
+
# - `TRIGGERED` - The condition held; `weight` was added to the score.
|
|
429
|
+
# - `NOT_TRIGGERED` - The condition did not hold.
|
|
430
|
+
# - `NOT_EVALUATED` - The rule could not run, because something it reads never
|
|
431
|
+
# arrived. This is not a quieter `NOT_TRIGGERED`: it contributed nothing either
|
|
432
|
+
# way, and it is why `partial_evidence` is set on the recipe.
|
|
433
|
+
# - `SKIPPED` - The rule was not run, because another rule had already determined
|
|
434
|
+
# the recipe's verdict — see `determined_by`. Nothing was missing and nothing
|
|
435
|
+
# failed, so `partial_evidence` is not set: `determined_by` is what accounts for
|
|
436
|
+
# the recipe's score resting on fewer rules.
|
|
437
|
+
module Outcome
|
|
438
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
439
|
+
|
|
440
|
+
TaggedSymbol =
|
|
441
|
+
T.type_alias do
|
|
442
|
+
T.all(
|
|
443
|
+
Symbol,
|
|
444
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome
|
|
445
|
+
)
|
|
446
|
+
end
|
|
447
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
448
|
+
|
|
449
|
+
TRIGGERED =
|
|
450
|
+
T.let(
|
|
451
|
+
:TRIGGERED,
|
|
452
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol
|
|
453
|
+
)
|
|
454
|
+
NOT_TRIGGERED =
|
|
455
|
+
T.let(
|
|
456
|
+
:NOT_TRIGGERED,
|
|
457
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol
|
|
458
|
+
)
|
|
459
|
+
NOT_EVALUATED =
|
|
460
|
+
T.let(
|
|
461
|
+
:NOT_EVALUATED,
|
|
462
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol
|
|
463
|
+
)
|
|
464
|
+
SKIPPED =
|
|
465
|
+
T.let(
|
|
466
|
+
:SKIPPED,
|
|
467
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
sig do
|
|
471
|
+
override.returns(
|
|
472
|
+
T::Array[
|
|
473
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Outcome::TaggedSymbol
|
|
474
|
+
]
|
|
475
|
+
)
|
|
476
|
+
end
|
|
477
|
+
def self.values
|
|
478
|
+
end
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
# Who authored the rule, which is what says how much of the rest of this result
|
|
482
|
+
# you get.
|
|
483
|
+
#
|
|
484
|
+
# - `MANAGED` - Prelude-owned, shared with customers: `name` and `version_id` are
|
|
485
|
+
# omitted, and `blocked_by` reports only `missing_data`.
|
|
486
|
+
# - `CUSTOM` - Yours: every field is returned.
|
|
487
|
+
module Type
|
|
488
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
489
|
+
|
|
490
|
+
TaggedSymbol =
|
|
491
|
+
T.type_alias do
|
|
492
|
+
T.all(
|
|
493
|
+
Symbol,
|
|
494
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type
|
|
495
|
+
)
|
|
496
|
+
end
|
|
497
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
498
|
+
|
|
499
|
+
MANAGED =
|
|
500
|
+
T.let(
|
|
501
|
+
:MANAGED,
|
|
502
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type::TaggedSymbol
|
|
503
|
+
)
|
|
504
|
+
CUSTOM =
|
|
505
|
+
T.let(
|
|
506
|
+
:CUSTOM,
|
|
507
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type::TaggedSymbol
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
sig do
|
|
511
|
+
override.returns(
|
|
512
|
+
T::Array[
|
|
513
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Rule::Type::TaggedSymbol
|
|
514
|
+
]
|
|
515
|
+
)
|
|
516
|
+
end
|
|
517
|
+
def self.values
|
|
518
|
+
end
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
# This recipe's own verdict. Normally the score against the threshold, unless a
|
|
523
|
+
# preempting rule fired — see `determined_by`.
|
|
524
|
+
module Verdict
|
|
525
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
526
|
+
|
|
527
|
+
TaggedSymbol =
|
|
528
|
+
T.type_alias do
|
|
529
|
+
T.all(
|
|
530
|
+
Symbol,
|
|
531
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict
|
|
532
|
+
)
|
|
533
|
+
end
|
|
534
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
535
|
+
|
|
536
|
+
PASS =
|
|
537
|
+
T.let(
|
|
538
|
+
:PASS,
|
|
539
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict::TaggedSymbol
|
|
540
|
+
)
|
|
541
|
+
FLAG =
|
|
542
|
+
T.let(
|
|
543
|
+
:FLAG,
|
|
544
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict::TaggedSymbol
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
sig do
|
|
548
|
+
override.returns(
|
|
549
|
+
T::Array[
|
|
550
|
+
PreludeSDK::Models::WatchEvaluateResponse::Recipe::Verdict::TaggedSymbol
|
|
551
|
+
]
|
|
552
|
+
)
|
|
553
|
+
end
|
|
554
|
+
def self.values
|
|
555
|
+
end
|
|
556
|
+
end
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
# The evaluation-level verdict, being the most severe verdict across the recipes
|
|
560
|
+
# that ran.
|
|
561
|
+
#
|
|
562
|
+
# - `PASS` - No recipe flagged.
|
|
563
|
+
# - `FLAG` - At least one recipe flagged.
|
|
564
|
+
module Verdict
|
|
565
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
566
|
+
|
|
567
|
+
TaggedSymbol =
|
|
568
|
+
T.type_alias do
|
|
569
|
+
T.all(Symbol, PreludeSDK::Models::WatchEvaluateResponse::Verdict)
|
|
570
|
+
end
|
|
571
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
572
|
+
|
|
573
|
+
PASS =
|
|
574
|
+
T.let(
|
|
575
|
+
:PASS,
|
|
576
|
+
PreludeSDK::Models::WatchEvaluateResponse::Verdict::TaggedSymbol
|
|
577
|
+
)
|
|
578
|
+
FLAG =
|
|
579
|
+
T.let(
|
|
580
|
+
:FLAG,
|
|
581
|
+
PreludeSDK::Models::WatchEvaluateResponse::Verdict::TaggedSymbol
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
sig do
|
|
585
|
+
override.returns(
|
|
586
|
+
T::Array[
|
|
587
|
+
PreludeSDK::Models::WatchEvaluateResponse::Verdict::TaggedSymbol
|
|
588
|
+
]
|
|
589
|
+
)
|
|
590
|
+
end
|
|
591
|
+
def self.values
|
|
592
|
+
end
|
|
593
|
+
end
|
|
594
|
+
end
|
|
595
|
+
end
|
|
596
|
+
end
|