-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_check_request.go
425 lines (354 loc) · 12.3 KB
/
model_check_request.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
/*
Onfido API v3.6
The Onfido API (v3.6)
API version: v3.6
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CheckRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CheckRequest{}
// CheckRequest struct for CheckRequest
type CheckRequest struct {
// An array of report names (strings).
ReportNames []ReportName `json:"report_names"`
// Optional. An array of document ids, for use with Document reports only. If omitted, the Document report will use the most recently uploaded document by default.
DocumentIds []string `json:"document_ids,omitempty"`
// Send an applicant form to applicant to complete to proceed with check. Defaults to false.
ApplicantProvidesData *bool `json:"applicant_provides_data,omitempty"`
// Defaults to `true`. If set to `false`, you will only receive a response when all reports in your check have completed.
Asynchronous *bool `json:"asynchronous,omitempty"`
// For checks where `applicant_provides_data` is `true`, applicant form will not be automatically sent if `suppress_form_emails` is set to `true`. You can manually send the form at any time after the check has been created, using the link found in the form_uri attribute of the check object. Write-only. Defaults to false.
SuppressFormEmails *bool `json:"suppress_form_emails,omitempty"`
// Triggers responses for particular sub-results for sandbox Document reports.
SubResult *string `json:"sub_result,omitempty"`
// Array of names of particular reports to return consider as their results. This is a feature available in sandbox testing
Consider []ReportName `json:"consider,omitempty"`
UsDrivingLicence *UsDrivingLicenceBuilder `json:"us_driving_licence,omitempty"`
}
type _CheckRequest CheckRequest
// NewCheckRequest instantiates a new CheckRequest 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 NewCheckRequest(reportNames []ReportName) *CheckRequest {
this := CheckRequest{}
this.ReportNames = reportNames
var applicantProvidesData bool = false
this.ApplicantProvidesData = &applicantProvidesData
var asynchronous bool = true
this.Asynchronous = &asynchronous
return &this
}
// NewCheckRequestWithDefaults instantiates a new CheckRequest 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 NewCheckRequestWithDefaults() *CheckRequest {
this := CheckRequest{}
var applicantProvidesData bool = false
this.ApplicantProvidesData = &applicantProvidesData
var asynchronous bool = true
this.Asynchronous = &asynchronous
return &this
}
// GetReportNames returns the ReportNames field value
func (o *CheckRequest) GetReportNames() []ReportName {
if o == nil {
var ret []ReportName
return ret
}
return o.ReportNames
}
// GetReportNamesOk returns a tuple with the ReportNames field value
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetReportNamesOk() ([]ReportName, bool) {
if o == nil {
return nil, false
}
return o.ReportNames, true
}
// SetReportNames sets field value
func (o *CheckRequest) SetReportNames(v []ReportName) {
o.ReportNames = v
}
// GetDocumentIds returns the DocumentIds field value if set, zero value otherwise.
func (o *CheckRequest) GetDocumentIds() []string {
if o == nil || IsNil(o.DocumentIds) {
var ret []string
return ret
}
return o.DocumentIds
}
// GetDocumentIdsOk returns a tuple with the DocumentIds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetDocumentIdsOk() ([]string, bool) {
if o == nil || IsNil(o.DocumentIds) {
return nil, false
}
return o.DocumentIds, true
}
// HasDocumentIds returns a boolean if a field has been set.
func (o *CheckRequest) HasDocumentIds() bool {
if o != nil && !IsNil(o.DocumentIds) {
return true
}
return false
}
// SetDocumentIds gets a reference to the given []string and assigns it to the DocumentIds field.
func (o *CheckRequest) SetDocumentIds(v []string) {
o.DocumentIds = v
}
// GetApplicantProvidesData returns the ApplicantProvidesData field value if set, zero value otherwise.
func (o *CheckRequest) GetApplicantProvidesData() bool {
if o == nil || IsNil(o.ApplicantProvidesData) {
var ret bool
return ret
}
return *o.ApplicantProvidesData
}
// GetApplicantProvidesDataOk returns a tuple with the ApplicantProvidesData field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetApplicantProvidesDataOk() (*bool, bool) {
if o == nil || IsNil(o.ApplicantProvidesData) {
return nil, false
}
return o.ApplicantProvidesData, true
}
// HasApplicantProvidesData returns a boolean if a field has been set.
func (o *CheckRequest) HasApplicantProvidesData() bool {
if o != nil && !IsNil(o.ApplicantProvidesData) {
return true
}
return false
}
// SetApplicantProvidesData gets a reference to the given bool and assigns it to the ApplicantProvidesData field.
func (o *CheckRequest) SetApplicantProvidesData(v bool) {
o.ApplicantProvidesData = &v
}
// GetAsynchronous returns the Asynchronous field value if set, zero value otherwise.
func (o *CheckRequest) GetAsynchronous() bool {
if o == nil || IsNil(o.Asynchronous) {
var ret bool
return ret
}
return *o.Asynchronous
}
// GetAsynchronousOk returns a tuple with the Asynchronous field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetAsynchronousOk() (*bool, bool) {
if o == nil || IsNil(o.Asynchronous) {
return nil, false
}
return o.Asynchronous, true
}
// HasAsynchronous returns a boolean if a field has been set.
func (o *CheckRequest) HasAsynchronous() bool {
if o != nil && !IsNil(o.Asynchronous) {
return true
}
return false
}
// SetAsynchronous gets a reference to the given bool and assigns it to the Asynchronous field.
func (o *CheckRequest) SetAsynchronous(v bool) {
o.Asynchronous = &v
}
// GetSuppressFormEmails returns the SuppressFormEmails field value if set, zero value otherwise.
func (o *CheckRequest) GetSuppressFormEmails() bool {
if o == nil || IsNil(o.SuppressFormEmails) {
var ret bool
return ret
}
return *o.SuppressFormEmails
}
// GetSuppressFormEmailsOk returns a tuple with the SuppressFormEmails field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetSuppressFormEmailsOk() (*bool, bool) {
if o == nil || IsNil(o.SuppressFormEmails) {
return nil, false
}
return o.SuppressFormEmails, true
}
// HasSuppressFormEmails returns a boolean if a field has been set.
func (o *CheckRequest) HasSuppressFormEmails() bool {
if o != nil && !IsNil(o.SuppressFormEmails) {
return true
}
return false
}
// SetSuppressFormEmails gets a reference to the given bool and assigns it to the SuppressFormEmails field.
func (o *CheckRequest) SetSuppressFormEmails(v bool) {
o.SuppressFormEmails = &v
}
// GetSubResult returns the SubResult field value if set, zero value otherwise.
func (o *CheckRequest) GetSubResult() string {
if o == nil || IsNil(o.SubResult) {
var ret string
return ret
}
return *o.SubResult
}
// GetSubResultOk returns a tuple with the SubResult field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetSubResultOk() (*string, bool) {
if o == nil || IsNil(o.SubResult) {
return nil, false
}
return o.SubResult, true
}
// HasSubResult returns a boolean if a field has been set.
func (o *CheckRequest) HasSubResult() bool {
if o != nil && !IsNil(o.SubResult) {
return true
}
return false
}
// SetSubResult gets a reference to the given string and assigns it to the SubResult field.
func (o *CheckRequest) SetSubResult(v string) {
o.SubResult = &v
}
// GetConsider returns the Consider field value if set, zero value otherwise.
func (o *CheckRequest) GetConsider() []ReportName {
if o == nil || IsNil(o.Consider) {
var ret []ReportName
return ret
}
return o.Consider
}
// GetConsiderOk returns a tuple with the Consider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetConsiderOk() ([]ReportName, bool) {
if o == nil || IsNil(o.Consider) {
return nil, false
}
return o.Consider, true
}
// HasConsider returns a boolean if a field has been set.
func (o *CheckRequest) HasConsider() bool {
if o != nil && !IsNil(o.Consider) {
return true
}
return false
}
// SetConsider gets a reference to the given []ReportName and assigns it to the Consider field.
func (o *CheckRequest) SetConsider(v []ReportName) {
o.Consider = v
}
// GetUsDrivingLicence returns the UsDrivingLicence field value if set, zero value otherwise.
func (o *CheckRequest) GetUsDrivingLicence() UsDrivingLicenceBuilder {
if o == nil || IsNil(o.UsDrivingLicence) {
var ret UsDrivingLicenceBuilder
return ret
}
return *o.UsDrivingLicence
}
// GetUsDrivingLicenceOk returns a tuple with the UsDrivingLicence field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckRequest) GetUsDrivingLicenceOk() (*UsDrivingLicenceBuilder, bool) {
if o == nil || IsNil(o.UsDrivingLicence) {
return nil, false
}
return o.UsDrivingLicence, true
}
// HasUsDrivingLicence returns a boolean if a field has been set.
func (o *CheckRequest) HasUsDrivingLicence() bool {
if o != nil && !IsNil(o.UsDrivingLicence) {
return true
}
return false
}
// SetUsDrivingLicence gets a reference to the given UsDrivingLicenceBuilder and assigns it to the UsDrivingLicence field.
func (o *CheckRequest) SetUsDrivingLicence(v UsDrivingLicenceBuilder) {
o.UsDrivingLicence = &v
}
func (o CheckRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CheckRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["report_names"] = o.ReportNames
if !IsNil(o.DocumentIds) {
toSerialize["document_ids"] = o.DocumentIds
}
if !IsNil(o.ApplicantProvidesData) {
toSerialize["applicant_provides_data"] = o.ApplicantProvidesData
}
if !IsNil(o.Asynchronous) {
toSerialize["asynchronous"] = o.Asynchronous
}
if !IsNil(o.SuppressFormEmails) {
toSerialize["suppress_form_emails"] = o.SuppressFormEmails
}
if !IsNil(o.SubResult) {
toSerialize["sub_result"] = o.SubResult
}
if !IsNil(o.Consider) {
toSerialize["consider"] = o.Consider
}
if !IsNil(o.UsDrivingLicence) {
toSerialize["us_driving_licence"] = o.UsDrivingLicence
}
return toSerialize, nil
}
func (o *CheckRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"report_names",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCheckRequest := _CheckRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCheckRequest)
if err != nil {
return err
}
*o = CheckRequest(varCheckRequest)
return err
}
type NullableCheckRequest struct {
value *CheckRequest
isSet bool
}
func (v NullableCheckRequest) Get() *CheckRequest {
return v.value
}
func (v *NullableCheckRequest) Set(val *CheckRequest) {
v.value = val
v.isSet = true
}
func (v NullableCheckRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCheckRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCheckRequest(val *CheckRequest) *NullableCheckRequest {
return &NullableCheckRequest{value: val, isSet: true}
}
func (v NullableCheckRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCheckRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}