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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/no_response/accounts.rb +1 -1
  3. data/lib/no_response/assessments.rb +2 -2
  4. data/lib/no_response/late_results.rb +19 -15
  5. data/lib/no_response/models/shared/account.rb +1 -1
  6. data/lib/no_response/models/shared/accountdecisionsbyflow.rb +1 -1
  7. data/lib/no_response/models/shared/assessment.rb +41 -176
  8. data/lib/no_response/models/shared/assessment.rbi +10 -82
  9. data/lib/no_response/models/shared/assessmentdetail.rb +245 -0
  10. data/lib/no_response/models/shared/assessmentdetail.rbi +122 -0
  11. data/lib/no_response/models/shared/{assessmentauthcontext.rb → assessmentdetailauthcontext.rb} +1 -1
  12. data/lib/no_response/models/shared/{assessmentauthcontext.rbi → assessmentdetailauthcontext.rbi} +2 -2
  13. data/lib/no_response/models/shared/{assessmenttiming.rb → assessmentdetailtiming.rb} +1 -1
  14. data/lib/no_response/models/shared/{assessmenttiming.rbi → assessmentdetailtiming.rbi} +2 -2
  15. data/lib/no_response/models/shared/assessmentlist.rb +3 -3
  16. data/lib/no_response/models/shared/assessmentrequest.rb +15 -14
  17. data/lib/no_response/models/shared/assessmentrequest.rbi +4 -4
  18. data/lib/no_response/models/shared/assessmentrequestpolicycontext.rb +3 -16
  19. data/lib/no_response/models/shared/assessmentrequestpolicycontext.rbi +0 -6
  20. data/lib/no_response/models/shared/depth.rb +4 -1
  21. data/lib/no_response/models/shared/flow.rb +6 -4
  22. data/lib/no_response/models/shared.rb +3 -3
  23. data/lib/no_response/sdkconfiguration.rb +2 -2
  24. data/lib/no_response/webhooks.rb +1 -1
  25. metadata +7 -7
  26. data/lib/no_response/models/shared/assessmentflow.rb +0 -17
  27. 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: 2469d4f72cf85b77dbd86ca8a05136ff313081e86be235d86cc5190ba9141639
4
- data.tar.gz: 4368344ab696f56ae59f9dc2b932f25f5e66183f6e57a3ebf398f79a0146e965
3
+ metadata.gz: 9ba556406e80e6bb7f20aeee106cc215b9872a1fbd1816663d6da76af9c1d568
4
+ data.tar.gz: 3c1214f820469af0cdc955ad85c6526edb30144fdf937f4a41f896f47b0b84cc
5
5
  SHA512:
6
- metadata.gz: 70c09610fdb41378166092d7af4693538817762093e6ff73df8b6333c341e0bbee290b3b8b6156140361131ac1ef716d4277aa88b75ce30fa4f3e92814810688
7
- data.tar.gz: 6f120c6191d655a540ffeb3d78f9c8c093c0cb6f42eb3641f0c2c9fb35076edf4d958af2965e6f517c380500c77b562795a09928ec5e095ecf0b959b4a286577
6
+ metadata.gz: 0023bb0cc6f1a40b655291291b9f06a478216cf395cde6e734497fbde1b3f304dac4e9fee9f9e9a9f2c779a013cf07b543bec5dbb27a09a90077a275cd763ff0
7
+ data.tar.gz: 79758d27c28ddf6630ac6e7e33db49011e4b19f56c1e272fe85d3d32f67a806f246d16dfa5a459121c1f69463d5a8cab4bdd31b2b3b0c70485caa0196db162dc
@@ -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
- # Returns within the deadline (3000 ms at most) with a complete, partial or pending assessment: 200 carries complete or partial, 202 carries pending with Location and Retry-After. A pending answer has no recommendation; apply your own fallback for pending, 429, 503 or a timeout. risk.block says when your block threshold was reached. 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.
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 recommendation rises. NoResponse sends the new version as a
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. Banning is opt-in.
34
- DEFAULT_POLICY = { 'allow' => NONE, 'step_up' => NONE, 'review' => REVOKE_SESSIONS }.freeze
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
- RECOMMENDATIONS = %w[allow step_up review].freeze
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. Only a served
65
- # assessment with a recommendation can act; a test event never does.
66
- # policy maps allow, step_up and review (as strings or symbols) to NONE,
67
- # REVOKE_SESSIONS or BAN; a recommendation you leave out does nothing. An
68
- # unknown action raises ArgumentError.
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
- recommendation = data.recommendation || data.risk&.recommendation
74
- recommendation = recommendation.to_s
75
- return NONE unless RECOMMENDATIONS.include?(recommendation)
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?(recommendation)
82
+ return NONE unless table.key?(decision)
79
83
 
80
- action = table[recommendation]
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 risk.decision.
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 risk.decision.
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 of one account, as POST /v1/assessments, GET /v1/assessments/{assessment_id} and the assessment.updated webhook return it. status says whether it is final (complete), usable with a source still running (partial) or not yet usable (pending). risk and recommendation are present for complete and partial; assessment_url is present for pending. Keep the highest assessment_version.
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
- # Opaque, server-assigned assessment id: 'asm_' and a 26-character Crockford base32 ULID. Unique within the tenant; another tenant's assessment id answers 404.
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
- # Ordinal confidence in the recommendation under the current policy: low, medium, high or unavailable.
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
- :confidence,
39
- Models::Shared::Confidence,
28
+ :flow,
29
+ Models::Shared::Flow,
40
30
  {
41
31
  'format_json': {
42
- 'letter_case': ::NoResponse::Utils.field_name("confidence"),
32
+ 'letter_case': ::NoResponse::Utils.field_name("flow"),
43
33
  required: true,
44
- 'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::Confidence, false)
34
+ 'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::Flow, false)
45
35
  }
46
36
  }
47
37
  )
48
- # The lanes that did not settle, each listed once with a reason; lanes, not sources. In a detailed view a lane is listed exactly when one of its signals did not settle; a standard view carries no signals to match.
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
- :incomplete_sources,
51
- Crystalline::Array.new(Models::Shared::IncompleteSource),
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("recommendation"),
109
- 'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::Recommendation, true)
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
- # The one risk decision for this event. score is 0 (safe) to 100 (risky): the sum of the weights of the reasons that fired, clamped to 0 to 100, from hand-set versioned weights. Every answer with a recommendation carries it, and the top-level recommendation equals risk.recommendation. It names no source or provider.
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
- :signals,
122
- Crystalline::Nilable.new(Crystalline::Array.new(Models::Shared::Signal)),
123
- {'format_json': {'letter_case': ::NoResponse::Utils.field_name("signals")}}
52
+ :detail,
53
+ Models::Shared::AssessmentDetail,
54
+ {'format_json': {'letter_case': ::NoResponse::Utils.field_name("detail"), required: true}}
124
55
  )
125
- # Labels the v0 policy as hand-authored and not statistically validated.
56
+ # Version of the body shape.
126
57
  field(
127
- :policy_basis,
58
+ :schema_version,
128
59
  ::String,
129
- {'format_json': {'letter_case': ::NoResponse::Utils.field_name("policy_basis"), required: true}}
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
- # The identity fields of the auth context the assessment was made with, echoed for the tenant's own correlation: the request's auth_context, or the one a hosted provider hook (POST /hooks/{integration_id}) built, with transport provider_hook and its hook_point. Present exactly when the request carried an auth_context, and the same on every revision of the assessment. Values are as the request or the hook sent them; tokens, timestamps, roles and scopes are not echoed, and the echo does not change the score.
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
- :auth_context,
140
- Crystalline::Nilable.new(Models::Shared::AssessmentAuthContext),
141
- {'format_json': {'letter_case': ::NoResponse::Utils.field_name("auth_context")}}
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
- assessment_id: ::String,
147
- account_id: ::String,
71
+ id: ::String,
148
72
  status: Models::Shared::Status,
149
- confidence: Models::Shared::Confidence,
150
- incomplete_sources: T::Array[Models::Shared::IncompleteSource],
151
- policy_version: ::String,
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
- request_id: T.nilable(::String),
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
- assessment_id:,
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
- @confidence = confidence
193
- @incomplete_sources = incomplete_sources
194
- @policy_version = policy_version
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
- @request_id = request_id
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 @assessment_id == other.assessment_id
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 @confidence == other.confidence
225
- return false unless @incomplete_sources == other.incomplete_sources
226
- return false unless @policy_version == other.policy_version
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 @request_id == other.request_id
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 assessment_id
9
+ def id
10
10
  end
11
11
 
12
- def assessment_id=(str_)
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 confidence
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 updated_at=(str_)
24
+ def flow=(str_)
61
25
  end
62
26
 
63
- def expires_at
27
+ def depth
64
28
  end
65
29
 
66
- def expires_at=(str_)
30
+ def depth=(str_)
67
31
  end
68
32
 
69
- def timing
33
+ def detail
70
34
  end
71
35
 
72
- def timing=(str_)
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 request_id
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 auth_context=(str_)
48
+ def account=(str_)
121
49
  end
122
50
  end