Skip to content

Commit f6783f8

Browse files
authored
chore: Add empty check to path params (#604)
1 parent be5f52f commit f6783f8

Some content is hidden

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

50 files changed

+2544
-0
lines changed

admin/api_access_tracking.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ func (a *AccessTrackingApiService) ListAccessLogsByClusterNameExecute(r ListAcce
170170
}
171171

172172
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}"
173+
if r.groupId == "" {
174+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
175+
}
173176
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
177+
if r.clusterName == "" {
178+
return localVarReturnValue, nil, reportError("clusterName is empty and must be specified")
179+
}
174180
localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -1)
175181

176182
localVarHeaderParams := make(map[string]string)
@@ -351,7 +357,13 @@ func (a *AccessTrackingApiService) ListAccessLogsByHostnameExecute(r ListAccessL
351357
}
352358

353359
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/dbAccessHistory/processes/{hostname}"
360+
if r.groupId == "" {
361+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
362+
}
354363
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
364+
if r.hostname == "" {
365+
return localVarReturnValue, nil, reportError("hostname is empty and must be specified")
366+
}
355367
localVarPath = strings.Replace(localVarPath, "{"+"hostname"+"}", url.PathEscape(r.hostname), -1)
356368

357369
localVarHeaderParams := make(map[string]string)

admin/api_alert_configurations.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ func (a *AlertConfigurationsApiService) CreateAlertConfigurationExecute(r Create
287287
}
288288

289289
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs"
290+
if r.groupId == "" {
291+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
292+
}
290293
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
291294

292295
localVarHeaderParams := make(map[string]string)
@@ -407,7 +410,13 @@ func (a *AlertConfigurationsApiService) DeleteAlertConfigurationExecute(r Delete
407410
}
408411

409412
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}"
413+
if r.groupId == "" {
414+
return nil, reportError("groupId is empty and must be specified")
415+
}
410416
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
417+
if r.alertConfigId == "" {
418+
return nil, reportError("alertConfigId is empty and must be specified")
419+
}
411420
localVarPath = strings.Replace(localVarPath, "{"+"alertConfigId"+"}", url.PathEscape(r.alertConfigId), -1)
412421

413422
localVarHeaderParams := make(map[string]string)
@@ -512,7 +521,13 @@ func (a *AlertConfigurationsApiService) GetAlertConfigurationExecute(r GetAlertC
512521
}
513522

514523
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}"
524+
if r.groupId == "" {
525+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
526+
}
515527
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
528+
if r.alertConfigId == "" {
529+
return localVarReturnValue, nil, reportError("alertConfigId is empty and must be specified")
530+
}
516531
localVarPath = strings.Replace(localVarPath, "{"+"alertConfigId"+"}", url.PathEscape(r.alertConfigId), -1)
517532

518533
localVarHeaderParams := make(map[string]string)
@@ -758,6 +773,9 @@ func (a *AlertConfigurationsApiService) ListAlertConfigurationsExecute(r ListAle
758773
}
759774

760775
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs"
776+
if r.groupId == "" {
777+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
778+
}
761779
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
762780

763781
localVarHeaderParams := make(map[string]string)
@@ -924,7 +942,13 @@ func (a *AlertConfigurationsApiService) ListAlertConfigurationsByAlertIdExecute(
924942
}
925943

926944
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs"
945+
if r.groupId == "" {
946+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
947+
}
927948
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
949+
if r.alertId == "" {
950+
return localVarReturnValue, nil, reportError("alertId is empty and must be specified")
951+
}
928952
localVarPath = strings.Replace(localVarPath, "{"+"alertId"+"}", url.PathEscape(r.alertId), -1)
929953

930954
localVarHeaderParams := make(map[string]string)
@@ -1070,7 +1094,13 @@ func (a *AlertConfigurationsApiService) ToggleAlertConfigurationExecute(r Toggle
10701094
}
10711095

10721096
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}"
1097+
if r.groupId == "" {
1098+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
1099+
}
10731100
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
1101+
if r.alertConfigId == "" {
1102+
return localVarReturnValue, nil, reportError("alertConfigId is empty and must be specified")
1103+
}
10741104
localVarPath = strings.Replace(localVarPath, "{"+"alertConfigId"+"}", url.PathEscape(r.alertConfigId), -1)
10751105

10761106
localVarHeaderParams := make(map[string]string)
@@ -1200,7 +1230,13 @@ func (a *AlertConfigurationsApiService) UpdateAlertConfigurationExecute(r Update
12001230
}
12011231

12021232
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}"
1233+
if r.groupId == "" {
1234+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
1235+
}
12031236
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
1237+
if r.alertConfigId == "" {
1238+
return localVarReturnValue, nil, reportError("alertConfigId is empty and must be specified")
1239+
}
12041240
localVarPath = strings.Replace(localVarPath, "{"+"alertConfigId"+"}", url.PathEscape(r.alertConfigId), -1)
12051241

12061242
localVarHeaderParams := make(map[string]string)

admin/api_alerts.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,13 @@ func (a *AlertsApiService) AcknowledgeAlertExecute(r AcknowledgeAlertApiRequest)
187187
}
188188

189189
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alerts/{alertId}"
190+
if r.groupId == "" {
191+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
192+
}
190193
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
194+
if r.alertId == "" {
195+
return localVarReturnValue, nil, reportError("alertId is empty and must be specified")
196+
}
191197
localVarPath = strings.Replace(localVarPath, "{"+"alertId"+"}", url.PathEscape(r.alertId), -1)
192198

193199
localVarHeaderParams := make(map[string]string)
@@ -311,7 +317,13 @@ func (a *AlertsApiService) GetAlertExecute(r GetAlertApiRequest) (*AlertViewForN
311317
}
312318

313319
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alerts/{alertId}"
320+
if r.groupId == "" {
321+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
322+
}
314323
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
324+
if r.alertId == "" {
325+
return localVarReturnValue, nil, reportError("alertId is empty and must be specified")
326+
}
315327
localVarPath = strings.Replace(localVarPath, "{"+"alertId"+"}", url.PathEscape(r.alertId), -1)
316328

317329
localVarHeaderParams := make(map[string]string)
@@ -461,6 +473,9 @@ func (a *AlertsApiService) ListAlertsExecute(r ListAlertsApiRequest) (*Paginated
461473
}
462474

463475
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alerts"
476+
if r.groupId == "" {
477+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
478+
}
464479
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
465480

466481
localVarHeaderParams := make(map[string]string)
@@ -630,7 +645,13 @@ func (a *AlertsApiService) ListAlertsByAlertConfigurationIdExecute(r ListAlertsB
630645
}
631646

632647
localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}/alerts"
648+
if r.groupId == "" {
649+
return localVarReturnValue, nil, reportError("groupId is empty and must be specified")
650+
}
633651
localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1)
652+
if r.alertConfigId == "" {
653+
return localVarReturnValue, nil, reportError("alertConfigId is empty and must be specified")
654+
}
634655
localVarPath = strings.Replace(localVarPath, "{"+"alertConfigId"+"}", url.PathEscape(r.alertConfigId), -1)
635656

636657
localVarHeaderParams := make(map[string]string)

0 commit comments

Comments
 (0)