-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_currency.go
491 lines (469 loc) · 13 KB
/
model_currency.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
/*
finAPI Web Form 2.0
The following pages give you some general information on how to use our APIs.<br/>The actual API services documentation then follows further below. You can use the menu to jump between API sections.<br/><br/>This page has a built-in HTTP(S) client, so you can test the services directly from within this page, by filling in the request parameters and/or body in the respective services, and then hitting the TRY button. Note that you need to be authorized to make a successful API call. To authorize, refer to the '<a target='_blank' href='https://docs.finapi.io/?product=access#tag--Authorization'>Authorization</a>' section of Access, or in case you already have a valid user token, just use the QUICK AUTH on the left.<br/>Please also remember that all user management functions should be looked up in <a target='_blank' href='https://docs.finapi.io/?product=access'>Access</a>.<br/><br/>You should also check out the <a target='_blank' href='https://documentation.finapi.io/webform/'>Web Form 2.0 Public Documentation</a> as well as <a target='_blank' href='https://documentation.finapi.io/access/'>Access Public Documentation</a> for more information. If you need any help with the API, contact <a href='mailto:[email protected]'>[email protected]</a>.<br/><h2 id=\"general-information\">General information</h2><h3 id=\"general-request-ids\"><strong>Request IDs</strong></h3>With any API call, you can pass a request ID via a header with name \"X-Request-Id\". The request ID can be an arbitrary string with up to 255 characters. Passing a longer string will result in an error.<br/><br/>If you don't pass a request ID for a call, finAPI will generate a random ID internally.<br/><br/>The request ID is always returned back in the response of a service, as a header with name \"X-Request-Id\".<br/><br/>We highly recommend to always pass a (preferably unique) request ID, and include it into your client application logs whenever you make a request or receive a response(especially in the case of an error response). finAPI is also logging request IDs on its end. Having a request ID can help the finAPI support team to work more efficiently and solve tickets faster.<h3 id=\"type-coercion\"><strong>Type Coercion</strong></h3>In order to ease the integration for some languages, which do not natively support high precision number representations, Web Form 2.0 API supports relax type binding for the openAPI type <code>number</code>, which is used for money amount fields. If you use one of those languages, to avoid precision errors that can appear from <code>float</code> values, you can pass the amount as a <code>string</code>.<h3 id=\"general-faq\"><strong>FAQ</strong></h3><strong>Is there a finAPI SDK?</strong><br/>Currently we do not offer a native SDK, but there is the option to generate an SDKfor almost any target language via OpenAPI. Use the 'Download SDK' button on this page for SDK generation.<br/><br/><strong>Why do I need to keep authorizing when calling services on this page?</strong><br/>This page is a \"one-page-app\". Reloading the page resets the OAuth authorization context. There is generally no need to reload the page, so just don't do it and your authorization will persist.
API version: 2.430.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package webform2
import (
"encoding/json"
"fmt"
)
// Currency <strong>Currency:</strong> The <a target='_blank' href='https://www.iso.org/iso-4217-currency-codes.html'>ISO-4217</a> currency code of the amount.<br/>At the moment, the only possible currency we accept here is:<br/>• for direct debits, standalone payments and standing orders - <code>EUR</code> only;<br/>• for payments with account - the currency associated with the account (word of caution: we support only SEPA payments, hence for non-EUR accounts, payments will be submitted only on best effort basis).
type Currency string
// List of Currency
const (
CURRENCY_AED Currency = "AED"
CURRENCY_AFN Currency = "AFN"
CURRENCY_ALL Currency = "ALL"
CURRENCY_AMD Currency = "AMD"
CURRENCY_ANG Currency = "ANG"
CURRENCY_AOA Currency = "AOA"
CURRENCY_ARS Currency = "ARS"
CURRENCY_AUD Currency = "AUD"
CURRENCY_AWG Currency = "AWG"
CURRENCY_AZN Currency = "AZN"
CURRENCY_BAM Currency = "BAM"
CURRENCY_BBD Currency = "BBD"
CURRENCY_BDT Currency = "BDT"
CURRENCY_BGN Currency = "BGN"
CURRENCY_BHD Currency = "BHD"
CURRENCY_BIF Currency = "BIF"
CURRENCY_BMD Currency = "BMD"
CURRENCY_BND Currency = "BND"
CURRENCY_BOB Currency = "BOB"
CURRENCY_BOV Currency = "BOV"
CURRENCY_BRL Currency = "BRL"
CURRENCY_BSD Currency = "BSD"
CURRENCY_BTN Currency = "BTN"
CURRENCY_BWP Currency = "BWP"
CURRENCY_BYN Currency = "BYN"
CURRENCY_BZD Currency = "BZD"
CURRENCY_CAD Currency = "CAD"
CURRENCY_CDF Currency = "CDF"
CURRENCY_CHE Currency = "CHE"
CURRENCY_CHF Currency = "CHF"
CURRENCY_CHN Currency = "CHN"
CURRENCY_CHW Currency = "CHW"
CURRENCY_CLF Currency = "CLF"
CURRENCY_CLP Currency = "CLP"
CURRENCY_CNY Currency = "CNY"
CURRENCY_COP Currency = "COP"
CURRENCY_COU Currency = "COU"
CURRENCY_CRC Currency = "CRC"
CURRENCY_CUC Currency = "CUC"
CURRENCY_CUP Currency = "CUP"
CURRENCY_CVE Currency = "CVE"
CURRENCY_CZK Currency = "CZK"
CURRENCY_DJF Currency = "DJF"
CURRENCY_DKK Currency = "DKK"
CURRENCY_DOP Currency = "DOP"
CURRENCY_DZD Currency = "DZD"
CURRENCY_EGP Currency = "EGP"
CURRENCY_ERN Currency = "ERN"
CURRENCY_ETB Currency = "ETB"
CURRENCY_EUR Currency = "EUR"
CURRENCY_FJD Currency = "FJD"
CURRENCY_FKP Currency = "FKP"
CURRENCY_GBP Currency = "GBP"
CURRENCY_GEL Currency = "GEL"
CURRENCY_GGP Currency = "GGP"
CURRENCY_GHS Currency = "GHS"
CURRENCY_GIP Currency = "GIP"
CURRENCY_GMD Currency = "GMD"
CURRENCY_GNF Currency = "GNF"
CURRENCY_GTQ Currency = "GTQ"
CURRENCY_GYD Currency = "GYD"
CURRENCY_HKD Currency = "HKD"
CURRENCY_HNL Currency = "HNL"
CURRENCY_HRK Currency = "HRK"
CURRENCY_HTG Currency = "HTG"
CURRENCY_HUF Currency = "HUF"
CURRENCY_IDR Currency = "IDR"
CURRENCY_ILS Currency = "ILS"
CURRENCY_IMP Currency = "IMP"
CURRENCY_INR Currency = "INR"
CURRENCY_IQD Currency = "IQD"
CURRENCY_IRR Currency = "IRR"
CURRENCY_ISK Currency = "ISK"
CURRENCY_JEP Currency = "JEP"
CURRENCY_JMD Currency = "JMD"
CURRENCY_JOD Currency = "JOD"
CURRENCY_JPY Currency = "JPY"
CURRENCY_KES Currency = "KES"
CURRENCY_KGS Currency = "KGS"
CURRENCY_KHR Currency = "KHR"
CURRENCY_KID Currency = "KID"
CURRENCY_KMF Currency = "KMF"
CURRENCY_KPW Currency = "KPW"
CURRENCY_KRW Currency = "KRW"
CURRENCY_KWD Currency = "KWD"
CURRENCY_KYD Currency = "KYD"
CURRENCY_KZT Currency = "KZT"
CURRENCY_LAK Currency = "LAK"
CURRENCY_LBP Currency = "LBP"
CURRENCY_LKR Currency = "LKR"
CURRENCY_LRD Currency = "LRD"
CURRENCY_LSL Currency = "LSL"
CURRENCY_LYD Currency = "LYD"
CURRENCY_MAD Currency = "MAD"
CURRENCY_MDL Currency = "MDL"
CURRENCY_MGA Currency = "MGA"
CURRENCY_MKD Currency = "MKD"
CURRENCY_MMK Currency = "MMK"
CURRENCY_MNT Currency = "MNT"
CURRENCY_MOP Currency = "MOP"
CURRENCY_MRU Currency = "MRU"
CURRENCY_MUR Currency = "MUR"
CURRENCY_MVR Currency = "MVR"
CURRENCY_MWK Currency = "MWK"
CURRENCY_MXN Currency = "MXN"
CURRENCY_MXV Currency = "MXV"
CURRENCY_MYR Currency = "MYR"
CURRENCY_MZN Currency = "MZN"
CURRENCY_NAD Currency = "NAD"
CURRENCY_NGN Currency = "NGN"
CURRENCY_NIO Currency = "NIO"
CURRENCY_NIS Currency = "NIS"
CURRENCY_NOK Currency = "NOK"
CURRENCY_NPR Currency = "NPR"
CURRENCY_NTD Currency = "NTD"
CURRENCY_NZD Currency = "NZD"
CURRENCY_OMR Currency = "OMR"
CURRENCY_PAB Currency = "PAB"
CURRENCY_PEN Currency = "PEN"
CURRENCY_PGK Currency = "PGK"
CURRENCY_PHP Currency = "PHP"
CURRENCY_PKR Currency = "PKR"
CURRENCY_PLN Currency = "PLN"
CURRENCY_PRB Currency = "PRB"
CURRENCY_PYG Currency = "PYG"
CURRENCY_QAR Currency = "QAR"
CURRENCY_RMB Currency = "RMB"
CURRENCY_RON Currency = "RON"
CURRENCY_RSD Currency = "RSD"
CURRENCY_RUB Currency = "RUB"
CURRENCY_RWF Currency = "RWF"
CURRENCY_SAR Currency = "SAR"
CURRENCY_SBD Currency = "SBD"
CURRENCY_SCR Currency = "SCR"
CURRENCY_SDG Currency = "SDG"
CURRENCY_SEK Currency = "SEK"
CURRENCY_SGD Currency = "SGD"
CURRENCY_SHP Currency = "SHP"
CURRENCY_SLL Currency = "SLL"
CURRENCY_SLS Currency = "SLS"
CURRENCY_SOS Currency = "SOS"
CURRENCY_SRD Currency = "SRD"
CURRENCY_SSP Currency = "SSP"
CURRENCY_STN Currency = "STN"
CURRENCY_SVC Currency = "SVC"
CURRENCY_SYP Currency = "SYP"
CURRENCY_SZL Currency = "SZL"
CURRENCY_THB Currency = "THB"
CURRENCY_TJS Currency = "TJS"
CURRENCY_TMT Currency = "TMT"
CURRENCY_TND Currency = "TND"
CURRENCY_TOP Currency = "TOP"
CURRENCY_TRY Currency = "TRY"
CURRENCY_TTD Currency = "TTD"
CURRENCY_TVD Currency = "TVD"
CURRENCY_TWD Currency = "TWD"
CURRENCY_TZS Currency = "TZS"
CURRENCY_UAH Currency = "UAH"
CURRENCY_UGX Currency = "UGX"
CURRENCY_USD Currency = "USD"
CURRENCY_USN Currency = "USN"
CURRENCY_UYI Currency = "UYI"
CURRENCY_UYU Currency = "UYU"
CURRENCY_UYW Currency = "UYW"
CURRENCY_UZS Currency = "UZS"
CURRENCY_VEF Currency = "VEF"
CURRENCY_VES Currency = "VES"
CURRENCY_VND Currency = "VND"
CURRENCY_VUV Currency = "VUV"
CURRENCY_WST Currency = "WST"
CURRENCY_XAF Currency = "XAF"
CURRENCY_XAG Currency = "XAG"
CURRENCY_XAU Currency = "XAU"
CURRENCY_XBA Currency = "XBA"
CURRENCY_XBB Currency = "XBB"
CURRENCY_XBC Currency = "XBC"
CURRENCY_XBD Currency = "XBD"
CURRENCY_XCD Currency = "XCD"
CURRENCY_XDR Currency = "XDR"
CURRENCY_XOF Currency = "XOF"
CURRENCY_XPD Currency = "XPD"
CURRENCY_XPF Currency = "XPF"
CURRENCY_XPT Currency = "XPT"
CURRENCY_XSU Currency = "XSU"
CURRENCY_XTS Currency = "XTS"
CURRENCY_XUA Currency = "XUA"
CURRENCY_XXX Currency = "XXX"
CURRENCY_YER Currency = "YER"
CURRENCY_ZAR Currency = "ZAR"
CURRENCY_ZMW Currency = "ZMW"
CURRENCY_ZWB Currency = "ZWB"
CURRENCY_ZWL Currency = "ZWL"
)
// All allowed values of Currency enum
var AllowedCurrencyEnumValues = []Currency{
"AED",
"AFN",
"ALL",
"AMD",
"ANG",
"AOA",
"ARS",
"AUD",
"AWG",
"AZN",
"BAM",
"BBD",
"BDT",
"BGN",
"BHD",
"BIF",
"BMD",
"BND",
"BOB",
"BOV",
"BRL",
"BSD",
"BTN",
"BWP",
"BYN",
"BZD",
"CAD",
"CDF",
"CHE",
"CHF",
"CHN",
"CHW",
"CLF",
"CLP",
"CNY",
"COP",
"COU",
"CRC",
"CUC",
"CUP",
"CVE",
"CZK",
"DJF",
"DKK",
"DOP",
"DZD",
"EGP",
"ERN",
"ETB",
"EUR",
"FJD",
"FKP",
"GBP",
"GEL",
"GGP",
"GHS",
"GIP",
"GMD",
"GNF",
"GTQ",
"GYD",
"HKD",
"HNL",
"HRK",
"HTG",
"HUF",
"IDR",
"ILS",
"IMP",
"INR",
"IQD",
"IRR",
"ISK",
"JEP",
"JMD",
"JOD",
"JPY",
"KES",
"KGS",
"KHR",
"KID",
"KMF",
"KPW",
"KRW",
"KWD",
"KYD",
"KZT",
"LAK",
"LBP",
"LKR",
"LRD",
"LSL",
"LYD",
"MAD",
"MDL",
"MGA",
"MKD",
"MMK",
"MNT",
"MOP",
"MRU",
"MUR",
"MVR",
"MWK",
"MXN",
"MXV",
"MYR",
"MZN",
"NAD",
"NGN",
"NIO",
"NIS",
"NOK",
"NPR",
"NTD",
"NZD",
"OMR",
"PAB",
"PEN",
"PGK",
"PHP",
"PKR",
"PLN",
"PRB",
"PYG",
"QAR",
"RMB",
"RON",
"RSD",
"RUB",
"RWF",
"SAR",
"SBD",
"SCR",
"SDG",
"SEK",
"SGD",
"SHP",
"SLL",
"SLS",
"SOS",
"SRD",
"SSP",
"STN",
"SVC",
"SYP",
"SZL",
"THB",
"TJS",
"TMT",
"TND",
"TOP",
"TRY",
"TTD",
"TVD",
"TWD",
"TZS",
"UAH",
"UGX",
"USD",
"USN",
"UYI",
"UYU",
"UYW",
"UZS",
"VEF",
"VES",
"VND",
"VUV",
"WST",
"XAF",
"XAG",
"XAU",
"XBA",
"XBB",
"XBC",
"XBD",
"XCD",
"XDR",
"XOF",
"XPD",
"XPF",
"XPT",
"XSU",
"XTS",
"XUA",
"XXX",
"YER",
"ZAR",
"ZMW",
"ZWB",
"ZWL",
}
func (v *Currency) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := Currency(value)
for _, existing := range AllowedCurrencyEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid Currency", value)
}
// NewCurrencyFromValue returns a pointer to a valid Currency
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewCurrencyFromValue(v string) (*Currency, error) {
ev := Currency(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for Currency: valid values are %v", v, AllowedCurrencyEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v Currency) IsValid() bool {
for _, existing := range AllowedCurrencyEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to Currency value
func (v Currency) Ptr() *Currency {
return &v
}
type NullableCurrency struct {
value *Currency
isSet bool
}
func (v NullableCurrency) Get() *Currency {
return v.value
}
func (v *NullableCurrency) Set(val *Currency) {
v.value = val
v.isSet = true
}
func (v NullableCurrency) IsSet() bool {
return v.isSet
}
func (v *NullableCurrency) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCurrency(val *Currency) *NullableCurrency {
return &NullableCurrency{value: val, isSet: true}
}
func (v NullableCurrency) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCurrency) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}