-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbank_lookup.go
101 lines (84 loc) · 2.43 KB
/
bank_lookup.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
// This file was auto-generated by Fern from our API Definition.
package mercoa
import (
json "encoding/json"
fmt "fmt"
core "github.com/mercoa-finance/go/core"
)
type BankLookupRequest struct {
// Routing number to validate
RoutingNumber string `json:"-" url:"routingNumber"`
}
type BankAddress struct {
Address string `json:"address" url:"address"`
City string `json:"city" url:"city"`
State string `json:"state" url:"state"`
PostalCode string `json:"postalCode" url:"postalCode"`
PostalCodeExtension string `json:"postalCodeExtension" url:"postalCodeExtension"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (b *BankAddress) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BankAddress) UnmarshalJSON(data []byte) error {
type unmarshaler BankAddress
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BankAddress(value)
extraProperties, err := core.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BankAddress) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BankLookupResponse struct {
BankName string `json:"bankName" url:"bankName"`
BankAddress *BankAddress `json:"bankAddress,omitempty" url:"bankAddress,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (b *BankLookupResponse) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BankLookupResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BankLookupResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BankLookupResponse(value)
extraProperties, err := core.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BankLookupResponse) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}