/
model_transaction_base.go
801 lines (687 loc) · 26.1 KB
/
model_transaction_base.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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
/*
* The Plaid API
*
* The Plaid REST API. Please see https://plaid.com/docs/api for more details.
*
* API version: 2020-09-14_1.61.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package plaid
import (
"encoding/json"
)
// TransactionBase A representation of a transaction
type TransactionBase struct {
// Please use the `payment_channel` field, `transaction_type` will be deprecated in the future. `digital:` transactions that took place online. `place:` transactions that were made at a physical location. `special:` transactions that relate to banks, e.g. fees or deposits. `unresolved:` transactions that do not fit into the other three types.
TransactionType *string `json:"transaction_type,omitempty"`
// The ID of a posted transaction's associated pending transaction, where applicable.
PendingTransactionId NullableString `json:"pending_transaction_id,omitempty"`
// The ID of the category to which this transaction belongs. See [Categories](https://plaid.com/docs/#category-overview). If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
CategoryId NullableString `json:"category_id,omitempty"`
// A hierarchical array of the categories to which this transaction belongs. See [Categories](https://plaid.com/docs/#category-overview). If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
Category []string `json:"category,omitempty"`
Location *Location `json:"location,omitempty"`
PaymentMeta *PaymentMeta `json:"payment_meta,omitempty"`
// The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts.
AccountOwner NullableString `json:"account_owner,omitempty"`
// The merchant name or transaction description. If the `transactions` object was returned by a Transactions endpoint such as `/transactions/get`, this field will always appear. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
Name *string `json:"name,omitempty"`
// The string returned by the financial institution to describe the transaction. For transactions returned by `/transactions/get`, this field is in beta and will be omitted unless the client is both enrolled in the closed beta program and has set `options.include_original_description` to `true`.
OriginalDescription NullableString `json:"original_description,omitempty"`
// The ID of the account in which this transaction occurred.
AccountId string `json:"account_id"`
// The settled value of the transaction, denominated in the account's currency, as stated in `iso_currency_code` or `unofficial_currency_code`. Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative.
Amount float32 `json:"amount"`
// The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-null.
IsoCurrencyCode NullableString `json:"iso_currency_code"`
// The unofficial currency code associated with the transaction. Always `null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.
UnofficialCurrencyCode NullableString `json:"unofficial_currency_code"`
// For pending transactions, the date that the transaction occurred; for posted transactions, the date that the transaction posted. Both dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ).
Date string `json:"date"`
// When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled.
Pending bool `json:"pending"`
// The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive.
TransactionId string `json:"transaction_id"`
// The merchant name, as extracted by Plaid from the `name` field.
MerchantName NullableString `json:"merchant_name,omitempty"`
// The check number of the transaction. This field is only populated for check transactions.
CheckNumber NullableString `json:"check_number,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionBase TransactionBase
// NewTransactionBase instantiates a new TransactionBase 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 NewTransactionBase(accountId string, amount float32, isoCurrencyCode NullableString, unofficialCurrencyCode NullableString, date string, pending bool, transactionId string) *TransactionBase {
this := TransactionBase{}
this.AccountId = accountId
this.Amount = amount
this.IsoCurrencyCode = isoCurrencyCode
this.UnofficialCurrencyCode = unofficialCurrencyCode
this.Date = date
this.Pending = pending
this.TransactionId = transactionId
return &this
}
// NewTransactionBaseWithDefaults instantiates a new TransactionBase 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 NewTransactionBaseWithDefaults() *TransactionBase {
this := TransactionBase{}
return &this
}
// GetTransactionType returns the TransactionType field value if set, zero value otherwise.
func (o *TransactionBase) GetTransactionType() string {
if o == nil || o.TransactionType == nil {
var ret string
return ret
}
return *o.TransactionType
}
// GetTransactionTypeOk returns a tuple with the TransactionType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetTransactionTypeOk() (*string, bool) {
if o == nil || o.TransactionType == nil {
return nil, false
}
return o.TransactionType, true
}
// HasTransactionType returns a boolean if a field has been set.
func (o *TransactionBase) HasTransactionType() bool {
if o != nil && o.TransactionType != nil {
return true
}
return false
}
// SetTransactionType gets a reference to the given string and assigns it to the TransactionType field.
func (o *TransactionBase) SetTransactionType(v string) {
o.TransactionType = &v
}
// GetPendingTransactionId returns the PendingTransactionId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetPendingTransactionId() string {
if o == nil || o.PendingTransactionId.Get() == nil {
var ret string
return ret
}
return *o.PendingTransactionId.Get()
}
// GetPendingTransactionIdOk returns a tuple with the PendingTransactionId 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 *TransactionBase) GetPendingTransactionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.PendingTransactionId.Get(), o.PendingTransactionId.IsSet()
}
// HasPendingTransactionId returns a boolean if a field has been set.
func (o *TransactionBase) HasPendingTransactionId() bool {
if o != nil && o.PendingTransactionId.IsSet() {
return true
}
return false
}
// SetPendingTransactionId gets a reference to the given NullableString and assigns it to the PendingTransactionId field.
func (o *TransactionBase) SetPendingTransactionId(v string) {
o.PendingTransactionId.Set(&v)
}
// SetPendingTransactionIdNil sets the value for PendingTransactionId to be an explicit nil
func (o *TransactionBase) SetPendingTransactionIdNil() {
o.PendingTransactionId.Set(nil)
}
// UnsetPendingTransactionId ensures that no value is present for PendingTransactionId, not even an explicit nil
func (o *TransactionBase) UnsetPendingTransactionId() {
o.PendingTransactionId.Unset()
}
// GetCategoryId returns the CategoryId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetCategoryId() string {
if o == nil || o.CategoryId.Get() == nil {
var ret string
return ret
}
return *o.CategoryId.Get()
}
// GetCategoryIdOk returns a tuple with the CategoryId 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 *TransactionBase) GetCategoryIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CategoryId.Get(), o.CategoryId.IsSet()
}
// HasCategoryId returns a boolean if a field has been set.
func (o *TransactionBase) HasCategoryId() bool {
if o != nil && o.CategoryId.IsSet() {
return true
}
return false
}
// SetCategoryId gets a reference to the given NullableString and assigns it to the CategoryId field.
func (o *TransactionBase) SetCategoryId(v string) {
o.CategoryId.Set(&v)
}
// SetCategoryIdNil sets the value for CategoryId to be an explicit nil
func (o *TransactionBase) SetCategoryIdNil() {
o.CategoryId.Set(nil)
}
// UnsetCategoryId ensures that no value is present for CategoryId, not even an explicit nil
func (o *TransactionBase) UnsetCategoryId() {
o.CategoryId.Unset()
}
// GetCategory returns the Category field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetCategory() []string {
if o == nil {
var ret []string
return ret
}
return o.Category
}
// GetCategoryOk returns a tuple with the Category 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 *TransactionBase) GetCategoryOk() (*[]string, bool) {
if o == nil || o.Category == nil {
return nil, false
}
return &o.Category, true
}
// HasCategory returns a boolean if a field has been set.
func (o *TransactionBase) HasCategory() bool {
if o != nil && o.Category != nil {
return true
}
return false
}
// SetCategory gets a reference to the given []string and assigns it to the Category field.
func (o *TransactionBase) SetCategory(v []string) {
o.Category = v
}
// GetLocation returns the Location field value if set, zero value otherwise.
func (o *TransactionBase) GetLocation() Location {
if o == nil || o.Location == nil {
var ret Location
return ret
}
return *o.Location
}
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetLocationOk() (*Location, bool) {
if o == nil || o.Location == nil {
return nil, false
}
return o.Location, true
}
// HasLocation returns a boolean if a field has been set.
func (o *TransactionBase) HasLocation() bool {
if o != nil && o.Location != nil {
return true
}
return false
}
// SetLocation gets a reference to the given Location and assigns it to the Location field.
func (o *TransactionBase) SetLocation(v Location) {
o.Location = &v
}
// GetPaymentMeta returns the PaymentMeta field value if set, zero value otherwise.
func (o *TransactionBase) GetPaymentMeta() PaymentMeta {
if o == nil || o.PaymentMeta == nil {
var ret PaymentMeta
return ret
}
return *o.PaymentMeta
}
// GetPaymentMetaOk returns a tuple with the PaymentMeta field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetPaymentMetaOk() (*PaymentMeta, bool) {
if o == nil || o.PaymentMeta == nil {
return nil, false
}
return o.PaymentMeta, true
}
// HasPaymentMeta returns a boolean if a field has been set.
func (o *TransactionBase) HasPaymentMeta() bool {
if o != nil && o.PaymentMeta != nil {
return true
}
return false
}
// SetPaymentMeta gets a reference to the given PaymentMeta and assigns it to the PaymentMeta field.
func (o *TransactionBase) SetPaymentMeta(v PaymentMeta) {
o.PaymentMeta = &v
}
// GetAccountOwner returns the AccountOwner field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetAccountOwner() string {
if o == nil || o.AccountOwner.Get() == nil {
var ret string
return ret
}
return *o.AccountOwner.Get()
}
// GetAccountOwnerOk returns a tuple with the AccountOwner 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 *TransactionBase) GetAccountOwnerOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.AccountOwner.Get(), o.AccountOwner.IsSet()
}
// HasAccountOwner returns a boolean if a field has been set.
func (o *TransactionBase) HasAccountOwner() bool {
if o != nil && o.AccountOwner.IsSet() {
return true
}
return false
}
// SetAccountOwner gets a reference to the given NullableString and assigns it to the AccountOwner field.
func (o *TransactionBase) SetAccountOwner(v string) {
o.AccountOwner.Set(&v)
}
// SetAccountOwnerNil sets the value for AccountOwner to be an explicit nil
func (o *TransactionBase) SetAccountOwnerNil() {
o.AccountOwner.Set(nil)
}
// UnsetAccountOwner ensures that no value is present for AccountOwner, not even an explicit nil
func (o *TransactionBase) UnsetAccountOwner() {
o.AccountOwner.Unset()
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *TransactionBase) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *TransactionBase) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *TransactionBase) SetName(v string) {
o.Name = &v
}
// GetOriginalDescription returns the OriginalDescription field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetOriginalDescription() string {
if o == nil || o.OriginalDescription.Get() == nil {
var ret string
return ret
}
return *o.OriginalDescription.Get()
}
// GetOriginalDescriptionOk returns a tuple with the OriginalDescription 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 *TransactionBase) GetOriginalDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OriginalDescription.Get(), o.OriginalDescription.IsSet()
}
// HasOriginalDescription returns a boolean if a field has been set.
func (o *TransactionBase) HasOriginalDescription() bool {
if o != nil && o.OriginalDescription.IsSet() {
return true
}
return false
}
// SetOriginalDescription gets a reference to the given NullableString and assigns it to the OriginalDescription field.
func (o *TransactionBase) SetOriginalDescription(v string) {
o.OriginalDescription.Set(&v)
}
// SetOriginalDescriptionNil sets the value for OriginalDescription to be an explicit nil
func (o *TransactionBase) SetOriginalDescriptionNil() {
o.OriginalDescription.Set(nil)
}
// UnsetOriginalDescription ensures that no value is present for OriginalDescription, not even an explicit nil
func (o *TransactionBase) UnsetOriginalDescription() {
o.OriginalDescription.Unset()
}
// GetAccountId returns the AccountId field value
func (o *TransactionBase) GetAccountId() string {
if o == nil {
var ret string
return ret
}
return o.AccountId
}
// GetAccountIdOk returns a tuple with the AccountId field value
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetAccountIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AccountId, true
}
// SetAccountId sets field value
func (o *TransactionBase) SetAccountId(v string) {
o.AccountId = v
}
// GetAmount returns the Amount field value
func (o *TransactionBase) GetAmount() float32 {
if o == nil {
var ret float32
return ret
}
return o.Amount
}
// GetAmountOk returns a tuple with the Amount field value
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetAmountOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Amount, true
}
// SetAmount sets field value
func (o *TransactionBase) SetAmount(v float32) {
o.Amount = v
}
// GetIsoCurrencyCode returns the IsoCurrencyCode field value
// If the value is explicit nil, the zero value for string will be returned
func (o *TransactionBase) GetIsoCurrencyCode() string {
if o == nil || o.IsoCurrencyCode.Get() == nil {
var ret string
return ret
}
return *o.IsoCurrencyCode.Get()
}
// GetIsoCurrencyCodeOk returns a tuple with the IsoCurrencyCode 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 *TransactionBase) GetIsoCurrencyCodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.IsoCurrencyCode.Get(), o.IsoCurrencyCode.IsSet()
}
// SetIsoCurrencyCode sets field value
func (o *TransactionBase) SetIsoCurrencyCode(v string) {
o.IsoCurrencyCode.Set(&v)
}
// GetUnofficialCurrencyCode returns the UnofficialCurrencyCode field value
// If the value is explicit nil, the zero value for string will be returned
func (o *TransactionBase) GetUnofficialCurrencyCode() string {
if o == nil || o.UnofficialCurrencyCode.Get() == nil {
var ret string
return ret
}
return *o.UnofficialCurrencyCode.Get()
}
// GetUnofficialCurrencyCodeOk returns a tuple with the UnofficialCurrencyCode 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 *TransactionBase) GetUnofficialCurrencyCodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.UnofficialCurrencyCode.Get(), o.UnofficialCurrencyCode.IsSet()
}
// SetUnofficialCurrencyCode sets field value
func (o *TransactionBase) SetUnofficialCurrencyCode(v string) {
o.UnofficialCurrencyCode.Set(&v)
}
// GetDate returns the Date field value
func (o *TransactionBase) GetDate() string {
if o == nil {
var ret string
return ret
}
return o.Date
}
// GetDateOk returns a tuple with the Date field value
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetDateOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Date, true
}
// SetDate sets field value
func (o *TransactionBase) SetDate(v string) {
o.Date = v
}
// GetPending returns the Pending field value
func (o *TransactionBase) GetPending() bool {
if o == nil {
var ret bool
return ret
}
return o.Pending
}
// GetPendingOk returns a tuple with the Pending field value
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetPendingOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Pending, true
}
// SetPending sets field value
func (o *TransactionBase) SetPending(v bool) {
o.Pending = v
}
// GetTransactionId returns the TransactionId field value
func (o *TransactionBase) GetTransactionId() string {
if o == nil {
var ret string
return ret
}
return o.TransactionId
}
// GetTransactionIdOk returns a tuple with the TransactionId field value
// and a boolean to check if the value has been set.
func (o *TransactionBase) GetTransactionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TransactionId, true
}
// SetTransactionId sets field value
func (o *TransactionBase) SetTransactionId(v string) {
o.TransactionId = v
}
// GetMerchantName returns the MerchantName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetMerchantName() string {
if o == nil || o.MerchantName.Get() == nil {
var ret string
return ret
}
return *o.MerchantName.Get()
}
// GetMerchantNameOk returns a tuple with the MerchantName 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 *TransactionBase) GetMerchantNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MerchantName.Get(), o.MerchantName.IsSet()
}
// HasMerchantName returns a boolean if a field has been set.
func (o *TransactionBase) HasMerchantName() bool {
if o != nil && o.MerchantName.IsSet() {
return true
}
return false
}
// SetMerchantName gets a reference to the given NullableString and assigns it to the MerchantName field.
func (o *TransactionBase) SetMerchantName(v string) {
o.MerchantName.Set(&v)
}
// SetMerchantNameNil sets the value for MerchantName to be an explicit nil
func (o *TransactionBase) SetMerchantNameNil() {
o.MerchantName.Set(nil)
}
// UnsetMerchantName ensures that no value is present for MerchantName, not even an explicit nil
func (o *TransactionBase) UnsetMerchantName() {
o.MerchantName.Unset()
}
// GetCheckNumber returns the CheckNumber field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TransactionBase) GetCheckNumber() string {
if o == nil || o.CheckNumber.Get() == nil {
var ret string
return ret
}
return *o.CheckNumber.Get()
}
// GetCheckNumberOk returns a tuple with the CheckNumber 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 *TransactionBase) GetCheckNumberOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CheckNumber.Get(), o.CheckNumber.IsSet()
}
// HasCheckNumber returns a boolean if a field has been set.
func (o *TransactionBase) HasCheckNumber() bool {
if o != nil && o.CheckNumber.IsSet() {
return true
}
return false
}
// SetCheckNumber gets a reference to the given NullableString and assigns it to the CheckNumber field.
func (o *TransactionBase) SetCheckNumber(v string) {
o.CheckNumber.Set(&v)
}
// SetCheckNumberNil sets the value for CheckNumber to be an explicit nil
func (o *TransactionBase) SetCheckNumberNil() {
o.CheckNumber.Set(nil)
}
// UnsetCheckNumber ensures that no value is present for CheckNumber, not even an explicit nil
func (o *TransactionBase) UnsetCheckNumber() {
o.CheckNumber.Unset()
}
func (o TransactionBase) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.TransactionType != nil {
toSerialize["transaction_type"] = o.TransactionType
}
if o.PendingTransactionId.IsSet() {
toSerialize["pending_transaction_id"] = o.PendingTransactionId.Get()
}
if o.CategoryId.IsSet() {
toSerialize["category_id"] = o.CategoryId.Get()
}
if o.Category != nil {
toSerialize["category"] = o.Category
}
if o.Location != nil {
toSerialize["location"] = o.Location
}
if o.PaymentMeta != nil {
toSerialize["payment_meta"] = o.PaymentMeta
}
if o.AccountOwner.IsSet() {
toSerialize["account_owner"] = o.AccountOwner.Get()
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.OriginalDescription.IsSet() {
toSerialize["original_description"] = o.OriginalDescription.Get()
}
if true {
toSerialize["account_id"] = o.AccountId
}
if true {
toSerialize["amount"] = o.Amount
}
if true {
toSerialize["iso_currency_code"] = o.IsoCurrencyCode.Get()
}
if true {
toSerialize["unofficial_currency_code"] = o.UnofficialCurrencyCode.Get()
}
if true {
toSerialize["date"] = o.Date
}
if true {
toSerialize["pending"] = o.Pending
}
if true {
toSerialize["transaction_id"] = o.TransactionId
}
if o.MerchantName.IsSet() {
toSerialize["merchant_name"] = o.MerchantName.Get()
}
if o.CheckNumber.IsSet() {
toSerialize["check_number"] = o.CheckNumber.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *TransactionBase) UnmarshalJSON(bytes []byte) (err error) {
varTransactionBase := _TransactionBase{}
if err = json.Unmarshal(bytes, &varTransactionBase); err == nil {
*o = TransactionBase(varTransactionBase)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "transaction_type")
delete(additionalProperties, "pending_transaction_id")
delete(additionalProperties, "category_id")
delete(additionalProperties, "category")
delete(additionalProperties, "location")
delete(additionalProperties, "payment_meta")
delete(additionalProperties, "account_owner")
delete(additionalProperties, "name")
delete(additionalProperties, "original_description")
delete(additionalProperties, "account_id")
delete(additionalProperties, "amount")
delete(additionalProperties, "iso_currency_code")
delete(additionalProperties, "unofficial_currency_code")
delete(additionalProperties, "date")
delete(additionalProperties, "pending")
delete(additionalProperties, "transaction_id")
delete(additionalProperties, "merchant_name")
delete(additionalProperties, "check_number")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionBase struct {
value *TransactionBase
isSet bool
}
func (v NullableTransactionBase) Get() *TransactionBase {
return v.value
}
func (v *NullableTransactionBase) Set(val *TransactionBase) {
v.value = val
v.isSet = true
}
func (v NullableTransactionBase) IsSet() bool {
return v.isSet
}
func (v *NullableTransactionBase) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTransactionBase(val *TransactionBase) *NullableTransactionBase {
return &NullableTransactionBase{value: val, isSet: true}
}
func (v NullableTransactionBase) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTransactionBase) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}