-
Notifications
You must be signed in to change notification settings - Fork 88
/
model_plaid_error.go
440 lines (372 loc) · 13.2 KB
/
model_plaid_error.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
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
/*
* The Plaid API
*
* The Plaid REST API. Please see https://plaid.com/docs/api for more details.
*
* API version: 2020-09-14_1.508.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package plaid
import (
"encoding/json"
)
// PlaidError Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead.
type PlaidError struct {
ErrorType PlaidErrorType `json:"error_type"`
// The particular error code. Safe for programmatic use.
ErrorCode string `json:"error_code"`
// A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use.
ErrorMessage string `json:"error_message"`
// A user-friendly representation of the error code. `null` if the error is not related to user action. This may change over time and is not safe for programmatic use.
DisplayMessage NullableString `json:"display_message"`
// A unique ID identifying the request, to be used for troubleshooting purposes. This field will be omitted in errors provided by webhooks.
RequestId *string `json:"request_id,omitempty"`
// In the Assets product, a request can pertain to more than one Item. If an error is returned for such a request, `causes` will return an array of errors containing a breakdown of these errors on the individual Item level, if any can be identified. `causes` will only be provided for the `error_type` `ASSET_REPORT_ERROR`. `causes` will also not be populated inside an error nested within a `warning` object.
Causes *[]interface{} `json:"causes,omitempty"`
// The HTTP status code associated with the error. This will only be returned in the response body when the error information is provided via a webhook.
Status NullableInt32 `json:"status,omitempty"`
// The URL of a Plaid documentation page with more information about the error
DocumentationUrl *string `json:"documentation_url,omitempty"`
// Suggested steps for resolving the error
SuggestedAction NullableString `json:"suggested_action,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlaidError PlaidError
// NewPlaidError instantiates a new PlaidError 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 NewPlaidError(errorType PlaidErrorType, errorCode string, errorMessage string, displayMessage NullableString) *PlaidError {
this := PlaidError{}
this.ErrorType = errorType
this.ErrorCode = errorCode
this.ErrorMessage = errorMessage
this.DisplayMessage = displayMessage
return &this
}
// NewPlaidErrorWithDefaults instantiates a new PlaidError 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 NewPlaidErrorWithDefaults() *PlaidError {
this := PlaidError{}
return &this
}
// GetErrorType returns the ErrorType field value
func (o *PlaidError) GetErrorType() PlaidErrorType {
if o == nil {
var ret PlaidErrorType
return ret
}
return o.ErrorType
}
// GetErrorTypeOk returns a tuple with the ErrorType field value
// and a boolean to check if the value has been set.
func (o *PlaidError) GetErrorTypeOk() (*PlaidErrorType, bool) {
if o == nil {
return nil, false
}
return &o.ErrorType, true
}
// SetErrorType sets field value
func (o *PlaidError) SetErrorType(v PlaidErrorType) {
o.ErrorType = v
}
// GetErrorCode returns the ErrorCode field value
func (o *PlaidError) GetErrorCode() string {
if o == nil {
var ret string
return ret
}
return o.ErrorCode
}
// GetErrorCodeOk returns a tuple with the ErrorCode field value
// and a boolean to check if the value has been set.
func (o *PlaidError) GetErrorCodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ErrorCode, true
}
// SetErrorCode sets field value
func (o *PlaidError) SetErrorCode(v string) {
o.ErrorCode = v
}
// GetErrorMessage returns the ErrorMessage field value
func (o *PlaidError) GetErrorMessage() string {
if o == nil {
var ret string
return ret
}
return o.ErrorMessage
}
// GetErrorMessageOk returns a tuple with the ErrorMessage field value
// and a boolean to check if the value has been set.
func (o *PlaidError) GetErrorMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ErrorMessage, true
}
// SetErrorMessage sets field value
func (o *PlaidError) SetErrorMessage(v string) {
o.ErrorMessage = v
}
// GetDisplayMessage returns the DisplayMessage field value
// If the value is explicit nil, the zero value for string will be returned
func (o *PlaidError) GetDisplayMessage() string {
if o == nil || o.DisplayMessage.Get() == nil {
var ret string
return ret
}
return *o.DisplayMessage.Get()
}
// GetDisplayMessageOk returns a tuple with the DisplayMessage field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PlaidError) GetDisplayMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DisplayMessage.Get(), o.DisplayMessage.IsSet()
}
// SetDisplayMessage sets field value
func (o *PlaidError) SetDisplayMessage(v string) {
o.DisplayMessage.Set(&v)
}
// GetRequestId returns the RequestId field value if set, zero value otherwise.
func (o *PlaidError) GetRequestId() string {
if o == nil || o.RequestId == nil {
var ret string
return ret
}
return *o.RequestId
}
// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlaidError) GetRequestIdOk() (*string, bool) {
if o == nil || o.RequestId == nil {
return nil, false
}
return o.RequestId, true
}
// HasRequestId returns a boolean if a field has been set.
func (o *PlaidError) HasRequestId() bool {
if o != nil && o.RequestId != nil {
return true
}
return false
}
// SetRequestId gets a reference to the given string and assigns it to the RequestId field.
func (o *PlaidError) SetRequestId(v string) {
o.RequestId = &v
}
// GetCauses returns the Causes field value if set, zero value otherwise.
func (o *PlaidError) GetCauses() []interface{} {
if o == nil || o.Causes == nil {
var ret []interface{}
return ret
}
return *o.Causes
}
// GetCausesOk returns a tuple with the Causes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlaidError) GetCausesOk() (*[]interface{}, bool) {
if o == nil || o.Causes == nil {
return nil, false
}
return o.Causes, true
}
// HasCauses returns a boolean if a field has been set.
func (o *PlaidError) HasCauses() bool {
if o != nil && o.Causes != nil {
return true
}
return false
}
// SetCauses gets a reference to the given []interface{} and assigns it to the Causes field.
func (o *PlaidError) SetCauses(v []interface{}) {
o.Causes = &v
}
// GetStatus returns the Status field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PlaidError) GetStatus() int32 {
if o == nil || o.Status.Get() == nil {
var ret int32
return ret
}
return *o.Status.Get()
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PlaidError) GetStatusOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Status.Get(), o.Status.IsSet()
}
// HasStatus returns a boolean if a field has been set.
func (o *PlaidError) HasStatus() bool {
if o != nil && o.Status.IsSet() {
return true
}
return false
}
// SetStatus gets a reference to the given NullableInt32 and assigns it to the Status field.
func (o *PlaidError) SetStatus(v int32) {
o.Status.Set(&v)
}
// SetStatusNil sets the value for Status to be an explicit nil
func (o *PlaidError) SetStatusNil() {
o.Status.Set(nil)
}
// UnsetStatus ensures that no value is present for Status, not even an explicit nil
func (o *PlaidError) UnsetStatus() {
o.Status.Unset()
}
// GetDocumentationUrl returns the DocumentationUrl field value if set, zero value otherwise.
func (o *PlaidError) GetDocumentationUrl() string {
if o == nil || o.DocumentationUrl == nil {
var ret string
return ret
}
return *o.DocumentationUrl
}
// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlaidError) GetDocumentationUrlOk() (*string, bool) {
if o == nil || o.DocumentationUrl == nil {
return nil, false
}
return o.DocumentationUrl, true
}
// HasDocumentationUrl returns a boolean if a field has been set.
func (o *PlaidError) HasDocumentationUrl() bool {
if o != nil && o.DocumentationUrl != nil {
return true
}
return false
}
// SetDocumentationUrl gets a reference to the given string and assigns it to the DocumentationUrl field.
func (o *PlaidError) SetDocumentationUrl(v string) {
o.DocumentationUrl = &v
}
// GetSuggestedAction returns the SuggestedAction field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PlaidError) GetSuggestedAction() string {
if o == nil || o.SuggestedAction.Get() == nil {
var ret string
return ret
}
return *o.SuggestedAction.Get()
}
// GetSuggestedActionOk returns a tuple with the SuggestedAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PlaidError) GetSuggestedActionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.SuggestedAction.Get(), o.SuggestedAction.IsSet()
}
// HasSuggestedAction returns a boolean if a field has been set.
func (o *PlaidError) HasSuggestedAction() bool {
if o != nil && o.SuggestedAction.IsSet() {
return true
}
return false
}
// SetSuggestedAction gets a reference to the given NullableString and assigns it to the SuggestedAction field.
func (o *PlaidError) SetSuggestedAction(v string) {
o.SuggestedAction.Set(&v)
}
// SetSuggestedActionNil sets the value for SuggestedAction to be an explicit nil
func (o *PlaidError) SetSuggestedActionNil() {
o.SuggestedAction.Set(nil)
}
// UnsetSuggestedAction ensures that no value is present for SuggestedAction, not even an explicit nil
func (o *PlaidError) UnsetSuggestedAction() {
o.SuggestedAction.Unset()
}
func (o PlaidError) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["error_type"] = o.ErrorType
}
if true {
toSerialize["error_code"] = o.ErrorCode
}
if true {
toSerialize["error_message"] = o.ErrorMessage
}
if true {
toSerialize["display_message"] = o.DisplayMessage.Get()
}
if o.RequestId != nil {
toSerialize["request_id"] = o.RequestId
}
if o.Causes != nil {
toSerialize["causes"] = o.Causes
}
if o.Status.IsSet() {
toSerialize["status"] = o.Status.Get()
}
if o.DocumentationUrl != nil {
toSerialize["documentation_url"] = o.DocumentationUrl
}
if o.SuggestedAction.IsSet() {
toSerialize["suggested_action"] = o.SuggestedAction.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *PlaidError) UnmarshalJSON(bytes []byte) (err error) {
varPlaidError := _PlaidError{}
if err = json.Unmarshal(bytes, &varPlaidError); err == nil {
*o = PlaidError(varPlaidError)
} else {
return err
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "error_type")
delete(additionalProperties, "error_code")
delete(additionalProperties, "error_message")
delete(additionalProperties, "display_message")
delete(additionalProperties, "request_id")
delete(additionalProperties, "causes")
delete(additionalProperties, "status")
delete(additionalProperties, "documentation_url")
delete(additionalProperties, "suggested_action")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlaidError struct {
value *PlaidError
isSet bool
}
func (v NullablePlaidError) Get() *PlaidError {
return v.value
}
func (v *NullablePlaidError) Set(val *PlaidError) {
v.value = val
v.isSet = true
}
func (v NullablePlaidError) IsSet() bool {
return v.isSet
}
func (v *NullablePlaidError) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlaidError(val *PlaidError) *NullablePlaidError {
return &NullablePlaidError{value: val, isSet: true}
}
func (v NullablePlaidError) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlaidError) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}