-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_transfer.go
1026 lines (872 loc) · 27.7 KB
/
model_transfer.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
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Paxos API
<p>Welcome to Paxos APIs. At Paxos, our mission is to enable the movement of any asset, any time, in a trustworthy way. These APIs serve that mission by making it easier than ever for you to directly integrate our product capabilities into your application, leveraging the speed, stability, and security of the Paxos platform.</p> <p>The documentation that follows gives you access to our Crypto Brokerage, Trading, and Exchange products. It includes APIs for market data, orders, and the held rate quote flow.</p> <p>To test in our sandbox environment, <a href=\"https://account.sandbox.paxos.com\" target=\"_blank\">sign up</a> for an account. For more information about Paxos and our APIs, visit <a href=\"https://www.paxos.com/\" target=\"_blank\">Paxos.com</a>.</p>
API version: 2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package paxos
import (
"encoding/json"
"time"
"fmt"
)
// checks if the Transfer type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Transfer{}
// Transfer struct for Transfer
type Transfer struct {
// The Paxos transfer ID.
Id string `json:"id"`
// The Paxos customer ID.
CustomerId string `json:"customer_id"`
// The target Profile of the transfer. The profile asset balance is debited or credited by the transfer.
ProfileId string `json:"profile_id"`
// The Paxos ID of the Identity associated with the transfer.
IdentityId *string `json:"identity_id,omitempty"`
// The optional client-specified ID for replay protection and lookup.
RefId *string `json:"ref_id,omitempty"`
// The amount sent in the transfer.
Amount string `json:"amount" validate:"regexp=^[0-9]*\\\\.?[0-9]+$"`
// The balance change from this transfer: amount - fee for deposits, and amount + fee for withdrawals. Unsigned.
Total string `json:"total" validate:"regexp=^[0-9]*\\\\.?[0-9]+$"`
// The fee paid for the transfer.
Fee string `json:"fee" validate:"regexp=^[0-9]*\\\\.?[0-9]+$"`
// The asset for this transfer. This profile's balance of this asset will be debited or credited.
Asset string `json:"asset"`
// The balance_asset represents what asset's balance was affected at Paxos with this transfer. It only differs from Asset when the transfer includes conversion.
BalanceAsset *string `json:"balance_asset,omitempty"`
Direction TransferDirection `json:"direction"`
Type TransferType `json:"type"`
Status TransferStatus `json:"status"`
// The time at which this transfer record was created.
CreatedAt time.Time `json:"created_at"`
// The time at which this transfer record was most recently updated.
UpdatedAt time.Time `json:"updated_at"`
// Optional client-specified stored metadata. For deposit event transfers this metadata is copied from the crypto deposit address or fiat deposit memo used for attribution. Up to 6 key/value pairs may be returned. Each key and value must be less than or equal to 100 characters.
Metadata *map[string]string `json:"metadata,omitempty"`
// The destination crypto address.
DestinationAddress *string `json:"destination_address,omitempty"`
CryptoNetwork *CryptoNetwork `json:"crypto_network,omitempty"`
// For crypto transactions, the on-chain transaction hash.
CryptoTxHash *string `json:"crypto_tx_hash,omitempty"`
// For crypto transactions, the output index or output address.
CryptoTxIndex *string `json:"crypto_tx_index,omitempty"`
// The Paxos ID of the Account associated with the transfer.
AccountId *string `json:"account_id,omitempty"`
AutoConversion *AutoConversion `json:"auto_conversion,omitempty"`
// Unique identifier linking the debit and credit sides of an internal or Paxos transfer.
GroupId *string `json:"group_id,omitempty"`
// For fiat withdrawals, the Paxos ID of the owner's fiat account (UUID).
FiatAccountId *string `json:"fiat_account_id,omitempty"`
SecondaryStatus *SecondaryStatus `json:"secondary_status,omitempty"`
// For crypto withdrawals and deposits, the USD value of the combined amount and fee at the time of the transfer.
NotionalValue *string `json:"notional_value,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Transfer Transfer
// NewTransfer instantiates a new Transfer 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 NewTransfer(id string, customerId string, profileId string, amount string, total string, fee string, asset string, direction TransferDirection, type_ TransferType, status TransferStatus, createdAt time.Time, updatedAt time.Time) *Transfer {
this := Transfer{}
this.Id = id
this.CustomerId = customerId
this.ProfileId = profileId
this.Amount = amount
this.Total = total
this.Fee = fee
this.Asset = asset
this.Direction = direction
this.Type = type_
this.Status = status
this.CreatedAt = createdAt
this.UpdatedAt = updatedAt
return &this
}
// NewTransferWithDefaults instantiates a new Transfer 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 NewTransferWithDefaults() *Transfer {
this := Transfer{}
return &this
}
// GetId returns the Id field value
func (o *Transfer) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *Transfer) SetId(v string) {
o.Id = v
}
// GetCustomerId returns the CustomerId field value
func (o *Transfer) GetCustomerId() string {
if o == nil {
var ret string
return ret
}
return o.CustomerId
}
// GetCustomerIdOk returns a tuple with the CustomerId field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetCustomerIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CustomerId, true
}
// SetCustomerId sets field value
func (o *Transfer) SetCustomerId(v string) {
o.CustomerId = v
}
// GetProfileId returns the ProfileId field value
func (o *Transfer) GetProfileId() string {
if o == nil {
var ret string
return ret
}
return o.ProfileId
}
// GetProfileIdOk returns a tuple with the ProfileId field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetProfileIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ProfileId, true
}
// SetProfileId sets field value
func (o *Transfer) SetProfileId(v string) {
o.ProfileId = v
}
// GetIdentityId returns the IdentityId field value if set, zero value otherwise.
func (o *Transfer) GetIdentityId() string {
if o == nil || IsNil(o.IdentityId) {
var ret string
return ret
}
return *o.IdentityId
}
// GetIdentityIdOk returns a tuple with the IdentityId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetIdentityIdOk() (*string, bool) {
if o == nil || IsNil(o.IdentityId) {
return nil, false
}
return o.IdentityId, true
}
// HasIdentityId returns a boolean if a field has been set.
func (o *Transfer) HasIdentityId() bool {
if o != nil && !IsNil(o.IdentityId) {
return true
}
return false
}
// SetIdentityId gets a reference to the given string and assigns it to the IdentityId field.
func (o *Transfer) SetIdentityId(v string) {
o.IdentityId = &v
}
// GetRefId returns the RefId field value if set, zero value otherwise.
func (o *Transfer) GetRefId() string {
if o == nil || IsNil(o.RefId) {
var ret string
return ret
}
return *o.RefId
}
// GetRefIdOk returns a tuple with the RefId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetRefIdOk() (*string, bool) {
if o == nil || IsNil(o.RefId) {
return nil, false
}
return o.RefId, true
}
// HasRefId returns a boolean if a field has been set.
func (o *Transfer) HasRefId() bool {
if o != nil && !IsNil(o.RefId) {
return true
}
return false
}
// SetRefId gets a reference to the given string and assigns it to the RefId field.
func (o *Transfer) SetRefId(v string) {
o.RefId = &v
}
// GetAmount returns the Amount field value
func (o *Transfer) GetAmount() string {
if o == nil {
var ret string
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 *Transfer) GetAmountOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Amount, true
}
// SetAmount sets field value
func (o *Transfer) SetAmount(v string) {
o.Amount = v
}
// GetTotal returns the Total field value
func (o *Transfer) GetTotal() string {
if o == nil {
var ret string
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetTotalOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *Transfer) SetTotal(v string) {
o.Total = v
}
// GetFee returns the Fee field value
func (o *Transfer) GetFee() string {
if o == nil {
var ret string
return ret
}
return o.Fee
}
// GetFeeOk returns a tuple with the Fee field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetFeeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Fee, true
}
// SetFee sets field value
func (o *Transfer) SetFee(v string) {
o.Fee = v
}
// GetAsset returns the Asset field value
func (o *Transfer) GetAsset() string {
if o == nil {
var ret string
return ret
}
return o.Asset
}
// GetAssetOk returns a tuple with the Asset field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetAssetOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Asset, true
}
// SetAsset sets field value
func (o *Transfer) SetAsset(v string) {
o.Asset = v
}
// GetBalanceAsset returns the BalanceAsset field value if set, zero value otherwise.
func (o *Transfer) GetBalanceAsset() string {
if o == nil || IsNil(o.BalanceAsset) {
var ret string
return ret
}
return *o.BalanceAsset
}
// GetBalanceAssetOk returns a tuple with the BalanceAsset field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetBalanceAssetOk() (*string, bool) {
if o == nil || IsNil(o.BalanceAsset) {
return nil, false
}
return o.BalanceAsset, true
}
// HasBalanceAsset returns a boolean if a field has been set.
func (o *Transfer) HasBalanceAsset() bool {
if o != nil && !IsNil(o.BalanceAsset) {
return true
}
return false
}
// SetBalanceAsset gets a reference to the given string and assigns it to the BalanceAsset field.
func (o *Transfer) SetBalanceAsset(v string) {
o.BalanceAsset = &v
}
// GetDirection returns the Direction field value
func (o *Transfer) GetDirection() TransferDirection {
if o == nil {
var ret TransferDirection
return ret
}
return o.Direction
}
// GetDirectionOk returns a tuple with the Direction field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetDirectionOk() (*TransferDirection, bool) {
if o == nil {
return nil, false
}
return &o.Direction, true
}
// SetDirection sets field value
func (o *Transfer) SetDirection(v TransferDirection) {
o.Direction = v
}
// GetType returns the Type field value
func (o *Transfer) GetType() TransferType {
if o == nil {
var ret TransferType
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetTypeOk() (*TransferType, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *Transfer) SetType(v TransferType) {
o.Type = v
}
// GetStatus returns the Status field value
func (o *Transfer) GetStatus() TransferStatus {
if o == nil {
var ret TransferStatus
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetStatusOk() (*TransferStatus, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *Transfer) SetStatus(v TransferStatus) {
o.Status = v
}
// GetCreatedAt returns the CreatedAt field value
func (o *Transfer) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *Transfer) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *Transfer) GetUpdatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *Transfer) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *Transfer) SetUpdatedAt(v time.Time) {
o.UpdatedAt = v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *Transfer) GetMetadata() map[string]string {
if o == nil || IsNil(o.Metadata) {
var ret map[string]string
return ret
}
return *o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetMetadataOk() (*map[string]string, bool) {
if o == nil || IsNil(o.Metadata) {
return nil, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *Transfer) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field.
func (o *Transfer) SetMetadata(v map[string]string) {
o.Metadata = &v
}
// GetDestinationAddress returns the DestinationAddress field value if set, zero value otherwise.
func (o *Transfer) GetDestinationAddress() string {
if o == nil || IsNil(o.DestinationAddress) {
var ret string
return ret
}
return *o.DestinationAddress
}
// GetDestinationAddressOk returns a tuple with the DestinationAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetDestinationAddressOk() (*string, bool) {
if o == nil || IsNil(o.DestinationAddress) {
return nil, false
}
return o.DestinationAddress, true
}
// HasDestinationAddress returns a boolean if a field has been set.
func (o *Transfer) HasDestinationAddress() bool {
if o != nil && !IsNil(o.DestinationAddress) {
return true
}
return false
}
// SetDestinationAddress gets a reference to the given string and assigns it to the DestinationAddress field.
func (o *Transfer) SetDestinationAddress(v string) {
o.DestinationAddress = &v
}
// GetCryptoNetwork returns the CryptoNetwork field value if set, zero value otherwise.
func (o *Transfer) GetCryptoNetwork() CryptoNetwork {
if o == nil || IsNil(o.CryptoNetwork) {
var ret CryptoNetwork
return ret
}
return *o.CryptoNetwork
}
// GetCryptoNetworkOk returns a tuple with the CryptoNetwork field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetCryptoNetworkOk() (*CryptoNetwork, bool) {
if o == nil || IsNil(o.CryptoNetwork) {
return nil, false
}
return o.CryptoNetwork, true
}
// HasCryptoNetwork returns a boolean if a field has been set.
func (o *Transfer) HasCryptoNetwork() bool {
if o != nil && !IsNil(o.CryptoNetwork) {
return true
}
return false
}
// SetCryptoNetwork gets a reference to the given CryptoNetwork and assigns it to the CryptoNetwork field.
func (o *Transfer) SetCryptoNetwork(v CryptoNetwork) {
o.CryptoNetwork = &v
}
// GetCryptoTxHash returns the CryptoTxHash field value if set, zero value otherwise.
func (o *Transfer) GetCryptoTxHash() string {
if o == nil || IsNil(o.CryptoTxHash) {
var ret string
return ret
}
return *o.CryptoTxHash
}
// GetCryptoTxHashOk returns a tuple with the CryptoTxHash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetCryptoTxHashOk() (*string, bool) {
if o == nil || IsNil(o.CryptoTxHash) {
return nil, false
}
return o.CryptoTxHash, true
}
// HasCryptoTxHash returns a boolean if a field has been set.
func (o *Transfer) HasCryptoTxHash() bool {
if o != nil && !IsNil(o.CryptoTxHash) {
return true
}
return false
}
// SetCryptoTxHash gets a reference to the given string and assigns it to the CryptoTxHash field.
func (o *Transfer) SetCryptoTxHash(v string) {
o.CryptoTxHash = &v
}
// GetCryptoTxIndex returns the CryptoTxIndex field value if set, zero value otherwise.
func (o *Transfer) GetCryptoTxIndex() string {
if o == nil || IsNil(o.CryptoTxIndex) {
var ret string
return ret
}
return *o.CryptoTxIndex
}
// GetCryptoTxIndexOk returns a tuple with the CryptoTxIndex field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetCryptoTxIndexOk() (*string, bool) {
if o == nil || IsNil(o.CryptoTxIndex) {
return nil, false
}
return o.CryptoTxIndex, true
}
// HasCryptoTxIndex returns a boolean if a field has been set.
func (o *Transfer) HasCryptoTxIndex() bool {
if o != nil && !IsNil(o.CryptoTxIndex) {
return true
}
return false
}
// SetCryptoTxIndex gets a reference to the given string and assigns it to the CryptoTxIndex field.
func (o *Transfer) SetCryptoTxIndex(v string) {
o.CryptoTxIndex = &v
}
// GetAccountId returns the AccountId field value if set, zero value otherwise.
func (o *Transfer) GetAccountId() string {
if o == nil || IsNil(o.AccountId) {
var ret string
return ret
}
return *o.AccountId
}
// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetAccountIdOk() (*string, bool) {
if o == nil || IsNil(o.AccountId) {
return nil, false
}
return o.AccountId, true
}
// HasAccountId returns a boolean if a field has been set.
func (o *Transfer) HasAccountId() bool {
if o != nil && !IsNil(o.AccountId) {
return true
}
return false
}
// SetAccountId gets a reference to the given string and assigns it to the AccountId field.
func (o *Transfer) SetAccountId(v string) {
o.AccountId = &v
}
// GetAutoConversion returns the AutoConversion field value if set, zero value otherwise.
func (o *Transfer) GetAutoConversion() AutoConversion {
if o == nil || IsNil(o.AutoConversion) {
var ret AutoConversion
return ret
}
return *o.AutoConversion
}
// GetAutoConversionOk returns a tuple with the AutoConversion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetAutoConversionOk() (*AutoConversion, bool) {
if o == nil || IsNil(o.AutoConversion) {
return nil, false
}
return o.AutoConversion, true
}
// HasAutoConversion returns a boolean if a field has been set.
func (o *Transfer) HasAutoConversion() bool {
if o != nil && !IsNil(o.AutoConversion) {
return true
}
return false
}
// SetAutoConversion gets a reference to the given AutoConversion and assigns it to the AutoConversion field.
func (o *Transfer) SetAutoConversion(v AutoConversion) {
o.AutoConversion = &v
}
// GetGroupId returns the GroupId field value if set, zero value otherwise.
func (o *Transfer) GetGroupId() string {
if o == nil || IsNil(o.GroupId) {
var ret string
return ret
}
return *o.GroupId
}
// GetGroupIdOk returns a tuple with the GroupId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetGroupIdOk() (*string, bool) {
if o == nil || IsNil(o.GroupId) {
return nil, false
}
return o.GroupId, true
}
// HasGroupId returns a boolean if a field has been set.
func (o *Transfer) HasGroupId() bool {
if o != nil && !IsNil(o.GroupId) {
return true
}
return false
}
// SetGroupId gets a reference to the given string and assigns it to the GroupId field.
func (o *Transfer) SetGroupId(v string) {
o.GroupId = &v
}
// GetFiatAccountId returns the FiatAccountId field value if set, zero value otherwise.
func (o *Transfer) GetFiatAccountId() string {
if o == nil || IsNil(o.FiatAccountId) {
var ret string
return ret
}
return *o.FiatAccountId
}
// GetFiatAccountIdOk returns a tuple with the FiatAccountId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetFiatAccountIdOk() (*string, bool) {
if o == nil || IsNil(o.FiatAccountId) {
return nil, false
}
return o.FiatAccountId, true
}
// HasFiatAccountId returns a boolean if a field has been set.
func (o *Transfer) HasFiatAccountId() bool {
if o != nil && !IsNil(o.FiatAccountId) {
return true
}
return false
}
// SetFiatAccountId gets a reference to the given string and assigns it to the FiatAccountId field.
func (o *Transfer) SetFiatAccountId(v string) {
o.FiatAccountId = &v
}
// GetSecondaryStatus returns the SecondaryStatus field value if set, zero value otherwise.
func (o *Transfer) GetSecondaryStatus() SecondaryStatus {
if o == nil || IsNil(o.SecondaryStatus) {
var ret SecondaryStatus
return ret
}
return *o.SecondaryStatus
}
// GetSecondaryStatusOk returns a tuple with the SecondaryStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetSecondaryStatusOk() (*SecondaryStatus, bool) {
if o == nil || IsNil(o.SecondaryStatus) {
return nil, false
}
return o.SecondaryStatus, true
}
// HasSecondaryStatus returns a boolean if a field has been set.
func (o *Transfer) HasSecondaryStatus() bool {
if o != nil && !IsNil(o.SecondaryStatus) {
return true
}
return false
}
// SetSecondaryStatus gets a reference to the given SecondaryStatus and assigns it to the SecondaryStatus field.
func (o *Transfer) SetSecondaryStatus(v SecondaryStatus) {
o.SecondaryStatus = &v
}
// GetNotionalValue returns the NotionalValue field value if set, zero value otherwise.
func (o *Transfer) GetNotionalValue() string {
if o == nil || IsNil(o.NotionalValue) {
var ret string
return ret
}
return *o.NotionalValue
}
// GetNotionalValueOk returns a tuple with the NotionalValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transfer) GetNotionalValueOk() (*string, bool) {
if o == nil || IsNil(o.NotionalValue) {
return nil, false
}
return o.NotionalValue, true
}
// HasNotionalValue returns a boolean if a field has been set.
func (o *Transfer) HasNotionalValue() bool {
if o != nil && !IsNil(o.NotionalValue) {
return true
}
return false
}
// SetNotionalValue gets a reference to the given string and assigns it to the NotionalValue field.
func (o *Transfer) SetNotionalValue(v string) {
o.NotionalValue = &v
}
func (o Transfer) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Transfer) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["customer_id"] = o.CustomerId
toSerialize["profile_id"] = o.ProfileId
if !IsNil(o.IdentityId) {
toSerialize["identity_id"] = o.IdentityId
}
if !IsNil(o.RefId) {
toSerialize["ref_id"] = o.RefId
}
toSerialize["amount"] = o.Amount
toSerialize["total"] = o.Total
toSerialize["fee"] = o.Fee
toSerialize["asset"] = o.Asset
if !IsNil(o.BalanceAsset) {
toSerialize["balance_asset"] = o.BalanceAsset
}
toSerialize["direction"] = o.Direction
toSerialize["type"] = o.Type
toSerialize["status"] = o.Status
toSerialize["created_at"] = o.CreatedAt
toSerialize["updated_at"] = o.UpdatedAt
if !IsNil(o.Metadata) {
toSerialize["metadata"] = o.Metadata
}
if !IsNil(o.DestinationAddress) {
toSerialize["destination_address"] = o.DestinationAddress
}
if !IsNil(o.CryptoNetwork) {
toSerialize["crypto_network"] = o.CryptoNetwork
}
if !IsNil(o.CryptoTxHash) {
toSerialize["crypto_tx_hash"] = o.CryptoTxHash
}
if !IsNil(o.CryptoTxIndex) {
toSerialize["crypto_tx_index"] = o.CryptoTxIndex
}
if !IsNil(o.AccountId) {
toSerialize["account_id"] = o.AccountId
}
if !IsNil(o.AutoConversion) {
toSerialize["auto_conversion"] = o.AutoConversion
}
if !IsNil(o.GroupId) {
toSerialize["group_id"] = o.GroupId
}
if !IsNil(o.FiatAccountId) {
toSerialize["fiat_account_id"] = o.FiatAccountId
}
if !IsNil(o.SecondaryStatus) {
toSerialize["secondary_status"] = o.SecondaryStatus
}
if !IsNil(o.NotionalValue) {
toSerialize["notional_value"] = o.NotionalValue
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Transfer) 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{
"id",
"customer_id",
"profile_id",
"amount",
"total",
"fee",
"asset",
"direction",
"type",
"status",
"created_at",
"updated_at",
}
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)
}
}
varTransfer := _Transfer{}
err = json.Unmarshal(data, &varTransfer)
if err != nil {
return err
}
*o = Transfer(varTransfer)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "customer_id")
delete(additionalProperties, "profile_id")
delete(additionalProperties, "identity_id")
delete(additionalProperties, "ref_id")
delete(additionalProperties, "amount")
delete(additionalProperties, "total")
delete(additionalProperties, "fee")
delete(additionalProperties, "asset")
delete(additionalProperties, "balance_asset")
delete(additionalProperties, "direction")
delete(additionalProperties, "type")
delete(additionalProperties, "status")
delete(additionalProperties, "created_at")
delete(additionalProperties, "updated_at")
delete(additionalProperties, "metadata")
delete(additionalProperties, "destination_address")
delete(additionalProperties, "crypto_network")
delete(additionalProperties, "crypto_tx_hash")
delete(additionalProperties, "crypto_tx_index")
delete(additionalProperties, "account_id")
delete(additionalProperties, "auto_conversion")
delete(additionalProperties, "group_id")
delete(additionalProperties, "fiat_account_id")
delete(additionalProperties, "secondary_status")
delete(additionalProperties, "notional_value")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransfer struct {
value *Transfer
isSet bool
}
func (v NullableTransfer) Get() *Transfer {
return v.value
}
func (v *NullableTransfer) Set(val *Transfer) {
v.value = val