Skip to content

Commit 6e2cd9e

Browse files
authored
CLOUDP-222817: make execute methods mockable (#262)
1 parent 1651e1d commit 6e2cd9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1365
-1365
lines changed

admin/api_access_tracking.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type AccessTrackingApi interface {
3434
*/
3535
ListAccessLogsByClusterNameWithParams(ctx context.Context, args *ListAccessLogsByClusterNameApiParams) ListAccessLogsByClusterNameApiRequest
3636

37-
// Interface only available internally
38-
listAccessLogsByClusterNameExecute(r ListAccessLogsByClusterNameApiRequest) (*MongoDBAccessLogsList, *http.Response, error)
37+
// Method available only for mocking purposes
38+
ListAccessLogsByClusterNameExecute(r ListAccessLogsByClusterNameApiRequest) (*MongoDBAccessLogsList, *http.Response, error)
3939

4040
/*
4141
ListAccessLogsByHostname Return Database Access History for One Cluster using Its Hostname
@@ -58,8 +58,8 @@ type AccessTrackingApi interface {
5858
*/
5959
ListAccessLogsByHostnameWithParams(ctx context.Context, args *ListAccessLogsByHostnameApiParams) ListAccessLogsByHostnameApiRequest
6060

61-
// Interface only available internally
62-
listAccessLogsByHostnameExecute(r ListAccessLogsByHostnameApiRequest) (*MongoDBAccessLogsList, *http.Response, error)
61+
// Method available only for mocking purposes
62+
ListAccessLogsByHostnameExecute(r ListAccessLogsByHostnameApiRequest) (*MongoDBAccessLogsList, *http.Response, error)
6363
}
6464

6565
// AccessTrackingApiService AccessTrackingApi service
@@ -132,7 +132,7 @@ func (r ListAccessLogsByClusterNameApiRequest) Start(start int64) ListAccessLogs
132132
}
133133

134134
func (r ListAccessLogsByClusterNameApiRequest) Execute() (*MongoDBAccessLogsList, *http.Response, error) {
135-
return r.ApiService.listAccessLogsByClusterNameExecute(r)
135+
return r.ApiService.ListAccessLogsByClusterNameExecute(r)
136136
}
137137

138138
/*
@@ -157,7 +157,7 @@ func (a *AccessTrackingApiService) ListAccessLogsByClusterName(ctx context.Conte
157157
// Execute executes the request
158158
//
159159
// @return MongoDBAccessLogsList
160-
func (a *AccessTrackingApiService) listAccessLogsByClusterNameExecute(r ListAccessLogsByClusterNameApiRequest) (*MongoDBAccessLogsList, *http.Response, error) {
160+
func (a *AccessTrackingApiService) ListAccessLogsByClusterNameExecute(r ListAccessLogsByClusterNameApiRequest) (*MongoDBAccessLogsList, *http.Response, error) {
161161
var (
162162
localVarHTTPMethod = http.MethodGet
163163
localVarPostBody interface{}
@@ -326,7 +326,7 @@ func (r ListAccessLogsByHostnameApiRequest) Start(start int64) ListAccessLogsByH
326326
}
327327

328328
func (r ListAccessLogsByHostnameApiRequest) Execute() (*MongoDBAccessLogsList, *http.Response, error) {
329-
return r.ApiService.listAccessLogsByHostnameExecute(r)
329+
return r.ApiService.ListAccessLogsByHostnameExecute(r)
330330
}
331331

332332
/*
@@ -351,7 +351,7 @@ func (a *AccessTrackingApiService) ListAccessLogsByHostname(ctx context.Context,
351351
// Execute executes the request
352352
//
353353
// @return MongoDBAccessLogsList
354-
func (a *AccessTrackingApiService) listAccessLogsByHostnameExecute(r ListAccessLogsByHostnameApiRequest) (*MongoDBAccessLogsList, *http.Response, error) {
354+
func (a *AccessTrackingApiService) ListAccessLogsByHostnameExecute(r ListAccessLogsByHostnameApiRequest) (*MongoDBAccessLogsList, *http.Response, error) {
355355
var (
356356
localVarHTTPMethod = http.MethodGet
357357
localVarPostBody interface{}

admin/api_alert_configurations.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ type AlertConfigurationsApi interface {
3535
*/
3636
CreateAlertConfigurationWithParams(ctx context.Context, args *CreateAlertConfigurationApiParams) CreateAlertConfigurationApiRequest
3737

38-
// Interface only available internally
39-
createAlertConfigurationExecute(r CreateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
38+
// Method available only for mocking purposes
39+
CreateAlertConfigurationExecute(r CreateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
4040

4141
/*
4242
DeleteAlertConfiguration Remove One Alert Configuration from One Project
@@ -61,8 +61,8 @@ type AlertConfigurationsApi interface {
6161
*/
6262
DeleteAlertConfigurationWithParams(ctx context.Context, args *DeleteAlertConfigurationApiParams) DeleteAlertConfigurationApiRequest
6363

64-
// Interface only available internally
65-
deleteAlertConfigurationExecute(r DeleteAlertConfigurationApiRequest) (*http.Response, error)
64+
// Method available only for mocking purposes
65+
DeleteAlertConfigurationExecute(r DeleteAlertConfigurationApiRequest) (*http.Response, error)
6666

6767
/*
6868
GetAlertConfiguration Return One Alert Configuration from One Project
@@ -87,8 +87,8 @@ type AlertConfigurationsApi interface {
8787
*/
8888
GetAlertConfigurationWithParams(ctx context.Context, args *GetAlertConfigurationApiParams) GetAlertConfigurationApiRequest
8989

90-
// Interface only available internally
91-
getAlertConfigurationExecute(r GetAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
90+
// Method available only for mocking purposes
91+
GetAlertConfigurationExecute(r GetAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
9292

9393
/*
9494
ListAlertConfigurationMatchersFieldNames Get All Alert Configuration Matchers Field Names
@@ -109,8 +109,8 @@ type AlertConfigurationsApi interface {
109109
*/
110110
ListAlertConfigurationMatchersFieldNamesWithParams(ctx context.Context, args *ListAlertConfigurationMatchersFieldNamesApiParams) ListAlertConfigurationMatchersFieldNamesApiRequest
111111

112-
// Interface only available internally
113-
listAlertConfigurationMatchersFieldNamesExecute(r ListAlertConfigurationMatchersFieldNamesApiRequest) ([]string, *http.Response, error)
112+
// Method available only for mocking purposes
113+
ListAlertConfigurationMatchersFieldNamesExecute(r ListAlertConfigurationMatchersFieldNamesApiRequest) ([]string, *http.Response, error)
114114

115115
/*
116116
ListAlertConfigurations Return All Alert Configurations for One Project
@@ -134,8 +134,8 @@ type AlertConfigurationsApi interface {
134134
*/
135135
ListAlertConfigurationsWithParams(ctx context.Context, args *ListAlertConfigurationsApiParams) ListAlertConfigurationsApiRequest
136136

137-
// Interface only available internally
138-
listAlertConfigurationsExecute(r ListAlertConfigurationsApiRequest) (*PaginatedAlertConfig, *http.Response, error)
137+
// Method available only for mocking purposes
138+
ListAlertConfigurationsExecute(r ListAlertConfigurationsApiRequest) (*PaginatedAlertConfig, *http.Response, error)
139139

140140
/*
141141
ListAlertConfigurationsByAlertId Return All Alert Configurations Set for One Alert
@@ -160,8 +160,8 @@ type AlertConfigurationsApi interface {
160160
*/
161161
ListAlertConfigurationsByAlertIdWithParams(ctx context.Context, args *ListAlertConfigurationsByAlertIdApiParams) ListAlertConfigurationsByAlertIdApiRequest
162162

163-
// Interface only available internally
164-
listAlertConfigurationsByAlertIdExecute(r ListAlertConfigurationsByAlertIdApiRequest) (*PaginatedAlertConfig, *http.Response, error)
163+
// Method available only for mocking purposes
164+
ListAlertConfigurationsByAlertIdExecute(r ListAlertConfigurationsByAlertIdApiRequest) (*PaginatedAlertConfig, *http.Response, error)
165165

166166
/*
167167
ToggleAlertConfiguration Toggle One State of One Alert Configuration in One Project
@@ -188,8 +188,8 @@ type AlertConfigurationsApi interface {
188188
*/
189189
ToggleAlertConfigurationWithParams(ctx context.Context, args *ToggleAlertConfigurationApiParams) ToggleAlertConfigurationApiRequest
190190

191-
// Interface only available internally
192-
toggleAlertConfigurationExecute(r ToggleAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
191+
// Method available only for mocking purposes
192+
ToggleAlertConfigurationExecute(r ToggleAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
193193

194194
/*
195195
UpdateAlertConfiguration Update One Alert Configuration for One Project
@@ -216,8 +216,8 @@ type AlertConfigurationsApi interface {
216216
*/
217217
UpdateAlertConfigurationWithParams(ctx context.Context, args *UpdateAlertConfigurationApiParams) UpdateAlertConfigurationApiRequest
218218

219-
// Interface only available internally
220-
updateAlertConfigurationExecute(r UpdateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
219+
// Method available only for mocking purposes
220+
UpdateAlertConfigurationExecute(r UpdateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error)
221221
}
222222

223223
// AlertConfigurationsApiService AlertConfigurationsApi service
@@ -245,7 +245,7 @@ func (a *AlertConfigurationsApiService) CreateAlertConfigurationWithParams(ctx c
245245
}
246246

247247
func (r CreateAlertConfigurationApiRequest) Execute() (*GroupAlertsConfig, *http.Response, error) {
248-
return r.ApiService.createAlertConfigurationExecute(r)
248+
return r.ApiService.CreateAlertConfigurationExecute(r)
249249
}
250250

251251
/*
@@ -271,7 +271,7 @@ func (a *AlertConfigurationsApiService) CreateAlertConfiguration(ctx context.Con
271271
// Execute executes the request
272272
//
273273
// @return GroupAlertsConfig
274-
func (a *AlertConfigurationsApiService) createAlertConfigurationExecute(r CreateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
274+
func (a *AlertConfigurationsApiService) CreateAlertConfigurationExecute(r CreateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
275275
var (
276276
localVarHTTPMethod = http.MethodPost
277277
localVarPostBody interface{}
@@ -380,7 +380,7 @@ func (a *AlertConfigurationsApiService) DeleteAlertConfigurationWithParams(ctx c
380380
}
381381

382382
func (r DeleteAlertConfigurationApiRequest) Execute() (*http.Response, error) {
383-
return r.ApiService.deleteAlertConfigurationExecute(r)
383+
return r.ApiService.DeleteAlertConfigurationExecute(r)
384384
}
385385

386386
/*
@@ -405,7 +405,7 @@ func (a *AlertConfigurationsApiService) DeleteAlertConfiguration(ctx context.Con
405405
}
406406

407407
// Execute executes the request
408-
func (a *AlertConfigurationsApiService) deleteAlertConfigurationExecute(r DeleteAlertConfigurationApiRequest) (*http.Response, error) {
408+
func (a *AlertConfigurationsApiService) DeleteAlertConfigurationExecute(r DeleteAlertConfigurationApiRequest) (*http.Response, error) {
409409
var (
410410
localVarHTTPMethod = http.MethodDelete
411411
localVarPostBody interface{}
@@ -500,7 +500,7 @@ func (a *AlertConfigurationsApiService) GetAlertConfigurationWithParams(ctx cont
500500
}
501501

502502
func (r GetAlertConfigurationApiRequest) Execute() (*GroupAlertsConfig, *http.Response, error) {
503-
return r.ApiService.getAlertConfigurationExecute(r)
503+
return r.ApiService.GetAlertConfigurationExecute(r)
504504
}
505505

506506
/*
@@ -527,7 +527,7 @@ func (a *AlertConfigurationsApiService) GetAlertConfiguration(ctx context.Contex
527527
// Execute executes the request
528528
//
529529
// @return GroupAlertsConfig
530-
func (a *AlertConfigurationsApiService) getAlertConfigurationExecute(r GetAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
530+
func (a *AlertConfigurationsApiService) GetAlertConfigurationExecute(r GetAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
531531
var (
532532
localVarHTTPMethod = http.MethodGet
533533
localVarPostBody interface{}
@@ -626,7 +626,7 @@ func (a *AlertConfigurationsApiService) ListAlertConfigurationMatchersFieldNames
626626
}
627627

628628
func (r ListAlertConfigurationMatchersFieldNamesApiRequest) Execute() ([]string, *http.Response, error) {
629-
return r.ApiService.listAlertConfigurationMatchersFieldNamesExecute(r)
629+
return r.ApiService.ListAlertConfigurationMatchersFieldNamesExecute(r)
630630
}
631631

632632
/*
@@ -647,7 +647,7 @@ func (a *AlertConfigurationsApiService) ListAlertConfigurationMatchersFieldNames
647647
// Execute executes the request
648648
//
649649
// @return []string
650-
func (a *AlertConfigurationsApiService) listAlertConfigurationMatchersFieldNamesExecute(r ListAlertConfigurationMatchersFieldNamesApiRequest) ([]string, *http.Response, error) {
650+
func (a *AlertConfigurationsApiService) ListAlertConfigurationMatchersFieldNamesExecute(r ListAlertConfigurationMatchersFieldNamesApiRequest) ([]string, *http.Response, error) {
651651
var (
652652
localVarHTTPMethod = http.MethodGet
653653
localVarPostBody interface{}
@@ -774,7 +774,7 @@ func (r ListAlertConfigurationsApiRequest) PageNum(pageNum int) ListAlertConfigu
774774
}
775775

776776
func (r ListAlertConfigurationsApiRequest) Execute() (*PaginatedAlertConfig, *http.Response, error) {
777-
return r.ApiService.listAlertConfigurationsExecute(r)
777+
return r.ApiService.ListAlertConfigurationsExecute(r)
778778
}
779779

780780
/*
@@ -799,7 +799,7 @@ func (a *AlertConfigurationsApiService) ListAlertConfigurations(ctx context.Cont
799799
// Execute executes the request
800800
//
801801
// @return PaginatedAlertConfig
802-
func (a *AlertConfigurationsApiService) listAlertConfigurationsExecute(r ListAlertConfigurationsApiRequest) (*PaginatedAlertConfig, *http.Response, error) {
802+
func (a *AlertConfigurationsApiService) ListAlertConfigurationsExecute(r ListAlertConfigurationsApiRequest) (*PaginatedAlertConfig, *http.Response, error) {
803803
var (
804804
localVarHTTPMethod = http.MethodGet
805805
localVarPostBody interface{}
@@ -951,7 +951,7 @@ func (r ListAlertConfigurationsByAlertIdApiRequest) PageNum(pageNum int) ListAle
951951
}
952952

953953
func (r ListAlertConfigurationsByAlertIdApiRequest) Execute() (*PaginatedAlertConfig, *http.Response, error) {
954-
return r.ApiService.listAlertConfigurationsByAlertIdExecute(r)
954+
return r.ApiService.ListAlertConfigurationsByAlertIdExecute(r)
955955
}
956956

957957
/*
@@ -978,7 +978,7 @@ func (a *AlertConfigurationsApiService) ListAlertConfigurationsByAlertId(ctx con
978978
// Execute executes the request
979979
//
980980
// @return PaginatedAlertConfig
981-
func (a *AlertConfigurationsApiService) listAlertConfigurationsByAlertIdExecute(r ListAlertConfigurationsByAlertIdApiRequest) (*PaginatedAlertConfig, *http.Response, error) {
981+
func (a *AlertConfigurationsApiService) ListAlertConfigurationsByAlertIdExecute(r ListAlertConfigurationsByAlertIdApiRequest) (*PaginatedAlertConfig, *http.Response, error) {
982982
var (
983983
localVarHTTPMethod = http.MethodGet
984984
localVarPostBody interface{}
@@ -1107,7 +1107,7 @@ func (a *AlertConfigurationsApiService) ToggleAlertConfigurationWithParams(ctx c
11071107
}
11081108

11091109
func (r ToggleAlertConfigurationApiRequest) Execute() (*GroupAlertsConfig, *http.Response, error) {
1110-
return r.ApiService.toggleAlertConfigurationExecute(r)
1110+
return r.ApiService.ToggleAlertConfigurationExecute(r)
11111111
}
11121112

11131113
/*
@@ -1137,7 +1137,7 @@ func (a *AlertConfigurationsApiService) ToggleAlertConfiguration(ctx context.Con
11371137
// Execute executes the request
11381138
//
11391139
// @return GroupAlertsConfig
1140-
func (a *AlertConfigurationsApiService) toggleAlertConfigurationExecute(r ToggleAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
1140+
func (a *AlertConfigurationsApiService) ToggleAlertConfigurationExecute(r ToggleAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
11411141
var (
11421142
localVarHTTPMethod = http.MethodPatch
11431143
localVarPostBody interface{}
@@ -1250,7 +1250,7 @@ func (a *AlertConfigurationsApiService) UpdateAlertConfigurationWithParams(ctx c
12501250
}
12511251

12521252
func (r UpdateAlertConfigurationApiRequest) Execute() (*GroupAlertsConfig, *http.Response, error) {
1253-
return r.ApiService.updateAlertConfigurationExecute(r)
1253+
return r.ApiService.UpdateAlertConfigurationExecute(r)
12541254
}
12551255

12561256
/*
@@ -1280,7 +1280,7 @@ func (a *AlertConfigurationsApiService) UpdateAlertConfiguration(ctx context.Con
12801280
// Execute executes the request
12811281
//
12821282
// @return GroupAlertsConfig
1283-
func (a *AlertConfigurationsApiService) updateAlertConfigurationExecute(r UpdateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
1283+
func (a *AlertConfigurationsApiService) UpdateAlertConfigurationExecute(r UpdateAlertConfigurationApiRequest) (*GroupAlertsConfig, *http.Response, error) {
12841284
var (
12851285
localVarHTTPMethod = http.MethodPut
12861286
localVarPostBody interface{}

0 commit comments

Comments
 (0)