-
Notifications
You must be signed in to change notification settings - Fork 3
/
generated-types.go
687 lines (553 loc) · 24.6 KB
/
generated-types.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
// Package wallet provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
package wallet
import (
"encoding/json"
"fmt"
"github.com/pkg/errors"
)
// ScriptTemplateValue defines model for ScriptTemplateValue.
type ScriptTemplateValue interface{}
// ScriptValue defines model for ScriptValue.
type ScriptValue interface{}
// TransactionMetadataValue defines model for TransactionMetadataValue.
type TransactionMetadataValue interface{}
// PostAnyAddressJSONBody defines parameters for PostAnyAddress.
type PostAnyAddressJSONBody struct {
Payment *interface{} `json:"payment,omitempty"`
Stake *interface{} `json:"stake,omitempty"`
// Script validation level. Required validation sifts off scripts that would not
// be accepted by the ledger. Recommended level filters out scripts that do not pass
// required validation and additionally when:
// * 'all' is non-empty
// * there are redundant timelocks in a given level
// * there are no duplicated verification keys in a given level
// * 'at_least' coeffcient is positive
// * 'all', 'any' are non-empty and `'at_least' has no less elements in the list
// than the coeffcient after timelocks are filtered out.
Validation *string `json:"validation,omitempty"`
}
// PostByronWalletJSONBody defines parameters for PostByronWallet.
type PostByronWalletJSONBody interface{}
// PutByronWalletJSONBody defines parameters for PutByronWallet.
type PutByronWalletJSONBody struct {
Name *string `json:"name,omitempty"`
}
// ListByronAddressesParams defines parameters for ListByronAddresses.
type ListByronAddressesParams struct {
// An optional filter on the address state.
State *string `json:"state,omitempty"`
}
// CreateAddressJSONBody defines parameters for CreateAddress.
type CreateAddressJSONBody struct {
// An address derivation index.
AddressIndex *float32 `json:"address_index,omitempty"`
// A master passphrase to lock and protect the wallet for sensitive operation (e.g. sending funds)
Passphrase string `json:"passphrase"`
}
// ImportAddressesJSONBody defines parameters for ImportAddresses.
type ImportAddressesJSONBody struct {
// The imported addresses.
Addresses []string `json:"addresses"`
}
// ByronSelectCoinsJSONBody defines parameters for ByronSelectCoins.
type ByronSelectCoinsJSONBody struct {
// A list of target outputs
Payments []struct {
Address string `json:"address"`
// Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead.
Amount struct {
Quantity int `json:"quantity"`
Unit string `json:"unit"`
} `json:"amount"`
// A flat list of assets.
Assets *[]struct {
// The asset on-chain type which acts as a sub-identifier within a
// policy. Although we call it "asset name", the value needn't be
// text, and it could even be empty.
//
// For policies with a single fungible asset item, asset name is
// typically an empty string.
//
// This value can be up to 32 bytes of arbitrary data (which is 64
// hexadecimal digits).
AssetName string `json:"asset_name"`
// A unique identifier of the asset's monetary policy. The policy
// controls how assets of this kind are created and destroyed.
//
// The contents are the blake2b-224 hash of the monetary policy
// script, encoded in hexadecimal.
PolicyId string `json:"policy_id"`
// Number of assets for the given `policy_id` and `asset_name`.
Quantity int `json:"quantity"`
} `json:"assets,omitempty"`
} `json:"payments"`
}
// MigrateByronWalletJSONBody defines parameters for MigrateByronWallet.
type MigrateByronWalletJSONBody struct {
// The recipient addresses.
Addresses []string `json:"addresses"`
// The wallet's master passphrase.
Passphrase string `json:"passphrase"`
}
// PutByronWalletPassphraseJSONBody defines parameters for PutByronWalletPassphrase.
type PutByronWalletPassphraseJSONBody struct {
// A master passphrase to lock and protect the wallet for sensitive operation (e.g. sending funds).
NewPassphrase string `json:"new_passphrase"`
// The current passphrase if present.
OldPassphrase *string `json:"old_passphrase,omitempty"`
}
// PostByronTransactionFeeJSONBody defines parameters for PostByronTransactionFee.
type PostByronTransactionFeeJSONBody struct {
// A list of target outputs
Payments []struct {
Address string `json:"address"`
// Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead.
Amount struct {
Quantity int `json:"quantity"`
Unit string `json:"unit"`
} `json:"amount"`
// A flat list of assets.
Assets *[]struct {
// The asset on-chain type which acts as a sub-identifier within a
// policy. Although we call it "asset name", the value needn't be
// text, and it could even be empty.
//
// For policies with a single fungible asset item, asset name is
// typically an empty string.
//
// This value can be up to 32 bytes of arbitrary data (which is 64
// hexadecimal digits).
AssetName string `json:"asset_name"`
// A unique identifier of the asset's monetary policy. The policy
// controls how assets of this kind are created and destroyed.
//
// The contents are the blake2b-224 hash of the monetary policy
// script, encoded in hexadecimal.
PolicyId string `json:"policy_id"`
// Number of assets for the given `policy_id` and `asset_name`.
Quantity int `json:"quantity"`
} `json:"assets,omitempty"`
} `json:"payments"`
}
// ListByronTransactionsParams defines parameters for ListByronTransactions.
type ListByronTransactionsParams struct {
// An optional start time in ISO 8601 date-and-time format. Basic and
// extended formats are both accepted. Times can be local (with a
// timezone offset) or UTC.
//
// If both a start time and an end time are specified, then the start
// time must not be later than the end time.
//
// Example: `2008-08-08T08:08:08Z`
Start *string `json:"start,omitempty"`
// An optional end time in ISO 8601 date-and-time format. Basic and
// extended formats are both accepted. Times can be local (with a
// timezone offset) or UTC.
//
// If both a start time and an end time are specified, then the start
// time must not be later than the end time.
//
// Example: `2008-08-08T08:08:08Z`
End *string `json:"end,omitempty"`
// An optional sort order.
Order *string `json:"order,omitempty"`
}
// PostByronTransactionJSONBody defines parameters for PostByronTransaction.
type PostByronTransactionJSONBody struct {
// The wallet's master passphrase.
Passphrase string `json:"passphrase"`
// A list of target outputs
Payments []struct {
Address string `json:"address"`
// Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead.
Amount struct {
Quantity int `json:"quantity"`
Unit string `json:"unit"`
} `json:"amount"`
// A flat list of assets.
Assets *[]struct {
// The asset on-chain type which acts as a sub-identifier within a
// policy. Although we call it "asset name", the value needn't be
// text, and it could even be empty.
//
// For policies with a single fungible asset item, asset name is
// typically an empty string.
//
// This value can be up to 32 bytes of arbitrary data (which is 64
// hexadecimal digits).
AssetName string `json:"asset_name"`
// A unique identifier of the asset's monetary policy. The policy
// controls how assets of this kind are created and destroyed.
//
// The contents are the blake2b-224 hash of the monetary policy
// script, encoded in hexadecimal.
PolicyId string `json:"policy_id"`
// Number of assets for the given `policy_id` and `asset_name`.
Quantity int `json:"quantity"`
} `json:"assets,omitempty"`
} `json:"payments"`
}
// GetNetworkClockParams defines parameters for GetNetworkClock.
type GetNetworkClockParams struct {
// NTP checks are cached for short duration to avoid sending too many queries to the central NTP servers. In some cases however, a client may want to force a new check.
//
// When this flag is set, the request **will block** until NTP server responds or will timeout after a while without any answer from the NTP server.
ForceNtpCheck *bool `json:"forceNtpCheck,omitempty"`
}
// PutSettingsJSONBody defines parameters for PutSettings.
type PutSettingsJSONBody struct {
// Settings
Settings *struct {
// Select stake pool metadata fetching strategy:
// - `none` - metadata is not fetched at all,
// - `direct` - metadata is fetched directly URLs registered on chain,
// - `uri` - metadata is fetched from an external Stake-Pool Metadata Aggregation Server (SMASH)
//
// After update existing metadata will be dropped forcing it to re-sync automatically with the new setting.
PoolMetadataSource string `json:"pool_metadata_source"`
} `json:"settings,omitempty"`
}
// PostSharedWalletJSONBody defines parameters for PostSharedWallet.
type PostSharedWalletJSONBody interface{}
// PatchSharedWalletInDelegationJSONBody defines parameters for PatchSharedWalletInDelegation.
type PatchSharedWalletInDelegationJSONBody struct {
AdditionalProperties map[string]string `json:"-"`
}
// PatchSharedWalletInPaymentJSONBody defines parameters for PatchSharedWalletInPayment.
type PatchSharedWalletInPaymentJSONBody struct {
AdditionalProperties map[string]string `json:"-"`
}
// GetCurrentSmashHealthParams defines parameters for GetCurrentSmashHealth.
type GetCurrentSmashHealthParams struct {
// check this url for health instead of the currently configured one
Url *string `json:"url,omitempty"`
}
// ListStakePoolsParams defines parameters for ListStakePools.
type ListStakePoolsParams struct {
// The stake the user intends to delegate in Lovelace. Required.
Stake int `json:"stake"`
}
// QuitStakePoolJSONBody defines parameters for QuitStakePool.
type QuitStakePoolJSONBody struct {
// The source Byron wallet's master passphrase.
Passphrase string `json:"passphrase"`
}
// PostMaintenanceActionJSONBody defines parameters for PostMaintenanceAction.
type PostMaintenanceActionJSONBody struct {
MaintenanceAction string `json:"maintenance_action"`
}
// JoinStakePoolJSONBody defines parameters for JoinStakePool.
type JoinStakePoolJSONBody struct {
// The source Byron wallet's master passphrase.
Passphrase string `json:"passphrase"`
}
// PostWalletJSONBody defines parameters for PostWallet.
type PostWalletJSONBody interface{}
// PutWalletJSONBody defines parameters for PutWallet.
type PutWalletJSONBody struct {
Name *string `json:"name,omitempty"`
}
// ListAddressesParams defines parameters for ListAddresses.
type ListAddressesParams struct {
// An optional filter on the address state.
State *string `json:"state,omitempty"`
}
// SelectCoinsJSONBody defines parameters for SelectCoins.
type SelectCoinsJSONBody interface{}
// PostAccountKeyJSONBody defines parameters for PostAccountKey.
type PostAccountKeyJSONBody struct {
// Determines whether extended (with chain code) or normal (without chain code) key is requested
Extended bool `json:"extended"`
// A master passphrase to lock and protect the wallet for sensitive operation (e.g. sending funds)
Passphrase string `json:"passphrase"`
}
// MigrateShelleyWalletJSONBody defines parameters for MigrateShelleyWallet.
type MigrateShelleyWalletJSONBody struct {
// The recipient addresses.
Addresses []string `json:"addresses"`
// The wallet's master passphrase.
Passphrase string `json:"passphrase"`
}
// PutWalletPassphraseJSONBody defines parameters for PutWalletPassphrase.
type PutWalletPassphraseJSONBody struct {
// A master passphrase to lock and protect the wallet for sensitive operation (e.g. sending funds).
NewPassphrase string `json:"new_passphrase"`
// The current passphrase.
OldPassphrase string `json:"old_passphrase"`
}
// PostTransactionFeeJSONBody defines parameters for PostTransactionFee.
type PostTransactionFeeJSONBody interface{}
// SignMetadataJSONBody defines parameters for SignMetadata.
type SignMetadataJSONBody struct {
// **⚠️ WARNING ⚠️**
//
// _Please note that metadata provided in a transaction will be
// stored on the blockchain forever. Make sure not to include any sensitive data,
// in particular personally identifiable information (PII)._
//
// Extra application data attached to the transaction.
//
// Cardano allows users and developers to embed their own
// authenticated metadata when submitting transactions. Metadata can
// be expressed as a JSON object with some restrictions:
//
// 1. All top-level keys must be integers between `0` and `2^64 - 1`.
//
// 2. Each metadata value is tagged with its type.
//
// 3. Strings must be at most 64 bytes when UTF-8 encoded.
//
// 4. Bytestrings are hex-encoded, with a maximum length of 64 bytes.
//
// Metadata aren't stored as JSON on the Cardano blockchain but are
// instead stored using a compact binary encoding (CBOR).
//
// The binary encoding of metadata values supports three simple types:
//
// * Integers in the range `-(2^64 - 1)` to `2^64 - 1`
// * Strings (UTF-8 encoded)
// * Bytestrings
//
// And two compound types:
//
// * Lists of metadata values
// * Mappings from metadata values to metadata values
//
// It is possible to transform any JSON object into this schema.
//
// However, if your application uses floating point values, they will
// need to be converted somehow, according to your
// requirements. Likewise for `null` or `bool` values. When reading
// metadata from chain, be aware that integers may exceed the
// javascript numeric range, and may need special "bigint" parsing.
Metadata *SignMetadataJSONBody_Metadata `json:"metadata"`
// A master passphrase to lock and protect the wallet for sensitive operation (e.g. sending funds)
Passphrase string `json:"passphrase"`
}
// SignMetadataJSONBody_Metadata defines parameters for SignMetadata.
type SignMetadataJSONBody_Metadata struct {
AdditionalProperties map[string]TransactionMetadataValue `json:"-"`
}
// ListTransactionsParams defines parameters for ListTransactions.
type ListTransactionsParams struct {
// An optional start time in ISO 8601 date-and-time format. Basic and
// extended formats are both accepted. Times can be local (with a
// timezone offset) or UTC.
//
// If both a start time and an end time are specified, then the start
// time must not be later than the end time.
//
// Example: `2008-08-08T08:08:08Z`
Start *string `json:"start,omitempty"`
// An optional end time in ISO 8601 date-and-time format. Basic and
// extended formats are both accepted. Times can be local (with a
// timezone offset) or UTC.
//
// If both a start time and an end time are specified, then the start
// time must not be later than the end time.
//
// Example: `2008-08-08T08:08:08Z`
End *string `json:"end,omitempty"`
// An optional sort order.
Order *string `json:"order,omitempty"`
// Returns only transactions that have at least one withdrawal above the given amount.
// This is particularly useful when set to `1` in order to list the withdrawal history of a wallet.
MinWithdrawal *int `json:"minWithdrawal,omitempty"`
}
// PostTransactionJSONBody defines parameters for PostTransaction.
type PostTransactionJSONBody interface{}
// PostAnyAddressJSONRequestBody defines body for PostAnyAddress for application/json ContentType.
type PostAnyAddressJSONRequestBody PostAnyAddressJSONBody
// PostByronWalletJSONRequestBody defines body for PostByronWallet for application/json ContentType.
type PostByronWalletJSONRequestBody PostByronWalletJSONBody
// PutByronWalletJSONRequestBody defines body for PutByronWallet for application/json ContentType.
type PutByronWalletJSONRequestBody PutByronWalletJSONBody
// CreateAddressJSONRequestBody defines body for CreateAddress for application/json ContentType.
type CreateAddressJSONRequestBody CreateAddressJSONBody
// ImportAddressesJSONRequestBody defines body for ImportAddresses for application/json ContentType.
type ImportAddressesJSONRequestBody ImportAddressesJSONBody
// ByronSelectCoinsJSONRequestBody defines body for ByronSelectCoins for application/json ContentType.
type ByronSelectCoinsJSONRequestBody ByronSelectCoinsJSONBody
// MigrateByronWalletJSONRequestBody defines body for MigrateByronWallet for application/json ContentType.
type MigrateByronWalletJSONRequestBody MigrateByronWalletJSONBody
// PutByronWalletPassphraseJSONRequestBody defines body for PutByronWalletPassphrase for application/json ContentType.
type PutByronWalletPassphraseJSONRequestBody PutByronWalletPassphraseJSONBody
// PostByronTransactionFeeJSONRequestBody defines body for PostByronTransactionFee for application/json ContentType.
type PostByronTransactionFeeJSONRequestBody PostByronTransactionFeeJSONBody
// PostByronTransactionJSONRequestBody defines body for PostByronTransaction for application/json ContentType.
type PostByronTransactionJSONRequestBody PostByronTransactionJSONBody
// PutSettingsJSONRequestBody defines body for PutSettings for application/json ContentType.
type PutSettingsJSONRequestBody PutSettingsJSONBody
// PostSharedWalletJSONRequestBody defines body for PostSharedWallet for application/json ContentType.
type PostSharedWalletJSONRequestBody PostSharedWalletJSONBody
// PatchSharedWalletInDelegationJSONRequestBody defines body for PatchSharedWalletInDelegation for application/json ContentType.
type PatchSharedWalletInDelegationJSONRequestBody PatchSharedWalletInDelegationJSONBody
// PatchSharedWalletInPaymentJSONRequestBody defines body for PatchSharedWalletInPayment for application/json ContentType.
type PatchSharedWalletInPaymentJSONRequestBody PatchSharedWalletInPaymentJSONBody
// QuitStakePoolJSONRequestBody defines body for QuitStakePool for application/json ContentType.
type QuitStakePoolJSONRequestBody QuitStakePoolJSONBody
// PostMaintenanceActionJSONRequestBody defines body for PostMaintenanceAction for application/json ContentType.
type PostMaintenanceActionJSONRequestBody PostMaintenanceActionJSONBody
// JoinStakePoolJSONRequestBody defines body for JoinStakePool for application/json ContentType.
type JoinStakePoolJSONRequestBody JoinStakePoolJSONBody
// PostWalletJSONRequestBody defines body for PostWallet for application/json ContentType.
type PostWalletJSONRequestBody PostWalletJSONBody
// PutWalletJSONRequestBody defines body for PutWallet for application/json ContentType.
type PutWalletJSONRequestBody PutWalletJSONBody
// SelectCoinsJSONRequestBody defines body for SelectCoins for application/json ContentType.
type SelectCoinsJSONRequestBody SelectCoinsJSONBody
// PostAccountKeyJSONRequestBody defines body for PostAccountKey for application/json ContentType.
type PostAccountKeyJSONRequestBody PostAccountKeyJSONBody
// MigrateShelleyWalletJSONRequestBody defines body for MigrateShelleyWallet for application/json ContentType.
type MigrateShelleyWalletJSONRequestBody MigrateShelleyWalletJSONBody
// PutWalletPassphraseJSONRequestBody defines body for PutWalletPassphrase for application/json ContentType.
type PutWalletPassphraseJSONRequestBody PutWalletPassphraseJSONBody
// PostTransactionFeeJSONRequestBody defines body for PostTransactionFee for application/json ContentType.
type PostTransactionFeeJSONRequestBody PostTransactionFeeJSONBody
// SignMetadataJSONRequestBody defines body for SignMetadata for application/json ContentType.
type SignMetadataJSONRequestBody SignMetadataJSONBody
// PostTransactionJSONRequestBody defines body for PostTransaction for application/json ContentType.
type PostTransactionJSONRequestBody PostTransactionJSONBody
// Getter for additional properties for PatchSharedWalletInDelegationJSONBody. Returns the specified
// element and whether it was found
func (a PatchSharedWalletInDelegationJSONBody) Get(fieldName string) (value string, found bool) {
if a.AdditionalProperties != nil {
value, found = a.AdditionalProperties[fieldName]
}
return
}
// Setter for additional properties for PatchSharedWalletInDelegationJSONBody
func (a *PatchSharedWalletInDelegationJSONBody) Set(fieldName string, value string) {
if a.AdditionalProperties == nil {
a.AdditionalProperties = make(map[string]string)
}
a.AdditionalProperties[fieldName] = value
}
// Override default JSON handling for PatchSharedWalletInDelegationJSONBody to handle AdditionalProperties
func (a *PatchSharedWalletInDelegationJSONBody) UnmarshalJSON(b []byte) error {
object := make(map[string]json.RawMessage)
err := json.Unmarshal(b, &object)
if err != nil {
return err
}
if len(object) != 0 {
a.AdditionalProperties = make(map[string]string)
for fieldName, fieldBuf := range object {
var fieldVal string
err := json.Unmarshal(fieldBuf, &fieldVal)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("error unmarshaling field %s", fieldName))
}
a.AdditionalProperties[fieldName] = fieldVal
}
}
return nil
}
// Override default JSON handling for PatchSharedWalletInDelegationJSONBody to handle AdditionalProperties
func (a PatchSharedWalletInDelegationJSONBody) MarshalJSON() ([]byte, error) {
var err error
object := make(map[string]json.RawMessage)
for fieldName, field := range a.AdditionalProperties {
object[fieldName], err = json.Marshal(field)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("error marshaling '%s'", fieldName))
}
}
return json.Marshal(object)
}
// Getter for additional properties for PatchSharedWalletInPaymentJSONBody. Returns the specified
// element and whether it was found
func (a PatchSharedWalletInPaymentJSONBody) Get(fieldName string) (value string, found bool) {
if a.AdditionalProperties != nil {
value, found = a.AdditionalProperties[fieldName]
}
return
}
// Setter for additional properties for PatchSharedWalletInPaymentJSONBody
func (a *PatchSharedWalletInPaymentJSONBody) Set(fieldName string, value string) {
if a.AdditionalProperties == nil {
a.AdditionalProperties = make(map[string]string)
}
a.AdditionalProperties[fieldName] = value
}
// Override default JSON handling for PatchSharedWalletInPaymentJSONBody to handle AdditionalProperties
func (a *PatchSharedWalletInPaymentJSONBody) UnmarshalJSON(b []byte) error {
object := make(map[string]json.RawMessage)
err := json.Unmarshal(b, &object)
if err != nil {
return err
}
if len(object) != 0 {
a.AdditionalProperties = make(map[string]string)
for fieldName, fieldBuf := range object {
var fieldVal string
err := json.Unmarshal(fieldBuf, &fieldVal)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("error unmarshaling field %s", fieldName))
}
a.AdditionalProperties[fieldName] = fieldVal
}
}
return nil
}
// Override default JSON handling for PatchSharedWalletInPaymentJSONBody to handle AdditionalProperties
func (a PatchSharedWalletInPaymentJSONBody) MarshalJSON() ([]byte, error) {
var err error
object := make(map[string]json.RawMessage)
for fieldName, field := range a.AdditionalProperties {
object[fieldName], err = json.Marshal(field)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("error marshaling '%s'", fieldName))
}
}
return json.Marshal(object)
}
// Getter for additional properties for SignMetadataJSONBody_Metadata. Returns the specified
// element and whether it was found
func (a SignMetadataJSONBody_Metadata) Get(fieldName string) (value TransactionMetadataValue, found bool) {
if a.AdditionalProperties != nil {
value, found = a.AdditionalProperties[fieldName]
}
return
}
// Setter for additional properties for SignMetadataJSONBody_Metadata
func (a *SignMetadataJSONBody_Metadata) Set(fieldName string, value TransactionMetadataValue) {
if a.AdditionalProperties == nil {
a.AdditionalProperties = make(map[string]TransactionMetadataValue)
}
a.AdditionalProperties[fieldName] = value
}
// Override default JSON handling for SignMetadataJSONBody_Metadata to handle AdditionalProperties
func (a *SignMetadataJSONBody_Metadata) UnmarshalJSON(b []byte) error {
object := make(map[string]json.RawMessage)
err := json.Unmarshal(b, &object)
if err != nil {
return err
}
if len(object) != 0 {
a.AdditionalProperties = make(map[string]TransactionMetadataValue)
for fieldName, fieldBuf := range object {
var fieldVal TransactionMetadataValue
err := json.Unmarshal(fieldBuf, &fieldVal)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("error unmarshaling field %s", fieldName))
}
a.AdditionalProperties[fieldName] = fieldVal
}
}
return nil
}
// Override default JSON handling for SignMetadataJSONBody_Metadata to handle AdditionalProperties
func (a SignMetadataJSONBody_Metadata) MarshalJSON() ([]byte, error) {
var err error
object := make(map[string]json.RawMessage)
for fieldName, field := range a.AdditionalProperties {
object[fieldName], err = json.Marshal(field)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("error marshaling '%s'", fieldName))
}
}
return json.Marshal(object)
}