-
Notifications
You must be signed in to change notification settings - Fork 28
/
model_transaction_rules_result.go
236 lines (197 loc) · 7.25 KB
/
model_transaction_rules_result.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
Transfers API
API version: 4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package transfers
import (
"encoding/json"
"github.com/adyen/adyen-go-api-library/v9/src/common"
)
// checks if the TransactionRulesResult type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &TransactionRulesResult{}
// TransactionRulesResult struct for TransactionRulesResult
type TransactionRulesResult struct {
// The advice given by the Risk analysis.
Advice *string `json:"advice,omitempty"`
// Indicates whether the transaction passed the evaluation for all hardblock rules
AllHardBlockRulesPassed *bool `json:"allHardBlockRulesPassed,omitempty"`
// The score of the Risk analysis.
Score *int32 `json:"score,omitempty"`
// Array containing all the transaction rules that the transaction triggered.
TriggeredTransactionRules []TransactionEventViolation `json:"triggeredTransactionRules,omitempty"`
}
// NewTransactionRulesResult instantiates a new TransactionRulesResult object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTransactionRulesResult() *TransactionRulesResult {
this := TransactionRulesResult{}
return &this
}
// NewTransactionRulesResultWithDefaults instantiates a new TransactionRulesResult object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTransactionRulesResultWithDefaults() *TransactionRulesResult {
this := TransactionRulesResult{}
return &this
}
// GetAdvice returns the Advice field value if set, zero value otherwise.
func (o *TransactionRulesResult) GetAdvice() string {
if o == nil || common.IsNil(o.Advice) {
var ret string
return ret
}
return *o.Advice
}
// GetAdviceOk returns a tuple with the Advice field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionRulesResult) GetAdviceOk() (*string, bool) {
if o == nil || common.IsNil(o.Advice) {
return nil, false
}
return o.Advice, true
}
// HasAdvice returns a boolean if a field has been set.
func (o *TransactionRulesResult) HasAdvice() bool {
if o != nil && !common.IsNil(o.Advice) {
return true
}
return false
}
// SetAdvice gets a reference to the given string and assigns it to the Advice field.
func (o *TransactionRulesResult) SetAdvice(v string) {
o.Advice = &v
}
// GetAllHardBlockRulesPassed returns the AllHardBlockRulesPassed field value if set, zero value otherwise.
func (o *TransactionRulesResult) GetAllHardBlockRulesPassed() bool {
if o == nil || common.IsNil(o.AllHardBlockRulesPassed) {
var ret bool
return ret
}
return *o.AllHardBlockRulesPassed
}
// GetAllHardBlockRulesPassedOk returns a tuple with the AllHardBlockRulesPassed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionRulesResult) GetAllHardBlockRulesPassedOk() (*bool, bool) {
if o == nil || common.IsNil(o.AllHardBlockRulesPassed) {
return nil, false
}
return o.AllHardBlockRulesPassed, true
}
// HasAllHardBlockRulesPassed returns a boolean if a field has been set.
func (o *TransactionRulesResult) HasAllHardBlockRulesPassed() bool {
if o != nil && !common.IsNil(o.AllHardBlockRulesPassed) {
return true
}
return false
}
// SetAllHardBlockRulesPassed gets a reference to the given bool and assigns it to the AllHardBlockRulesPassed field.
func (o *TransactionRulesResult) SetAllHardBlockRulesPassed(v bool) {
o.AllHardBlockRulesPassed = &v
}
// GetScore returns the Score field value if set, zero value otherwise.
func (o *TransactionRulesResult) GetScore() int32 {
if o == nil || common.IsNil(o.Score) {
var ret int32
return ret
}
return *o.Score
}
// GetScoreOk returns a tuple with the Score field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionRulesResult) GetScoreOk() (*int32, bool) {
if o == nil || common.IsNil(o.Score) {
return nil, false
}
return o.Score, true
}
// HasScore returns a boolean if a field has been set.
func (o *TransactionRulesResult) HasScore() bool {
if o != nil && !common.IsNil(o.Score) {
return true
}
return false
}
// SetScore gets a reference to the given int32 and assigns it to the Score field.
func (o *TransactionRulesResult) SetScore(v int32) {
o.Score = &v
}
// GetTriggeredTransactionRules returns the TriggeredTransactionRules field value if set, zero value otherwise.
func (o *TransactionRulesResult) GetTriggeredTransactionRules() []TransactionEventViolation {
if o == nil || common.IsNil(o.TriggeredTransactionRules) {
var ret []TransactionEventViolation
return ret
}
return o.TriggeredTransactionRules
}
// GetTriggeredTransactionRulesOk returns a tuple with the TriggeredTransactionRules field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionRulesResult) GetTriggeredTransactionRulesOk() ([]TransactionEventViolation, bool) {
if o == nil || common.IsNil(o.TriggeredTransactionRules) {
return nil, false
}
return o.TriggeredTransactionRules, true
}
// HasTriggeredTransactionRules returns a boolean if a field has been set.
func (o *TransactionRulesResult) HasTriggeredTransactionRules() bool {
if o != nil && !common.IsNil(o.TriggeredTransactionRules) {
return true
}
return false
}
// SetTriggeredTransactionRules gets a reference to the given []TransactionEventViolation and assigns it to the TriggeredTransactionRules field.
func (o *TransactionRulesResult) SetTriggeredTransactionRules(v []TransactionEventViolation) {
o.TriggeredTransactionRules = v
}
func (o TransactionRulesResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TransactionRulesResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !common.IsNil(o.Advice) {
toSerialize["advice"] = o.Advice
}
if !common.IsNil(o.AllHardBlockRulesPassed) {
toSerialize["allHardBlockRulesPassed"] = o.AllHardBlockRulesPassed
}
if !common.IsNil(o.Score) {
toSerialize["score"] = o.Score
}
if !common.IsNil(o.TriggeredTransactionRules) {
toSerialize["triggeredTransactionRules"] = o.TriggeredTransactionRules
}
return toSerialize, nil
}
type NullableTransactionRulesResult struct {
value *TransactionRulesResult
isSet bool
}
func (v NullableTransactionRulesResult) Get() *TransactionRulesResult {
return v.value
}
func (v *NullableTransactionRulesResult) Set(val *TransactionRulesResult) {
v.value = val
v.isSet = true
}
func (v NullableTransactionRulesResult) IsSet() bool {
return v.isSet
}
func (v *NullableTransactionRulesResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTransactionRulesResult(val *TransactionRulesResult) *NullableTransactionRulesResult {
return &NullableTransactionRulesResult{value: val, isSet: true}
}
func (v NullableTransactionRulesResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTransactionRulesResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}