-
Notifications
You must be signed in to change notification settings - Fork 15
/
form3_public_api_client.go
308 lines (202 loc) · 9.03 KB
/
form3_public_api_client.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
// Code generated by go-swagger; DO NOT EDIT.
package client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
"github.com/form3tech-oss/go-form3/v6/pkg/client"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/a_c_e"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/account_amendment"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/account_identification"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/account_request"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/account_validation"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/accounts"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/audit"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/branch_identification"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/branches"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/claims"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/direct_debits"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/go_subscription_api"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/lhv_gateway"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/mandates"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/metrics_api"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/name_verification_api"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/oauth2"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/organisations"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/payments"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/platformsecurityapi"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/query_api"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/reports"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/roles"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/scheme_file_api"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/scheme_messages"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/subscriptions"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/transaction_file_api"
"github.com/form3tech-oss/go-form3/v6/pkg/generated/client/users"
)
// Default form3 public API HTTP client.
// var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "api.form3.tech"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/v1"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"https"}
/*
// NewHTTPClient creates a new form3 public API HTTP client.
func NewHTTPClient(formats strfmt.Registry) *Form3PublicAPI {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new form3 public API HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Form3PublicAPI {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
*/
// New creates a new form3 public API client
func New(transport runtime.ClientTransport, formats strfmt.Registry, defaults client.Defaults) *Form3PublicAPI {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(Form3PublicAPI)
cli.Transport = transport
cli.Ace = a_c_e.New(transport, formats, defaults)
cli.AccountAmendment = account_amendment.New(transport, formats, defaults)
cli.AccountIdentification = account_identification.New(transport, formats, defaults)
cli.AccountRequest = account_request.New(transport, formats, defaults)
cli.AccountValidation = account_validation.New(transport, formats, defaults)
cli.Accounts = accounts.New(transport, formats, defaults)
cli.Audit = audit.New(transport, formats, defaults)
cli.BranchIdentification = branch_identification.New(transport, formats, defaults)
cli.Branches = branches.New(transport, formats, defaults)
cli.Claims = claims.New(transport, formats, defaults)
cli.DirectDebits = direct_debits.New(transport, formats, defaults)
cli.GoSubscriptionAPI = go_subscription_api.New(transport, formats, defaults)
cli.LhvGateway = lhv_gateway.New(transport, formats, defaults)
cli.Mandates = mandates.New(transport, formats, defaults)
cli.MetricsAPI = metrics_api.New(transport, formats, defaults)
cli.NameVerificationAPI = name_verification_api.New(transport, formats, defaults)
cli.Oauth2 = oauth2.New(transport, formats, defaults)
cli.Organisations = organisations.New(transport, formats, defaults)
cli.Payments = payments.New(transport, formats, defaults)
cli.Platformsecurityapi = platformsecurityapi.New(transport, formats, defaults)
cli.QueryAPI = query_api.New(transport, formats, defaults)
cli.Reports = reports.New(transport, formats, defaults)
cli.Roles = roles.New(transport, formats, defaults)
cli.SchemeFileAPI = scheme_file_api.New(transport, formats, defaults)
cli.SchemeMessages = scheme_messages.New(transport, formats, defaults)
cli.Subscriptions = subscriptions.New(transport, formats, defaults)
cli.TransactionFileAPI = transaction_file_api.New(transport, formats, defaults)
cli.Users = users.New(transport, formats, defaults)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// Form3PublicAPI is a client for form3 public API
type Form3PublicAPI struct {
Ace *a_c_e.Client
AccountAmendment *account_amendment.Client
AccountIdentification *account_identification.Client
AccountRequest *account_request.Client
AccountValidation *account_validation.Client
Accounts *accounts.Client
Audit *audit.Client
BranchIdentification *branch_identification.Client
Branches *branches.Client
Claims *claims.Client
DirectDebits *direct_debits.Client
GoSubscriptionAPI *go_subscription_api.Client
LhvGateway *lhv_gateway.Client
Mandates *mandates.Client
MetricsAPI *metrics_api.Client
NameVerificationAPI *name_verification_api.Client
Oauth2 *oauth2.Client
Organisations *organisations.Client
Payments *payments.Client
Platformsecurityapi *platformsecurityapi.Client
QueryAPI *query_api.Client
Reports *reports.Client
Roles *roles.Client
SchemeFileAPI *scheme_file_api.Client
SchemeMessages *scheme_messages.Client
Subscriptions *subscriptions.Client
TransactionFileAPI *transaction_file_api.Client
Users *users.Client
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *Form3PublicAPI) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Ace.SetTransport(transport)
c.AccountAmendment.SetTransport(transport)
c.AccountIdentification.SetTransport(transport)
c.AccountRequest.SetTransport(transport)
c.AccountValidation.SetTransport(transport)
c.Accounts.SetTransport(transport)
c.Audit.SetTransport(transport)
c.BranchIdentification.SetTransport(transport)
c.Branches.SetTransport(transport)
c.Claims.SetTransport(transport)
c.DirectDebits.SetTransport(transport)
c.GoSubscriptionAPI.SetTransport(transport)
c.LhvGateway.SetTransport(transport)
c.Mandates.SetTransport(transport)
c.MetricsAPI.SetTransport(transport)
c.NameVerificationAPI.SetTransport(transport)
c.Oauth2.SetTransport(transport)
c.Organisations.SetTransport(transport)
c.Payments.SetTransport(transport)
c.Platformsecurityapi.SetTransport(transport)
c.QueryAPI.SetTransport(transport)
c.Reports.SetTransport(transport)
c.Roles.SetTransport(transport)
c.SchemeFileAPI.SetTransport(transport)
c.SchemeMessages.SetTransport(transport)
c.Subscriptions.SetTransport(transport)
c.TransactionFileAPI.SetTransport(transport)
c.Users.SetTransport(transport)
}