-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbusiness_users.go
184 lines (160 loc) · 5.01 KB
/
business_users.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
internal "github.com/flagright/flagright-go/internal"
)
type BusinessUsersCreateRequest struct {
// Boolean string whether Flagright should lock the CRA risk level for the user.
LockCraRiskLevel *BooleanString `json:"-" url:"lockCraRiskLevel,omitempty"`
// Boolean string whether Flagright should lock the KYC risk level for the user.
LockKycRiskLevel *BooleanString `json:"-" url:"lockKycRiskLevel,omitempty"`
// Boolean string whether Flagright should validate the userId
ValidateUserId *BooleanString `json:"-" url:"validateUserId,omitempty"`
KrsOnly *BooleanString `json:"-" url:"_krsOnly,omitempty"`
Body *Business `json:"-" url:"-"`
}
func (b *BusinessUsersCreateRequest) UnmarshalJSON(data []byte) error {
body := new(Business)
if err := json.Unmarshal(data, &body); err != nil {
return err
}
b.Body = body
return nil
}
func (b *BusinessUsersCreateRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(b.Body)
}
// Model for business user risk score response
type BusinessUserMonitoringResult struct {
// user ID the risk score pertains to
UserId string `json:"userId" url:"userId"`
RiskScoreDetails *UserRiskScoreDetails `json:"riskScoreDetails,omitempty" url:"riskScoreDetails,omitempty"`
HitRules []*HitRulesDetails `json:"hitRules,omitempty" url:"hitRules,omitempty"`
ExecutedRules []*ExecutedRulesResult `json:"executedRules,omitempty" url:"executedRules,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BusinessUserMonitoringResult) GetUserId() string {
if b == nil {
return ""
}
return b.UserId
}
func (b *BusinessUserMonitoringResult) GetRiskScoreDetails() *UserRiskScoreDetails {
if b == nil {
return nil
}
return b.RiskScoreDetails
}
func (b *BusinessUserMonitoringResult) GetHitRules() []*HitRulesDetails {
if b == nil {
return nil
}
return b.HitRules
}
func (b *BusinessUserMonitoringResult) GetExecutedRules() []*ExecutedRulesResult {
if b == nil {
return nil
}
return b.ExecutedRules
}
func (b *BusinessUserMonitoringResult) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BusinessUserMonitoringResult) UnmarshalJSON(data []byte) error {
type unmarshaler BusinessUserMonitoringResult
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BusinessUserMonitoringResult(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BusinessUserMonitoringResult) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BusinessUsersCreateResponse struct {
// user ID the risk score pertains to
UserId string `json:"userId" url:"userId"`
RiskScoreDetails *UserRiskScoreDetails `json:"riskScoreDetails,omitempty" url:"riskScoreDetails,omitempty"`
HitRules []*HitRulesDetails `json:"hitRules,omitempty" url:"hitRules,omitempty"`
ExecutedRules []*ExecutedRulesResult `json:"executedRules,omitempty" url:"executedRules,omitempty"`
Message *string `json:"message,omitempty" url:"message,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BusinessUsersCreateResponse) GetUserId() string {
if b == nil {
return ""
}
return b.UserId
}
func (b *BusinessUsersCreateResponse) GetRiskScoreDetails() *UserRiskScoreDetails {
if b == nil {
return nil
}
return b.RiskScoreDetails
}
func (b *BusinessUsersCreateResponse) GetHitRules() []*HitRulesDetails {
if b == nil {
return nil
}
return b.HitRules
}
func (b *BusinessUsersCreateResponse) GetExecutedRules() []*ExecutedRulesResult {
if b == nil {
return nil
}
return b.ExecutedRules
}
func (b *BusinessUsersCreateResponse) GetMessage() *string {
if b == nil {
return nil
}
return b.Message
}
func (b *BusinessUsersCreateResponse) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BusinessUsersCreateResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BusinessUsersCreateResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BusinessUsersCreateResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BusinessUsersCreateResponse) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}