-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathapi_default_mock.go
More file actions
440 lines (376 loc) · 19 KB
/
Copy pathapi_default_mock.go
File metadata and controls
440 lines (376 loc) · 19 KB
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
/*
STACKIT MariaDB API
The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
API version: 2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package v2api
import (
"context"
"os"
)
// assert the implementation matches the interface
var _ DefaultAPI = &DefaultAPIServiceMock{}
// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService.
// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct.
type DefaultAPIServiceMock struct {
// CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock
CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error)
// CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock
CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error)
// CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock
CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error)
// DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock
DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error
// DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock
DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error
// DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock
DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error)
// GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock
GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error)
// GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock
GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error)
// GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock
GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error)
// ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock
ListBackupsExecuteMock *func(r ApiListBackupsRequest) ([]Backup, error)
// ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock
ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error)
// ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock
ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error)
// ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock
ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error)
// ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock
ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error)
// PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock
PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error
// TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock
TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error)
// TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock
TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error)
// TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock
TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error)
// UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock
UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error)
}
func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest {
return ApiCreateBackupRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) {
if a.CreateBackupExecuteMock == nil {
var localVarReturnValue []CreateBackupResponseItem
return localVarReturnValue, nil
}
return (*a.CreateBackupExecuteMock)(r)
}
func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest {
return ApiCreateCredentialsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) {
if a.CreateCredentialsExecuteMock == nil {
var localVarReturnValue *CredentialsResponse
return localVarReturnValue, nil
}
return (*a.CreateCredentialsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest {
return ApiCreateInstanceRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
}
}
// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) {
if a.CreateInstanceExecuteMock == nil {
var localVarReturnValue *CreateInstanceResponse
return localVarReturnValue, nil
}
return (*a.CreateInstanceExecuteMock)(r)
}
func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest {
return ApiDeleteCredentialsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
credentialsId: credentialsId,
}
}
// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error {
if a.DeleteCredentialsExecuteMock == nil {
return nil
}
return (*a.DeleteCredentialsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest {
return ApiDeleteInstanceRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error {
if a.DeleteInstanceExecuteMock == nil {
return nil
}
return (*a.DeleteInstanceExecuteMock)(r)
}
func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest {
return ApiDownloadBackupRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
backupId: backupId,
}
}
// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) {
if a.DownloadBackupExecuteMock == nil {
var localVarReturnValue *os.File
return localVarReturnValue, nil
}
return (*a.DownloadBackupExecuteMock)(r)
}
func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest {
return ApiGetCredentialsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
credentialsId: credentialsId,
}
}
// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) {
if a.GetCredentialsExecuteMock == nil {
var localVarReturnValue *CredentialsResponse
return localVarReturnValue, nil
}
return (*a.GetCredentialsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest {
return ApiGetInstanceRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) {
if a.GetInstanceExecuteMock == nil {
var localVarReturnValue *Instance
return localVarReturnValue, nil
}
return (*a.GetInstanceExecuteMock)(r)
}
func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest {
return ApiGetMetricsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) {
if a.GetMetricsExecuteMock == nil {
var localVarReturnValue *GetMetricsResponse
return localVarReturnValue, nil
}
return (*a.GetMetricsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest {
return ApiListBackupsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) ([]Backup, error) {
if a.ListBackupsExecuteMock == nil {
var localVarReturnValue []Backup
return localVarReturnValue, nil
}
return (*a.ListBackupsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest {
return ApiListCredentialsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) {
if a.ListCredentialsExecuteMock == nil {
var localVarReturnValue *ListCredentialsResponse
return localVarReturnValue, nil
}
return (*a.ListCredentialsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest {
return ApiListInstancesRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
}
}
// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) {
if a.ListInstancesExecuteMock == nil {
var localVarReturnValue *ListInstancesResponse
return localVarReturnValue, nil
}
return (*a.ListInstancesExecuteMock)(r)
}
func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest {
return ApiListOfferingsRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
}
}
// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) {
if a.ListOfferingsExecuteMock == nil {
var localVarReturnValue *ListOfferingsResponse
return localVarReturnValue, nil
}
return (*a.ListOfferingsExecuteMock)(r)
}
func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest {
return ApiListRestoresRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) {
if a.ListRestoresExecuteMock == nil {
var localVarReturnValue *ListRestoresResponse
return localVarReturnValue, nil
}
return (*a.ListRestoresExecuteMock)(r)
}
func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest {
return ApiPartialUpdateInstanceRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error {
if a.PartialUpdateInstanceExecuteMock == nil {
return nil
}
return (*a.PartialUpdateInstanceExecuteMock)(r)
}
func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest {
return ApiTriggerRecreateRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) {
if a.TriggerRecreateExecuteMock == nil {
var localVarReturnValue *CreateInstanceResponse
return localVarReturnValue, nil
}
return (*a.TriggerRecreateExecuteMock)(r)
}
func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest {
return ApiTriggerRestartRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) {
if a.TriggerRestartExecuteMock == nil {
var localVarReturnValue *CreateInstanceResponse
return localVarReturnValue, nil
}
return (*a.TriggerRestartExecuteMock)(r)
}
func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest {
return ApiTriggerRestoreRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
backupId: backupId,
}
}
// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) {
if a.TriggerRestoreExecuteMock == nil {
var localVarReturnValue *TriggerRestoreResponse
return localVarReturnValue, nil
}
return (*a.TriggerRestoreExecuteMock)(r)
}
func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest {
return ApiUpdateBackupsConfigRequest{
ApiService: a,
ctx: ctx,
projectId: projectId,
regionId: regionId,
instanceId: instanceId,
}
}
// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct.
func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) {
if a.UpdateBackupsConfigExecuteMock == nil {
var localVarReturnValue *UpdateBackupsConfigResponse
return localVarReturnValue, nil
}
return (*a.UpdateBackupsConfigExecuteMock)(r)
}