-
Notifications
You must be signed in to change notification settings - Fork 28
/
api_general.go
255 lines (209 loc) · 8.3 KB
/
api_general.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
/*
POS Terminal Management API
API version: 1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package posterminalmanagement
import (
"context"
"net/http"
"net/url"
"github.com/adyen/adyen-go-api-library/v7/src/common"
)
// GeneralApi service
type GeneralApi common.Service
// All parameters accepted by GeneralApi.AssignTerminals
type GeneralApiAssignTerminalsInput struct {
assignTerminalsRequest *AssignTerminalsRequest
}
func (r GeneralApiAssignTerminalsInput) AssignTerminalsRequest(assignTerminalsRequest AssignTerminalsRequest) GeneralApiAssignTerminalsInput {
r.assignTerminalsRequest = &assignTerminalsRequest
return r
}
/*
Prepare a request for AssignTerminals
@return GeneralApiAssignTerminalsInput
*/
func (a *GeneralApi) AssignTerminalsInput() GeneralApiAssignTerminalsInput {
return GeneralApiAssignTerminalsInput{}
}
/*
AssignTerminals Assign terminals
Assigns one or more payment terminals to a merchant account or a store. You can also use this endpoint to reassign terminals between merchant accounts or stores, and to unassign a terminal and return it to company inventory.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param r GeneralApiAssignTerminalsInput - Request parameters, see AssignTerminalsInput
@return AssignTerminalsResponse, *http.Response, error
*/
func (a *GeneralApi) AssignTerminals(ctx context.Context, r GeneralApiAssignTerminalsInput) (AssignTerminalsResponse, *http.Response, error) {
res := &AssignTerminalsResponse{}
path := "/assignTerminals"
queryParams := url.Values{}
headerParams := make(map[string]string)
httpRes, err := common.SendAPIRequest(
ctx,
a.Client,
r.assignTerminalsRequest,
res,
http.MethodPost,
a.BasePath()+path,
queryParams,
headerParams,
)
return *res, httpRes, err
}
// All parameters accepted by GeneralApi.FindTerminal
type GeneralApiFindTerminalInput struct {
findTerminalRequest *FindTerminalRequest
}
func (r GeneralApiFindTerminalInput) FindTerminalRequest(findTerminalRequest FindTerminalRequest) GeneralApiFindTerminalInput {
r.findTerminalRequest = &findTerminalRequest
return r
}
/*
Prepare a request for FindTerminal
@return GeneralApiFindTerminalInput
*/
func (a *GeneralApi) FindTerminalInput() GeneralApiFindTerminalInput {
return GeneralApiFindTerminalInput{}
}
/*
FindTerminal Get the account or store of a terminal
Returns the company account, merchant account, or store that a payment terminal is assigned to.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param r GeneralApiFindTerminalInput - Request parameters, see FindTerminalInput
@return FindTerminalResponse, *http.Response, error
*/
func (a *GeneralApi) FindTerminal(ctx context.Context, r GeneralApiFindTerminalInput) (FindTerminalResponse, *http.Response, error) {
res := &FindTerminalResponse{}
path := "/findTerminal"
queryParams := url.Values{}
headerParams := make(map[string]string)
httpRes, err := common.SendAPIRequest(
ctx,
a.Client,
r.findTerminalRequest,
res,
http.MethodPost,
a.BasePath()+path,
queryParams,
headerParams,
)
return *res, httpRes, err
}
// All parameters accepted by GeneralApi.GetStoresUnderAccount
type GeneralApiGetStoresUnderAccountInput struct {
getStoresUnderAccountRequest *GetStoresUnderAccountRequest
}
func (r GeneralApiGetStoresUnderAccountInput) GetStoresUnderAccountRequest(getStoresUnderAccountRequest GetStoresUnderAccountRequest) GeneralApiGetStoresUnderAccountInput {
r.getStoresUnderAccountRequest = &getStoresUnderAccountRequest
return r
}
/*
Prepare a request for GetStoresUnderAccount
@return GeneralApiGetStoresUnderAccountInput
*/
func (a *GeneralApi) GetStoresUnderAccountInput() GeneralApiGetStoresUnderAccountInput {
return GeneralApiGetStoresUnderAccountInput{}
}
/*
GetStoresUnderAccount Get the stores of an account
Returns a list of stores associated with a company account or a merchant account, including the status of each store.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param r GeneralApiGetStoresUnderAccountInput - Request parameters, see GetStoresUnderAccountInput
@return GetStoresUnderAccountResponse, *http.Response, error
*/
func (a *GeneralApi) GetStoresUnderAccount(ctx context.Context, r GeneralApiGetStoresUnderAccountInput) (GetStoresUnderAccountResponse, *http.Response, error) {
res := &GetStoresUnderAccountResponse{}
path := "/getStoresUnderAccount"
queryParams := url.Values{}
headerParams := make(map[string]string)
httpRes, err := common.SendAPIRequest(
ctx,
a.Client,
r.getStoresUnderAccountRequest,
res,
http.MethodPost,
a.BasePath()+path,
queryParams,
headerParams,
)
return *res, httpRes, err
}
// All parameters accepted by GeneralApi.GetTerminalDetails
type GeneralApiGetTerminalDetailsInput struct {
getTerminalDetailsRequest *GetTerminalDetailsRequest
}
func (r GeneralApiGetTerminalDetailsInput) GetTerminalDetailsRequest(getTerminalDetailsRequest GetTerminalDetailsRequest) GeneralApiGetTerminalDetailsInput {
r.getTerminalDetailsRequest = &getTerminalDetailsRequest
return r
}
/*
Prepare a request for GetTerminalDetails
@return GeneralApiGetTerminalDetailsInput
*/
func (a *GeneralApi) GetTerminalDetailsInput() GeneralApiGetTerminalDetailsInput {
return GeneralApiGetTerminalDetailsInput{}
}
/*
GetTerminalDetails Get the details of a terminal
Returns the details of a payment terminal, including where the terminal is assigned to. The response returns the same details that are provided in the terminal list in your Customer Area and in the Terminal Fleet report.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param r GeneralApiGetTerminalDetailsInput - Request parameters, see GetTerminalDetailsInput
@return GetTerminalDetailsResponse, *http.Response, error
*/
func (a *GeneralApi) GetTerminalDetails(ctx context.Context, r GeneralApiGetTerminalDetailsInput) (GetTerminalDetailsResponse, *http.Response, error) {
res := &GetTerminalDetailsResponse{}
path := "/getTerminalDetails"
queryParams := url.Values{}
headerParams := make(map[string]string)
httpRes, err := common.SendAPIRequest(
ctx,
a.Client,
r.getTerminalDetailsRequest,
res,
http.MethodPost,
a.BasePath()+path,
queryParams,
headerParams,
)
return *res, httpRes, err
}
// All parameters accepted by GeneralApi.GetTerminalsUnderAccount
type GeneralApiGetTerminalsUnderAccountInput struct {
getTerminalsUnderAccountRequest *GetTerminalsUnderAccountRequest
}
func (r GeneralApiGetTerminalsUnderAccountInput) GetTerminalsUnderAccountRequest(getTerminalsUnderAccountRequest GetTerminalsUnderAccountRequest) GeneralApiGetTerminalsUnderAccountInput {
r.getTerminalsUnderAccountRequest = &getTerminalsUnderAccountRequest
return r
}
/*
Prepare a request for GetTerminalsUnderAccount
@return GeneralApiGetTerminalsUnderAccountInput
*/
func (a *GeneralApi) GetTerminalsUnderAccountInput() GeneralApiGetTerminalsUnderAccountInput {
return GeneralApiGetTerminalsUnderAccountInput{}
}
/*
GetTerminalsUnderAccount Get the list of terminals
Returns a list of payment terminals associated with a company account, merchant account, or store. The response shows whether the terminals are in the inventory, or in-store (ready for boarding or already boarded).
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param r GeneralApiGetTerminalsUnderAccountInput - Request parameters, see GetTerminalsUnderAccountInput
@return GetTerminalsUnderAccountResponse, *http.Response, error
*/
func (a *GeneralApi) GetTerminalsUnderAccount(ctx context.Context, r GeneralApiGetTerminalsUnderAccountInput) (GetTerminalsUnderAccountResponse, *http.Response, error) {
res := &GetTerminalsUnderAccountResponse{}
path := "/getTerminalsUnderAccount"
queryParams := url.Values{}
headerParams := make(map[string]string)
httpRes, err := common.SendAPIRequest(
ctx,
a.Client,
r.getTerminalsUnderAccountRequest,
res,
http.MethodPost,
a.BasePath()+path,
queryParams,
headerParams,
)
return *res, httpRes, err
}