noresponse 2.1.0 → 2.1.2
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 +654 -0
- data/lib/no_response/assessments.rb +1 -1
- data/lib/no_response/models/operations/getaccount_request.rb +29 -0
- data/lib/no_response/models/operations/getaccount_request.rbi +14 -0
- data/lib/no_response/models/operations/getaccount_response.rb +32 -0
- data/lib/no_response/models/operations/getaccount_response.rbi +20 -0
- data/lib/no_response/models/operations/listaccountassessments_request.rb +61 -0
- data/lib/no_response/models/operations/listaccountassessments_request.rbi +32 -0
- data/lib/no_response/models/operations/listaccountassessments_response.rb +44 -0
- data/lib/no_response/models/operations/listaccountassessments_response.rbi +20 -0
- data/lib/no_response/models/operations.rb +4 -0
- data/lib/no_response/models/shared/account.rb +83 -0
- data/lib/no_response/models/shared/account.rbi +44 -0
- data/lib/no_response/models/shared/accountdecision.rb +21 -0
- data/lib/no_response/models/shared/accountdecision.rbi +9 -0
- data/lib/no_response/models/shared/accountdecisionsbyflow.rb +74 -0
- data/lib/no_response/models/shared/accountdecisionsbyflow.rbi +26 -0
- data/lib/no_response/models/shared/accountrisk.rb +62 -0
- data/lib/no_response/models/shared/accountrisk.rbi +26 -0
- data/lib/no_response/models/shared/accountriskreason.rb +67 -0
- data/lib/no_response/models/shared/accountriskreason.rbi +26 -0
- data/lib/no_response/models/shared/assessment.rb +1 -1
- data/lib/no_response/models/shared/assessmentlist.rb +1 -1
- data/lib/no_response/models/shared/assessmentquery.rb +1 -1
- data/lib/no_response/models/shared/assessmentrequest.rb +2 -2
- data/lib/no_response/models/shared.rb +5 -0
- data/lib/no_response/noresponseclient.rb +2 -1
- data/lib/no_response/sdkconfiguration.rb +2 -2
- data/lib/noresponse.rb +1 -0
- metadata +20 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class GetAccountRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The account_id the tenant sends with its assessments, as one path segment (percent-encode '|' and ':' if the client requires it). A value that does not match the account_id shape answers 400 invalid_request.
|
|
13
|
+
field :account_id, ::String, {'path_param': {'field_name': "account_id", 'style': "simple", 'explode': false}}
|
|
14
|
+
|
|
15
|
+
sig { params(account_id: ::String).void }
|
|
16
|
+
def initialize(account_id:)
|
|
17
|
+
@account_id = account_id
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
21
|
+
def ==(other)
|
|
22
|
+
return false unless other.is_a?(self.class)
|
|
23
|
+
return false unless @account_id == other.account_id
|
|
24
|
+
true
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::GetAccountRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::GetAccountRequest
|
|
9
|
+
def account_id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def account_id=(str_)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class GetAccountResponse
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
field :headers, Crystalline::Hash.new(Symbol, Crystalline::Array.new(::String))
|
|
13
|
+
|
|
14
|
+
field :result, Models::Shared::Account, {}
|
|
15
|
+
|
|
16
|
+
sig { params(headers: T::Hash[Symbol, T::Array[::String]], result: Models::Shared::Account).void }
|
|
17
|
+
def initialize(headers:, result:)
|
|
18
|
+
@headers = headers
|
|
19
|
+
@result = result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
23
|
+
def ==(other)
|
|
24
|
+
return false unless other.is_a?(self.class)
|
|
25
|
+
return false unless @headers == other.headers
|
|
26
|
+
return false unless @result == other.result
|
|
27
|
+
true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::GetAccountResponse
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::GetAccountResponse
|
|
9
|
+
def headers
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def headers=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def result
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def result=(str_)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class ListAccountAssessmentsRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The account_id the tenant sends with its assessments, as one path segment (percent-encode '|' and ':' if the client requires it). A value that does not match the account_id shape answers 400 invalid_request.
|
|
13
|
+
field :account_id, ::String, {'path_param': {'field_name': "account_id", 'style': "simple", 'explode': false}}
|
|
14
|
+
# next_cursor from the previous page, unchanged.
|
|
15
|
+
field(
|
|
16
|
+
:cursor,
|
|
17
|
+
Crystalline::Nilable.new(::String),
|
|
18
|
+
{'query_param': {'field_name': "cursor", 'style': "form", 'explode': true}}
|
|
19
|
+
)
|
|
20
|
+
# Optional standard or separately authorised detailed customer view; raw is rejected.
|
|
21
|
+
field(
|
|
22
|
+
:response_mode,
|
|
23
|
+
Crystalline::Nilable.new(Models::Shared::ResponseMode),
|
|
24
|
+
{'query_param': {'field_name': "response_mode", 'style': "form", 'explode': true}}
|
|
25
|
+
)
|
|
26
|
+
# Items per page.
|
|
27
|
+
field(
|
|
28
|
+
:limit,
|
|
29
|
+
Crystalline::Nilable.new(::Integer),
|
|
30
|
+
{'query_param': {'field_name': "limit", 'style': "form", 'explode': true}}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
sig {
|
|
34
|
+
params(
|
|
35
|
+
account_id: ::String,
|
|
36
|
+
cursor: T.nilable(::String),
|
|
37
|
+
response_mode: T.nilable(Models::Shared::ResponseMode),
|
|
38
|
+
limit: T.nilable(::Integer)
|
|
39
|
+
)
|
|
40
|
+
.void
|
|
41
|
+
}
|
|
42
|
+
def initialize(account_id:, cursor: nil, response_mode: nil, limit: 20)
|
|
43
|
+
@account_id = account_id
|
|
44
|
+
@cursor = cursor
|
|
45
|
+
@response_mode = response_mode
|
|
46
|
+
@limit = limit
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
50
|
+
def ==(other)
|
|
51
|
+
return false unless other.is_a?(self.class)
|
|
52
|
+
return false unless @account_id == other.account_id
|
|
53
|
+
return false unless @cursor == other.cursor
|
|
54
|
+
return false unless @response_mode == other.response_mode
|
|
55
|
+
return false unless @limit == other.limit
|
|
56
|
+
true
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::ListAccountAssessmentsRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::ListAccountAssessmentsRequest
|
|
9
|
+
def account_id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def account_id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def cursor
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def cursor=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def response_mode
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def response_mode=(str_)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def limit
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def limit=(str_)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class ListAccountAssessmentsResponse
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
sig { returns(T.proc.returns(T.nilable(ListAccountAssessmentsResponse))) }
|
|
12
|
+
attr_accessor :next_page
|
|
13
|
+
|
|
14
|
+
field :headers, Crystalline::Hash.new(Symbol, Crystalline::Array.new(::String))
|
|
15
|
+
|
|
16
|
+
field :result, Models::Shared::AssessmentList, {}
|
|
17
|
+
|
|
18
|
+
sig { params(headers: T::Hash[Symbol, T::Array[::String]], result: Models::Shared::AssessmentList).void }
|
|
19
|
+
def initialize(headers:, result:)
|
|
20
|
+
@headers = headers
|
|
21
|
+
@result = result
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
25
|
+
def ==(other)
|
|
26
|
+
return false unless other.is_a?(self.class)
|
|
27
|
+
return false unless @headers == other.headers
|
|
28
|
+
return false unless @result == other.result
|
|
29
|
+
true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def each
|
|
33
|
+
page = self
|
|
34
|
+
loop do
|
|
35
|
+
yield page
|
|
36
|
+
next_page = page.next_page.call if page.next_page
|
|
37
|
+
break if next_page.nil?
|
|
38
|
+
page = T.must(next_page)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::ListAccountAssessmentsResponse
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::ListAccountAssessmentsResponse
|
|
9
|
+
def headers
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def headers=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def result
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def result=(str_)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -12,8 +12,12 @@ module NoResponse
|
|
|
12
12
|
autoload :DeleteIntegrationResponse, "no_response/models/operations/deleteintegration_response.rb"
|
|
13
13
|
autoload :DeleteWebhookEndpointRequest, "no_response/models/operations/deletewebhookendpoint_request.rb"
|
|
14
14
|
autoload :DeleteWebhookEndpointResponse, "no_response/models/operations/deletewebhookendpoint_response.rb"
|
|
15
|
+
autoload :GetAccountRequest, "no_response/models/operations/getaccount_request.rb"
|
|
16
|
+
autoload :GetAccountResponse, "no_response/models/operations/getaccount_response.rb"
|
|
15
17
|
autoload :GetAssessmentRequest, "no_response/models/operations/getassessment_request.rb"
|
|
16
18
|
autoload :GetAssessmentResponse, "no_response/models/operations/getassessment_response.rb"
|
|
19
|
+
autoload :ListAccountAssessmentsRequest, "no_response/models/operations/listaccountassessments_request.rb"
|
|
20
|
+
autoload :ListAccountAssessmentsResponse, "no_response/models/operations/listaccountassessments_response.rb"
|
|
17
21
|
autoload :ListIntegrationsResponse, "no_response/models/operations/listintegrations_response.rb"
|
|
18
22
|
autoload :ListWebhookEndpointsResponse, "no_response/models/operations/listwebhookendpoints_response.rb"
|
|
19
23
|
autoload :QueryAccountAssessmentsResponse, "no_response/models/operations/queryaccountassessments_response.rb"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# 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).
|
|
8
|
+
class Account
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The account_id the tenant sends with its assessments.
|
|
13
|
+
field :id, ::String, {'format_json': {'letter_case': ::NoResponse::Utils.field_name("id"), required: true}}
|
|
14
|
+
|
|
15
|
+
field(
|
|
16
|
+
:risk,
|
|
17
|
+
Models::Shared::AccountRisk,
|
|
18
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("risk"), required: true}}
|
|
19
|
+
)
|
|
20
|
+
# The decision for each flow. Every flow uses the tenant's signup thresholds today, so all three equal risk.decision.
|
|
21
|
+
field(
|
|
22
|
+
:decisions_by_flow,
|
|
23
|
+
Models::Shared::AccountDecisionsByFlow,
|
|
24
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("decisions_by_flow"), required: true}}
|
|
25
|
+
)
|
|
26
|
+
# The assessment the current risk comes from.
|
|
27
|
+
field(
|
|
28
|
+
:assessment_id,
|
|
29
|
+
::String,
|
|
30
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("assessment_id"), required: true}}
|
|
31
|
+
)
|
|
32
|
+
# updated_at of that assessment's latest revision.
|
|
33
|
+
field(
|
|
34
|
+
:updated_at,
|
|
35
|
+
::String,
|
|
36
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("updated_at"), required: true}}
|
|
37
|
+
)
|
|
38
|
+
# Version of the body shape.
|
|
39
|
+
field(
|
|
40
|
+
:schema_version,
|
|
41
|
+
::String,
|
|
42
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("schema_version"), required: true}}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
sig {
|
|
46
|
+
params(
|
|
47
|
+
id: ::String,
|
|
48
|
+
risk: Models::Shared::AccountRisk,
|
|
49
|
+
decisions_by_flow: Models::Shared::AccountDecisionsByFlow,
|
|
50
|
+
assessment_id: ::String,
|
|
51
|
+
updated_at: ::String,
|
|
52
|
+
schema_version: ::String
|
|
53
|
+
)
|
|
54
|
+
.void
|
|
55
|
+
}
|
|
56
|
+
def initialize(id:, risk:, decisions_by_flow:, assessment_id:, updated_at:, schema_version: "1")
|
|
57
|
+
@id = id
|
|
58
|
+
@risk = risk
|
|
59
|
+
@decisions_by_flow = decisions_by_flow
|
|
60
|
+
@assessment_id = assessment_id
|
|
61
|
+
@updated_at = updated_at
|
|
62
|
+
unless schema_version == "1"
|
|
63
|
+
raise ArgumentError, "Invalid value for schema_version"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
@schema_version = "1"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
70
|
+
def ==(other)
|
|
71
|
+
return false unless other.is_a?(self.class)
|
|
72
|
+
return false unless @id == other.id
|
|
73
|
+
return false unless @risk == other.risk
|
|
74
|
+
return false unless @decisions_by_flow == other.decisions_by_flow
|
|
75
|
+
return false unless @assessment_id == other.assessment_id
|
|
76
|
+
return false unless @updated_at == other.updated_at
|
|
77
|
+
return false unless @schema_version == other.schema_version
|
|
78
|
+
true
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::Account
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::Account
|
|
9
|
+
def id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def risk
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def risk=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def decisions_by_flow
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def decisions_by_flow=(str_)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def assessment_id
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def assessment_id=(str_)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def updated_at
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def updated_at=(str_)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def schema_version
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def schema_version=(str_)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# AccountDecision - block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
8
|
+
class AccountDecision
|
|
9
|
+
include ::Crystalline::Enum
|
|
10
|
+
enums do
|
|
11
|
+
ALLOW = new("allow")
|
|
12
|
+
STEP_UP = new("step_up")
|
|
13
|
+
REVIEW = new("review")
|
|
14
|
+
BLOCK = new("block")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
open!
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# The decision for each flow. Every flow uses the tenant's signup thresholds today, so all three equal risk.decision.
|
|
8
|
+
class AccountDecisionsByFlow
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
13
|
+
field(
|
|
14
|
+
:signup,
|
|
15
|
+
Models::Shared::AccountDecision,
|
|
16
|
+
{
|
|
17
|
+
'format_json': {
|
|
18
|
+
'letter_case': ::NoResponse::Utils.field_name("signup"),
|
|
19
|
+
required: true,
|
|
20
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::AccountDecision, false)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
# block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
25
|
+
field(
|
|
26
|
+
:login,
|
|
27
|
+
Models::Shared::AccountDecision,
|
|
28
|
+
{
|
|
29
|
+
'format_json': {
|
|
30
|
+
'letter_case': ::NoResponse::Utils.field_name("login"),
|
|
31
|
+
required: true,
|
|
32
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::AccountDecision, false)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
# block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
37
|
+
field(
|
|
38
|
+
:purchase,
|
|
39
|
+
Models::Shared::AccountDecision,
|
|
40
|
+
{
|
|
41
|
+
'format_json': {
|
|
42
|
+
'letter_case': ::NoResponse::Utils.field_name("purchase"),
|
|
43
|
+
required: true,
|
|
44
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::AccountDecision, false)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
sig {
|
|
50
|
+
params(
|
|
51
|
+
signup: Models::Shared::AccountDecision,
|
|
52
|
+
login: Models::Shared::AccountDecision,
|
|
53
|
+
purchase: Models::Shared::AccountDecision
|
|
54
|
+
)
|
|
55
|
+
.void
|
|
56
|
+
}
|
|
57
|
+
def initialize(signup:, login:, purchase:)
|
|
58
|
+
@signup = signup
|
|
59
|
+
@login = login
|
|
60
|
+
@purchase = purchase
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
64
|
+
def ==(other)
|
|
65
|
+
return false unless other.is_a?(self.class)
|
|
66
|
+
return false unless @signup == other.signup
|
|
67
|
+
return false unless @login == other.login
|
|
68
|
+
return false unless @purchase == other.purchase
|
|
69
|
+
true
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::AccountDecisionsByFlow
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::AccountDecisionsByFlow
|
|
9
|
+
def signup
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def signup=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def login
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def login=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def purchase
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def purchase=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
|
|
8
|
+
class AccountRisk
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# 0 (safe) to 100 (risky), as risk.score of the assessment.
|
|
13
|
+
field(
|
|
14
|
+
:score,
|
|
15
|
+
::Integer,
|
|
16
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("score"), required: true}}
|
|
17
|
+
)
|
|
18
|
+
# block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
19
|
+
field(
|
|
20
|
+
:decision,
|
|
21
|
+
Models::Shared::AccountDecision,
|
|
22
|
+
{
|
|
23
|
+
'format_json': {
|
|
24
|
+
'letter_case': ::NoResponse::Utils.field_name("decision"),
|
|
25
|
+
required: true,
|
|
26
|
+
'decoder': ::NoResponse::Utils.open_enum_from_string(Models::Shared::AccountDecision, false)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
# Every reason that fired, highest weight first. The weights sum to score before clamping.
|
|
31
|
+
field(
|
|
32
|
+
:reasons,
|
|
33
|
+
Crystalline::Array.new(Models::Shared::AccountRiskReason),
|
|
34
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("reasons"), required: true}}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
sig {
|
|
38
|
+
params(
|
|
39
|
+
score: ::Integer,
|
|
40
|
+
decision: Models::Shared::AccountDecision,
|
|
41
|
+
reasons: T::Array[Models::Shared::AccountRiskReason]
|
|
42
|
+
)
|
|
43
|
+
.void
|
|
44
|
+
}
|
|
45
|
+
def initialize(score:, decision:, reasons:)
|
|
46
|
+
@score = score
|
|
47
|
+
@decision = decision
|
|
48
|
+
@reasons = reasons
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
52
|
+
def ==(other)
|
|
53
|
+
return false unless other.is_a?(self.class)
|
|
54
|
+
return false unless @score == other.score
|
|
55
|
+
return false unless @decision == other.decision
|
|
56
|
+
return false unless @reasons == other.reasons
|
|
57
|
+
true
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::AccountRisk
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::AccountRisk
|
|
9
|
+
def score
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def score=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def decision
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def decision=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def reasons
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def reasons=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|