noresponse 2.1.15 → 3.0.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/lib/no_response/accounts.rb +1 -1
- data/lib/no_response/assessments.rb +2 -2
- data/lib/no_response/late_results.rb +19 -15
- data/lib/no_response/models/shared/account.rb +1 -1
- data/lib/no_response/models/shared/accountdecisionsbyflow.rb +1 -1
- data/lib/no_response/models/shared/assessment.rb +41 -176
- data/lib/no_response/models/shared/assessment.rbi +10 -82
- data/lib/no_response/models/shared/assessmentdetail.rb +245 -0
- data/lib/no_response/models/shared/assessmentdetail.rbi +122 -0
- data/lib/no_response/models/shared/{assessmentauthcontext.rb → assessmentdetailauthcontext.rb} +1 -1
- data/lib/no_response/models/shared/{assessmentauthcontext.rbi → assessmentdetailauthcontext.rbi} +2 -2
- data/lib/no_response/models/shared/{assessmenttiming.rb → assessmentdetailtiming.rb} +1 -1
- data/lib/no_response/models/shared/{assessmenttiming.rbi → assessmentdetailtiming.rbi} +2 -2
- data/lib/no_response/models/shared/assessmentlist.rb +3 -3
- data/lib/no_response/models/shared/assessmentrequest.rb +15 -14
- data/lib/no_response/models/shared/assessmentrequest.rbi +4 -4
- data/lib/no_response/models/shared/assessmentrequestpolicycontext.rb +3 -16
- data/lib/no_response/models/shared/assessmentrequestpolicycontext.rbi +0 -6
- data/lib/no_response/models/shared/depth.rb +4 -1
- data/lib/no_response/models/shared/flow.rb +6 -4
- data/lib/no_response/models/shared.rb +3 -3
- data/lib/no_response/sdkconfiguration.rb +2 -2
- data/lib/no_response/webhooks.rb +1 -1
- metadata +7 -7
- data/lib/no_response/models/shared/assessmentflow.rb +0 -17
- data/lib/no_response/models/shared/assessmentflow.rbi +0 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ba556406e80e6bb7f20aeee106cc215b9872a1fbd1816663d6da76af9c1d568
|
|
4
|
+
data.tar.gz: 3c1214f820469af0cdc955ad85c6526edb30144fdf937f4a41f896f47b0b84cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0023bb0cc6f1a40b655291291b9f06a478216cf395cde6e734497fbde1b3f304dac4e9fee9f9e9a9f2c779a013cf07b543bec5dbb27a09a90077a275cd763ff0
|
|
7
|
+
data.tar.gz: 79758d27c28ddf6630ac6e7e33db49011e4b19f56c1e272fe85d3d32f67a806f246d16dfa5a459121c1f69463d5a8cab4bdd31b2b3b0c70485caa0196db162dc
|
data/lib/no_response/accounts.rb
CHANGED
|
@@ -49,7 +49,7 @@ module NoResponse
|
|
|
49
49
|
}
|
|
50
50
|
def get(account_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
51
51
|
# get - Read an account's one current risk.
|
|
52
|
-
# An account is the account_id you send with your assessments. Its current risk is the risk of its latest assessment with a decision (status complete or partial), scored as GET /v1/assessments/{assessment_id} scores that assessment, with a decision for each flow. Every assessment updates its account: once an assessment completes, the account carries its risk. Requires the history scope. Read-only and safe to retry. An account with no unexpired assessment that has a decision answers 404 not_found, and a malformed account_id answers 400 invalid_request.
|
|
52
|
+
# An account is the account_id you send with your assessments. Its current risk is the risk of its latest assessment with a decision (status complete or partial), scored as GET /v1/assessments/{assessment_id} scores that assessment, with a decision for each flow; risk.decision is the decision for the flow of that assessment. Every assessment answers with this same account. Every assessment updates its account: once an assessment completes, the account carries its risk. Requires the history scope. Read-only and safe to retry. An account with no unexpired assessment that has a decision answers 404 not_found, and a malformed account_id answers 400 invalid_request.
|
|
53
53
|
request = Models::Operations::GetAccountRequest.new(
|
|
54
54
|
account_id: account_id
|
|
55
55
|
)
|
|
@@ -50,7 +50,7 @@ module NoResponse
|
|
|
50
50
|
}
|
|
51
51
|
def create(body:, idempotency_key: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
52
52
|
# create - Assess identifiers for a signup or gateway decision.
|
|
53
|
-
#
|
|
53
|
+
# Assesses one signup, login or purchase (flow) and answers with the account's one current risk: account.risk.decision is the decision for this flow (allow, step_up, review or block, where block means your block threshold was reached), and detail holds this assessment's own facts. depth sets how long the answer waits for sources: quick waits only for the fast ones (500 ms), full for the whole budget (3000 ms at most); it defaults to full for signup and purchase and quick for login. 200 carries complete or partial, 202 carries pending with Location and Retry-After. While the account's first assessment is pending, account is absent: apply your own fallback for that, 429, 503 or a timeout. NoResponse blocks nothing itself; you decide. Requires the assess scope. Idempotency-Key is optional in the SDK and is bound to the body for 24 hours: the same key with the same body replays the latest assessment with Idempotent-Replayed: true and starts no new work; the same key with a different body answers 409 idempotency_key_reused. response_mode defaults to standard; detailed needs the detailed scope.
|
|
54
54
|
request = Models::Operations::CreateAssessmentRequest.new(
|
|
55
55
|
body: body,
|
|
56
56
|
idempotency_key: idempotency_key
|
|
@@ -348,7 +348,7 @@ module NoResponse
|
|
|
348
348
|
}
|
|
349
349
|
def get(assessment_id:, response_mode: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
350
350
|
# get - Poll the authoritative assessment of one assessment.
|
|
351
|
-
# Returns the highest assessment_version. Requires the assess or history scope. While status is pending, or partial with a source still running, the response carries Retry-After; poll no faster than it says. Another tenant's assessment, an unknown or expired assessment and a malformed assessment_id all answer 404 not_found. response_mode=detailed needs the detailed scope.
|
|
351
|
+
# Returns the highest assessment_version, with the account's current risk. Requires the assess or history scope. While status is pending, or partial with a source still running, the response carries Retry-After; poll no faster than it says. Another tenant's assessment, an unknown or expired assessment and a malformed assessment_id all answer 404 not_found. response_mode=detailed needs the detailed scope.
|
|
352
352
|
request = Models::Operations::GetAssessmentRequest.new(
|
|
353
353
|
assessment_id: assessment_id,
|
|
354
354
|
response_mode: response_mode
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Late-result handlers. Hand-written beside the generated client.
|
|
5
5
|
#
|
|
6
6
|
# An assessment can be revised after the signup was allowed: a slow source
|
|
7
|
-
# settles and the
|
|
7
|
+
# settles and the account's decision rises. NoResponse sends the new version as a
|
|
8
8
|
# signed assessment.updated webhook. LateResults.handle verifies that delivery
|
|
9
9
|
# with Webhooks.construct_event, picks an action from your policy, and acts
|
|
10
10
|
# through the auth provider's admin API: revoke the user's sessions or ban the
|
|
@@ -30,10 +30,12 @@ module NoResponse
|
|
|
30
30
|
BAN = 'ban'
|
|
31
31
|
ACTIONS = [NONE, REVOKE_SESSIONS, BAN].freeze
|
|
32
32
|
|
|
33
|
-
# Revoke sessions on review; do nothing on allow or step_up.
|
|
34
|
-
|
|
33
|
+
# Revoke sessions on review and block; do nothing on allow or step_up.
|
|
34
|
+
# Banning is opt-in.
|
|
35
|
+
DEFAULT_POLICY = { 'allow' => NONE, 'step_up' => NONE, 'review' => REVOKE_SESSIONS,
|
|
36
|
+
'block' => REVOKE_SESSIONS }.freeze
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
DECISIONS = %w[allow step_up review block].freeze
|
|
37
39
|
|
|
38
40
|
# Raised when the provider's admin API refuses a call. Answer the webhook
|
|
39
41
|
# with a 5xx so NoResponse retries it. The message holds no response body
|
|
@@ -61,23 +63,25 @@ module NoResponse
|
|
|
61
63
|
Result = Struct.new(:event, :action, :user_id, keyword_init: true)
|
|
62
64
|
|
|
63
65
|
class << self
|
|
64
|
-
# The action your policy names for a verified event
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
#
|
|
66
|
+
# The action your policy names for a verified event, from the account's
|
|
67
|
+
# decision (data.account.risk.decision). Only a served assessment whose
|
|
68
|
+
# account has a decision can act; a pending assessment, an expiry and a
|
|
69
|
+
# test event never do. policy maps allow, step_up, review and block (as
|
|
70
|
+
# strings or symbols) to NONE, REVOKE_SESSIONS or BAN; a decision you
|
|
71
|
+
# leave out does nothing. An unknown action raises ArgumentError.
|
|
69
72
|
def action_for(event, policy = DEFAULT_POLICY)
|
|
70
73
|
return NONE if event.type != 'assessment.updated' || event.test? || event.expired?
|
|
71
74
|
|
|
72
75
|
data = event.data
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
return NONE if data.status == Models::Shared::Status::PENDING || data.account.nil?
|
|
77
|
+
|
|
78
|
+
decision = data.account.risk.decision.to_s
|
|
79
|
+
return NONE unless DECISIONS.include?(decision)
|
|
76
80
|
|
|
77
81
|
table = policy.to_h.transform_keys(&:to_s)
|
|
78
|
-
return NONE unless table.key?(
|
|
82
|
+
return NONE unless table.key?(decision)
|
|
79
83
|
|
|
80
|
-
action = table[
|
|
84
|
+
action = table[decision]
|
|
81
85
|
return NONE if action.nil?
|
|
82
86
|
|
|
83
87
|
action = action.to_s
|
|
@@ -103,7 +107,7 @@ module NoResponse
|
|
|
103
107
|
action = action_for(event, policy)
|
|
104
108
|
return Result.new(event: event, action: NONE) if action == NONE || event.type != 'assessment.updated'
|
|
105
109
|
|
|
106
|
-
account_id = event.data.account_id
|
|
110
|
+
account_id = event.data.detail.account_id
|
|
107
111
|
resolved = user_id ? user_id.call(account_id, event) : account_id
|
|
108
112
|
return Result.new(event: event, action: NONE) if resolved.nil? || resolved.to_s.empty?
|
|
109
113
|
|
|
@@ -17,7 +17,7 @@ module NoResponse
|
|
|
17
17
|
Models::Shared::AccountRisk,
|
|
18
18
|
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("risk"), required: true}}
|
|
19
19
|
)
|
|
20
|
-
# The decision for each flow. Every flow uses the tenant's signup thresholds today, so all three equal
|
|
20
|
+
# The decision for each flow. Every flow uses the tenant's signup thresholds today, so all three are equal.
|
|
21
21
|
field(
|
|
22
22
|
:decisions_by_flow,
|
|
23
23
|
Models::Shared::AccountDecisionsByFlow,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
module NoResponse
|
|
5
5
|
module Models
|
|
6
6
|
module Shared
|
|
7
|
-
# The decision for each flow. Every flow uses the tenant's signup thresholds today, so all three equal
|
|
7
|
+
# The decision for each flow. Every flow uses the tenant's signup thresholds today, so all three are equal.
|
|
8
8
|
class AccountDecisionsByFlow
|
|
9
9
|
extend T::Sig
|
|
10
10
|
include Crystalline::MetadataFields
|
|
@@ -4,23 +4,13 @@
|
|
|
4
4
|
module NoResponse
|
|
5
5
|
module Models
|
|
6
6
|
module Shared
|
|
7
|
-
# One assessment
|
|
7
|
+
# One assessment, as POST /v1/assessments, GET /v1/assessments/{assessment_id} and the assessment.updated webhook return it. account is the account's one current risk: its score, the decision for this assessment's flow, the reasons and the decision for each flow. detail holds this assessment's own facts. status says whether the assessment is final (complete), usable with a source still running (partial) or not yet usable (pending). While the account's first assessment is pending, account is absent; wait for the webhook or poll the assessment. Keep the highest detail.assessment_version.
|
|
8
8
|
class Assessment
|
|
9
9
|
extend T::Sig
|
|
10
10
|
include Crystalline::MetadataFields
|
|
11
11
|
|
|
12
|
-
#
|
|
13
|
-
field(
|
|
14
|
-
:assessment_id,
|
|
15
|
-
::String,
|
|
16
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("assessment_id"), required: true}}
|
|
17
|
-
)
|
|
18
|
-
# Your own opaque identifier for the account being checked, scoped to your tenant. Use an id you mint, with no direct identifier (email, phone, name or national id) in it. '|' is accepted so an Auth0 user id such as 'auth0|64abc' passes unchanged; '@', '+', '$' and whitespace are refused by the pattern, as is an exact-shape JWT; a hex digest such as a SHA-256 is allowed, because hashing an internal id is a common pseudonymous scheme. A value such as '07700900123' or 'jane.doe.gmail.com' cannot be told apart from an opaque id. It travels in bodies, and in a URL only as the path segment of GET /v1/accounts/{account_id} and its /assessments. An assessment requested by a provider hook at pre_registration, which has no account yet, carries the server-issued account_id pre: followed by its assessment_id.
|
|
19
|
-
field(
|
|
20
|
-
:account_id,
|
|
21
|
-
::String,
|
|
22
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("account_id"), required: true}}
|
|
23
|
-
)
|
|
12
|
+
# This assessment's id, equal to detail.assessment_id.
|
|
13
|
+
field :id, ::String, {'format_json': {'letter_case': ::NoResponse::Utils.field_name("id"), required: true}}
|
|
24
14
|
# complete: final; nothing is still running. A lane that failed or missed its 10 s deadline stays listed in incomplete_sources, and confidence is lower. partial: a recommendation exists and at least one lane is still running or did not settle (see incomplete_sources). pending: nothing usable before the deadline; no recommendation yet, poll or wait for the webhook.
|
|
25
15
|
field(
|
|
26
16
|
:status,
|
|
@@ -33,210 +23,85 @@ module NoResponse
|
|
|
33
23
|
}
|
|
34
24
|
}
|
|
35
25
|
)
|
|
36
|
-
#
|
|
26
|
+
# The customer event an assessment is made for: signup (a new account), login (a returning sign-in) or purchase (a payment or credit grant). The account's risk is reported with the decision for this flow.
|
|
37
27
|
field(
|
|
38
|
-
:
|
|
39
|
-
Models::Shared::
|
|
28
|
+
:flow,
|
|
29
|
+
Models::Shared::Flow,
|
|
40
30
|
{
|
|
41
31
|
'format_json': {
|
|
42
|
-
'letter_case': ::NoResponse::Utils.field_name("
|
|
32
|
+
'letter_case': ::NoResponse::Utils.field_name("flow"),
|
|
43
33
|
required: true,
|
|
44
|
-
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::
|
|
34
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::Flow, false)
|
|
45
35
|
}
|
|
46
36
|
}
|
|
47
37
|
)
|
|
48
|
-
#
|
|
38
|
+
# How long the synchronous answer waits for sources. quick waits only for the fast sources, those that answer within 500 ms of ingress (or deadline_ms when lower); full waits for the whole budget, up to 3000 ms. Sources still running at the cut continue asynchronously and update the assessment either way.
|
|
49
39
|
field(
|
|
50
|
-
:
|
|
51
|
-
|
|
52
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("incomplete_sources"), required: true}}
|
|
53
|
-
)
|
|
54
|
-
# Version of the hand-authored heuristic weights that produced the recommendation, for example 'risk-2026-10.7'. A tenant threshold override adds a +t<N> suffix, e.g. 'risk-2026-10.7+t3'.
|
|
55
|
-
field(
|
|
56
|
-
:policy_version,
|
|
57
|
-
::String,
|
|
58
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("policy_version"), required: true}}
|
|
59
|
-
)
|
|
60
|
-
# Monotonic revision of this assessment. 1 on the synchronous answer; each material change while the assessment is served (an async continuation settling a source, a change of recommendation, confidence or status) increments it. Expiry does not increment it: an expired assessment is gone, not revised, and the expiry webhook carries the last served version.
|
|
61
|
-
field(
|
|
62
|
-
:assessment_version,
|
|
63
|
-
::Integer,
|
|
64
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("assessment_version"), required: true}}
|
|
65
|
-
)
|
|
66
|
-
# When the assessment was created. Fixed for the life of the assessment: every revision carries the same created_at.
|
|
67
|
-
field(
|
|
68
|
-
:created_at,
|
|
69
|
-
::String,
|
|
70
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("created_at"), required: true}}
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
field(
|
|
74
|
-
:updated_at,
|
|
75
|
-
::String,
|
|
76
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("updated_at"), required: true}}
|
|
77
|
-
)
|
|
78
|
-
# After this instant the assessment is no longer served: GET /v1/assessments/{assessment_id} answers 404 and it leaves the account history. It is created_at plus your retention period at creation (default and maximum 365 days) and is fixed per record: a later revision keeps it, and a new assessment for the same account starts its own clock. If you later shorten retention, the effective expiry becomes created_at plus the shorter of the two periods.
|
|
79
|
-
field(
|
|
80
|
-
:expires_at,
|
|
81
|
-
::String,
|
|
82
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("expires_at"), required: true}}
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
field(
|
|
86
|
-
:timing,
|
|
87
|
-
Models::Shared::AssessmentTiming,
|
|
88
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("timing"), required: true}}
|
|
89
|
-
)
|
|
90
|
-
# Version of the body shape.
|
|
91
|
-
field(
|
|
92
|
-
:schema_version,
|
|
93
|
-
::String,
|
|
94
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("schema_version"), required: true}}
|
|
95
|
-
)
|
|
96
|
-
# An optional provider correlation id, echoed back. It is not an idempotency key. Refuses an exact-shape JWT or a bare 40, 64 or 128 character hex digest; a UUID is accepted.
|
|
97
|
-
field(
|
|
98
|
-
:request_id,
|
|
99
|
-
Crystalline::Nilable.new(::String),
|
|
100
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("request_id")}}
|
|
101
|
-
)
|
|
102
|
-
# The recommended action: allow, step_up or review. Your application applies it.
|
|
103
|
-
field(
|
|
104
|
-
:recommendation,
|
|
105
|
-
Crystalline::Nilable.new(Models::Shared::Recommendation),
|
|
40
|
+
:depth,
|
|
41
|
+
Models::Shared::Depth,
|
|
106
42
|
{
|
|
107
43
|
'format_json': {
|
|
108
|
-
'letter_case': ::NoResponse::Utils.field_name("
|
|
109
|
-
|
|
44
|
+
'letter_case': ::NoResponse::Utils.field_name("depth"),
|
|
45
|
+
required: true,
|
|
46
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::Depth, false)
|
|
110
47
|
}
|
|
111
48
|
}
|
|
112
49
|
)
|
|
113
|
-
#
|
|
114
|
-
field(
|
|
115
|
-
:risk,
|
|
116
|
-
Crystalline::Nilable.new(Models::Shared::Risk),
|
|
117
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("risk")}}
|
|
118
|
-
)
|
|
119
|
-
# Detailed view only (response_mode=detailed, which needs the detailed scope): a standard answer omits signals[], and a detailed one always carries it, possibly empty. The body does not name its mode, so that rule is the serving gate's; the schema states the half it can: an answer with risk.details is a detailed view and carries signals[]. At most one signal per (type, source_id, identifier).
|
|
50
|
+
# One assessment's own facts: its score and recommendation, the signals behind them, the lanes still running and its timing. risk here is this assessment's own score; the account's current risk is the account member of the assessment. risk and recommendation are present for complete and partial; assessment_url is present for pending.
|
|
120
51
|
field(
|
|
121
|
-
:
|
|
122
|
-
|
|
123
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("
|
|
52
|
+
:detail,
|
|
53
|
+
Models::Shared::AssessmentDetail,
|
|
54
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("detail"), required: true}}
|
|
124
55
|
)
|
|
125
|
-
#
|
|
56
|
+
# Version of the body shape.
|
|
126
57
|
field(
|
|
127
|
-
:
|
|
58
|
+
:schema_version,
|
|
128
59
|
::String,
|
|
129
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("
|
|
130
|
-
)
|
|
131
|
-
# Server-relative path of the authoritative assessment, GET /v1/assessments/{assessment_id}.
|
|
132
|
-
field(
|
|
133
|
-
:assessment_url,
|
|
134
|
-
Crystalline::Nilable.new(::String),
|
|
135
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("assessment_url")}}
|
|
60
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("schema_version"), required: true}}
|
|
136
61
|
)
|
|
137
|
-
#
|
|
62
|
+
# Body of the 200 answer to GET /v1/accounts/{account_id}: the one current risk of one of the calling tenant's accounts. It is the risk of the account's latest assessment that has a decision (status complete or partial), by created_at and then assessment_id, scored exactly as GET /v1/assessments/{assessment_id} scores that assessment. Its assessments are the account's history (GET /v1/accounts/{account_id}/assessments).
|
|
138
63
|
field(
|
|
139
|
-
:
|
|
140
|
-
Crystalline::Nilable.new(Models::Shared::
|
|
141
|
-
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("
|
|
64
|
+
:account,
|
|
65
|
+
Crystalline::Nilable.new(Models::Shared::Account),
|
|
66
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("account")}}
|
|
142
67
|
)
|
|
143
68
|
|
|
144
69
|
sig {
|
|
145
70
|
params(
|
|
146
|
-
|
|
147
|
-
account_id: ::String,
|
|
71
|
+
id: ::String,
|
|
148
72
|
status: Models::Shared::Status,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
assessment_version: ::Integer,
|
|
153
|
-
created_at: ::String,
|
|
154
|
-
updated_at: ::String,
|
|
155
|
-
expires_at: ::String,
|
|
156
|
-
timing: Models::Shared::AssessmentTiming,
|
|
73
|
+
flow: Models::Shared::Flow,
|
|
74
|
+
depth: Models::Shared::Depth,
|
|
75
|
+
detail: Models::Shared::AssessmentDetail,
|
|
157
76
|
schema_version: ::String,
|
|
158
|
-
|
|
159
|
-
recommendation: T.nilable(Models::Shared::Recommendation),
|
|
160
|
-
risk: T.nilable(Models::Shared::Risk),
|
|
161
|
-
signals: T.nilable(T::Array[Models::Shared::Signal]),
|
|
162
|
-
policy_basis: ::String,
|
|
163
|
-
assessment_url: T.nilable(::String),
|
|
164
|
-
auth_context: T.nilable(Models::Shared::AssessmentAuthContext)
|
|
77
|
+
account: T.nilable(Models::Shared::Account)
|
|
165
78
|
)
|
|
166
79
|
.void
|
|
167
80
|
}
|
|
168
|
-
def initialize(
|
|
169
|
-
|
|
170
|
-
account_id:,
|
|
171
|
-
status:,
|
|
172
|
-
confidence:,
|
|
173
|
-
incomplete_sources:,
|
|
174
|
-
policy_version:,
|
|
175
|
-
assessment_version:,
|
|
176
|
-
created_at:,
|
|
177
|
-
updated_at:,
|
|
178
|
-
expires_at:,
|
|
179
|
-
timing:,
|
|
180
|
-
schema_version: "1",
|
|
181
|
-
request_id: nil,
|
|
182
|
-
recommendation: nil,
|
|
183
|
-
risk: nil,
|
|
184
|
-
signals: nil,
|
|
185
|
-
policy_basis: "heuristic_unvalidated",
|
|
186
|
-
assessment_url: nil,
|
|
187
|
-
auth_context: nil
|
|
188
|
-
)
|
|
189
|
-
@assessment_id = assessment_id
|
|
190
|
-
@account_id = account_id
|
|
81
|
+
def initialize(id:, status:, flow:, depth:, detail:, schema_version: "1", account: nil)
|
|
82
|
+
@id = id
|
|
191
83
|
@status = status
|
|
192
|
-
@
|
|
193
|
-
@
|
|
194
|
-
@
|
|
195
|
-
@assessment_version = assessment_version
|
|
196
|
-
@created_at = created_at
|
|
197
|
-
@updated_at = updated_at
|
|
198
|
-
@expires_at = expires_at
|
|
199
|
-
@timing = timing
|
|
84
|
+
@flow = flow
|
|
85
|
+
@depth = depth
|
|
86
|
+
@detail = detail
|
|
200
87
|
unless schema_version == "1"
|
|
201
88
|
raise ArgumentError, "Invalid value for schema_version"
|
|
202
89
|
end
|
|
203
90
|
|
|
204
91
|
@schema_version = "1"
|
|
205
|
-
@
|
|
206
|
-
@recommendation = recommendation
|
|
207
|
-
@risk = risk
|
|
208
|
-
@signals = signals
|
|
209
|
-
unless policy_basis == "heuristic_unvalidated"
|
|
210
|
-
raise ArgumentError, "Invalid value for policy_basis"
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
@policy_basis = "heuristic_unvalidated"
|
|
214
|
-
@assessment_url = assessment_url
|
|
215
|
-
@auth_context = auth_context
|
|
92
|
+
@account = account
|
|
216
93
|
end
|
|
217
94
|
|
|
218
95
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
219
96
|
def ==(other)
|
|
220
97
|
return false unless other.is_a?(self.class)
|
|
221
|
-
return false unless @
|
|
222
|
-
return false unless @account_id == other.account_id
|
|
98
|
+
return false unless @id == other.id
|
|
223
99
|
return false unless @status == other.status
|
|
224
|
-
return false unless @
|
|
225
|
-
return false unless @
|
|
226
|
-
return false unless @
|
|
227
|
-
return false unless @assessment_version == other.assessment_version
|
|
228
|
-
return false unless @created_at == other.created_at
|
|
229
|
-
return false unless @updated_at == other.updated_at
|
|
230
|
-
return false unless @expires_at == other.expires_at
|
|
231
|
-
return false unless @timing == other.timing
|
|
100
|
+
return false unless @flow == other.flow
|
|
101
|
+
return false unless @depth == other.depth
|
|
102
|
+
return false unless @detail == other.detail
|
|
232
103
|
return false unless @schema_version == other.schema_version
|
|
233
|
-
return false unless @
|
|
234
|
-
return false unless @recommendation == other.recommendation
|
|
235
|
-
return false unless @risk == other.risk
|
|
236
|
-
return false unless @signals == other.signals
|
|
237
|
-
return false unless @policy_basis == other.policy_basis
|
|
238
|
-
return false unless @assessment_url == other.assessment_url
|
|
239
|
-
return false unless @auth_context == other.auth_context
|
|
104
|
+
return false unless @account == other.account
|
|
240
105
|
true
|
|
241
106
|
end
|
|
242
107
|
end
|
|
@@ -6,16 +6,10 @@ class NoResponse::Models::Shared::Assessment
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
class NoResponse::Models::Shared::Assessment
|
|
9
|
-
def
|
|
9
|
+
def id
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def account_id
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def account_id=(str_)
|
|
12
|
+
def id=(str_)
|
|
19
13
|
end
|
|
20
14
|
|
|
21
15
|
def status
|
|
@@ -24,52 +18,22 @@ class NoResponse::Models::Shared::Assessment
|
|
|
24
18
|
def status=(str_)
|
|
25
19
|
end
|
|
26
20
|
|
|
27
|
-
def
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def confidence=(str_)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def incomplete_sources
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def incomplete_sources=(str_)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def policy_version
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def policy_version=(str_)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def assessment_version
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def assessment_version=(str_)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def created_at
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def created_at=(str_)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def updated_at
|
|
21
|
+
def flow
|
|
58
22
|
end
|
|
59
23
|
|
|
60
|
-
def
|
|
24
|
+
def flow=(str_)
|
|
61
25
|
end
|
|
62
26
|
|
|
63
|
-
def
|
|
27
|
+
def depth
|
|
64
28
|
end
|
|
65
29
|
|
|
66
|
-
def
|
|
30
|
+
def depth=(str_)
|
|
67
31
|
end
|
|
68
32
|
|
|
69
|
-
def
|
|
33
|
+
def detail
|
|
70
34
|
end
|
|
71
35
|
|
|
72
|
-
def
|
|
36
|
+
def detail=(str_)
|
|
73
37
|
end
|
|
74
38
|
|
|
75
39
|
def schema_version
|
|
@@ -78,45 +42,9 @@ class NoResponse::Models::Shared::Assessment
|
|
|
78
42
|
def schema_version=(str_)
|
|
79
43
|
end
|
|
80
44
|
|
|
81
|
-
def
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def request_id=(str_)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
def recommendation
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def recommendation=(str_)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def risk
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
def risk=(str_)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
def signals
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def signals=(str_)
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def policy_basis
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def policy_basis=(str_)
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
def assessment_url
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def assessment_url=(str_)
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
def auth_context
|
|
45
|
+
def account
|
|
118
46
|
end
|
|
119
47
|
|
|
120
|
-
def
|
|
48
|
+
def account=(str_)
|
|
121
49
|
end
|
|
122
50
|
end
|