diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index fd2febf725f..16fae6e361a 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -94,7 +94,7 @@ func (a *{{ classname }}) {{ operation.operationId }}(ctx _context.Context{% for localVarPath := localBasePath + "{{ path }}" {%- for name, parameter in operation|parameters if parameter.in == "path" %} - localVarPath = strings.Replace(localVarPath, "{"+"{{ name }}"+"}", _neturl.PathEscape({{ common_package_name }}.ParameterToString({{ name|variable_name}}, "{{ parameter|collection_format }}")), -1) + localVarPath = {{ common_package_name }}.ReplacePathParameter(localVarPath, "{% raw %}{{% endraw %}{{ name }}{% raw %}}{% endraw %}", _neturl.PathEscape({{ common_package_name }}.ParameterToString({{ name|variable_name}}, "{{ parameter|collection_format }}"))) {%- endfor %} localVarHeaderParams := make(map[string]string) diff --git a/.generator/src/generator/templates/client.j2 b/.generator/src/generator/templates/client.j2 index 665e34d7672..76865327f24 100644 --- a/.generator/src/generator/templates/client.j2 +++ b/.generator/src/generator/templates/client.j2 @@ -107,7 +107,7 @@ func ParameterToString(obj interface{}, collectionFormat string) string { } if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + return strings.Trim(strings.ReplaceAll(fmt.Sprint(obj), " ", delimiter), "[]") } else if t, ok := obj.(time.Time); ok { if t.Nanosecond() == 0 { return t.Format("2006-01-02T15:04:05Z07:00") @@ -118,6 +118,11 @@ func ParameterToString(obj interface{}, collectionFormat string) string { return fmt.Sprintf("%v", obj) } +// ReplacePathParameter replace all occurrences of `pathKey` in `path` with `parameterValue`. +func ReplacePathParameter(path, pathKey, parameterValue string) string { + return strings.ReplaceAll(path, pathKey, parameterValue) +} + {# The method is used in Terraform client and needs to be public. -#} // CallAPI do the request. func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error) { diff --git a/api/datadog/client.go b/api/datadog/client.go index 72406bf0a94..d240bd57e90 100644 --- a/api/datadog/client.go +++ b/api/datadog/client.go @@ -109,7 +109,7 @@ func ParameterToString(obj interface{}, collectionFormat string) string { } if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + return strings.Trim(strings.ReplaceAll(fmt.Sprint(obj), " ", delimiter), "[]") } else if t, ok := obj.(time.Time); ok { if t.Nanosecond() == 0 { return t.Format("2006-01-02T15:04:05Z07:00") @@ -120,6 +120,11 @@ func ParameterToString(obj interface{}, collectionFormat string) string { return fmt.Sprintf("%v", obj) } +// ReplacePathParameter replace all occurrences of `pathKey` in `path` with `parameterValue`. +func ReplacePathParameter(path, pathKey, parameterValue string) string { + return strings.ReplaceAll(path, pathKey, parameterValue) +} + // CallAPI do the request. func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error) { var rawBody []byte diff --git a/api/datadogV1/api_dashboard_lists.go b/api/datadogV1/api_dashboard_lists.go index ab218bd046f..e75a3521800 100644 --- a/api/datadogV1/api_dashboard_lists.go +++ b/api/datadogV1/api_dashboard_lists.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *DashboardListsApi) DeleteDashboardList(ctx _context.Context, listId int } localVarPath := localBasePath + "/api/v1/dashboard/lists/manual/{list_id}" - localVarPath = strings.Replace(localVarPath, "{"+"list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(listId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{list_id}", _neturl.PathEscape(datadog.ParameterToString(listId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -175,7 +174,7 @@ func (a *DashboardListsApi) GetDashboardList(ctx _context.Context, listId int64) } localVarPath := localBasePath + "/api/v1/dashboard/lists/manual/{list_id}" - localVarPath = strings.Replace(localVarPath, "{"+"list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(listId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{list_id}", _neturl.PathEscape(datadog.ParameterToString(listId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -316,7 +315,7 @@ func (a *DashboardListsApi) UpdateDashboardList(ctx _context.Context, listId int } localVarPath := localBasePath + "/api/v1/dashboard/lists/manual/{list_id}" - localVarPath = strings.Replace(localVarPath, "{"+"list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(listId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{list_id}", _neturl.PathEscape(datadog.ParameterToString(listId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_dashboards.go b/api/datadogV1/api_dashboards.go index 55942b01d7d..3174282f36d 100644 --- a/api/datadogV1/api_dashboards.go +++ b/api/datadogV1/api_dashboards.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -178,7 +177,7 @@ func (a *DashboardsApi) DeleteDashboard(ctx _context.Context, dashboardId string } localVarPath := localBasePath + "/api/v1/dashboard/{dashboard_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -312,7 +311,7 @@ func (a *DashboardsApi) DeletePublicDashboard(ctx _context.Context, token string } localVarPath := localBasePath + "/api/v1/dashboard/public/{token}" - localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", _neturl.PathEscape(datadog.ParameterToString(token, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{token}", _neturl.PathEscape(datadog.ParameterToString(token, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -382,7 +381,7 @@ func (a *DashboardsApi) DeletePublicDashboardInvitation(ctx _context.Context, to } localVarPath := localBasePath + "/api/v1/dashboard/public/{token}/invitation" - localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", _neturl.PathEscape(datadog.ParameterToString(token, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{token}", _neturl.PathEscape(datadog.ParameterToString(token, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -447,7 +446,7 @@ func (a *DashboardsApi) GetDashboard(ctx _context.Context, dashboardId string) ( } localVarPath := localBasePath + "/api/v1/dashboard/{dashboard_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -518,7 +517,7 @@ func (a *DashboardsApi) GetPublicDashboard(ctx _context.Context, token string) ( } localVarPath := localBasePath + "/api/v1/dashboard/public/{token}" - localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", _neturl.PathEscape(datadog.ParameterToString(token, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{token}", _neturl.PathEscape(datadog.ParameterToString(token, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -621,7 +620,7 @@ func (a *DashboardsApi) GetPublicDashboardInvitations(ctx _context.Context, toke } localVarPath := localBasePath + "/api/v1/dashboard/public/{token}/invitation" - localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", _neturl.PathEscape(datadog.ParameterToString(token, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{token}", _neturl.PathEscape(datadog.ParameterToString(token, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -942,7 +941,7 @@ func (a *DashboardsApi) SendPublicDashboardInvitation(ctx _context.Context, toke } localVarPath := localBasePath + "/api/v1/dashboard/public/{token}/invitation" - localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", _neturl.PathEscape(datadog.ParameterToString(token, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{token}", _neturl.PathEscape(datadog.ParameterToString(token, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1016,7 +1015,7 @@ func (a *DashboardsApi) UpdateDashboard(ctx _context.Context, dashboardId string } localVarPath := localBasePath + "/api/v1/dashboard/{dashboard_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1090,7 +1089,7 @@ func (a *DashboardsApi) UpdatePublicDashboard(ctx _context.Context, token string } localVarPath := localBasePath + "/api/v1/dashboard/public/{token}" - localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", _neturl.PathEscape(datadog.ParameterToString(token, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{token}", _neturl.PathEscape(datadog.ParameterToString(token, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_downtimes.go b/api/datadogV1/api_downtimes.go index 35fb2093cfd..44d91c3054b 100644 --- a/api/datadogV1/api_downtimes.go +++ b/api/datadogV1/api_downtimes.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -32,7 +31,7 @@ func (a *DowntimesApi) CancelDowntime(ctx _context.Context, downtimeId int64) (* } localVarPath := localBasePath + "/api/v1/downtime/{downtime_id}" - localVarPath = strings.Replace(localVarPath, "{"+"downtime_id"+"}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{downtime_id}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -246,7 +245,7 @@ func (a *DowntimesApi) GetDowntime(ctx _context.Context, downtimeId int64) (Down } localVarPath := localBasePath + "/api/v1/downtime/{downtime_id}" - localVarPath = strings.Replace(localVarPath, "{"+"downtime_id"+"}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{downtime_id}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -429,7 +428,7 @@ func (a *DowntimesApi) ListMonitorDowntimes(ctx _context.Context, monitorId int6 } localVarPath := localBasePath + "/api/v1/monitor/{monitor_id}/downtimes" - localVarPath = strings.Replace(localVarPath, "{"+"monitor_id"+"}", _neturl.PathEscape(datadog.ParameterToString(monitorId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{monitor_id}", _neturl.PathEscape(datadog.ParameterToString(monitorId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -502,7 +501,7 @@ func (a *DowntimesApi) UpdateDowntime(ctx _context.Context, downtimeId int64, bo } localVarPath := localBasePath + "/api/v1/downtime/{downtime_id}" - localVarPath = strings.Replace(localVarPath, "{"+"downtime_id"+"}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{downtime_id}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_events.go b/api/datadogV1/api_events.go index 3d0e6866bc1..7415e50062a 100644 --- a/api/datadogV1/api_events.go +++ b/api/datadogV1/api_events.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -107,7 +106,7 @@ func (a *EventsApi) GetEvent(ctx _context.Context, eventId int64) (EventResponse } localVarPath := localBasePath + "/api/v1/events/{event_id}" - localVarPath = strings.Replace(localVarPath, "{"+"event_id"+"}", _neturl.PathEscape(datadog.ParameterToString(eventId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{event_id}", _neturl.PathEscape(datadog.ParameterToString(eventId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_hosts.go b/api/datadogV1/api_hosts.go index b6551187070..7e354b1a592 100644 --- a/api/datadogV1/api_hosts.go +++ b/api/datadogV1/api_hosts.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -301,7 +300,7 @@ func (a *HostsApi) MuteHost(ctx _context.Context, hostName string, body HostMute } localVarPath := localBasePath + "/api/v1/host/{host_name}/mute" - localVarPath = strings.Replace(localVarPath, "{"+"host_name"+"}", _neturl.PathEscape(datadog.ParameterToString(hostName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{host_name}", _neturl.PathEscape(datadog.ParameterToString(hostName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -375,7 +374,7 @@ func (a *HostsApi) UnmuteHost(ctx _context.Context, hostName string) (HostMuteRe } localVarPath := localBasePath + "/api/v1/host/{host_name}/unmute" - localVarPath = strings.Replace(localVarPath, "{"+"host_name"+"}", _neturl.PathEscape(datadog.ParameterToString(hostName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{host_name}", _neturl.PathEscape(datadog.ParameterToString(hostName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_key_management.go b/api/datadogV1/api_key_management.go index 8ba8fe6e493..fd934e8016e 100644 --- a/api/datadogV1/api_key_management.go +++ b/api/datadogV1/api_key_management.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -177,7 +176,7 @@ func (a *KeyManagementApi) DeleteAPIKey(ctx _context.Context, key string) (ApiKe } localVarPath := localBasePath + "/api/v1/api_key/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.PathEscape(datadog.ParameterToString(key, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{key}", _neturl.PathEscape(datadog.ParameterToString(key, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -248,7 +247,7 @@ func (a *KeyManagementApi) DeleteApplicationKey(ctx _context.Context, key string } localVarPath := localBasePath + "/api/v1/application_key/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.PathEscape(datadog.ParameterToString(key, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{key}", _neturl.PathEscape(datadog.ParameterToString(key, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -319,7 +318,7 @@ func (a *KeyManagementApi) GetAPIKey(ctx _context.Context, key string) (ApiKeyRe } localVarPath := localBasePath + "/api/v1/api_key/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.PathEscape(datadog.ParameterToString(key, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{key}", _neturl.PathEscape(datadog.ParameterToString(key, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -390,7 +389,7 @@ func (a *KeyManagementApi) GetApplicationKey(ctx _context.Context, key string) ( } localVarPath := localBasePath + "/api/v1/application_key/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.PathEscape(datadog.ParameterToString(key, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{key}", _neturl.PathEscape(datadog.ParameterToString(key, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -601,7 +600,7 @@ func (a *KeyManagementApi) UpdateAPIKey(ctx _context.Context, key string, body A } localVarPath := localBasePath + "/api/v1/api_key/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.PathEscape(datadog.ParameterToString(key, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{key}", _neturl.PathEscape(datadog.ParameterToString(key, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -675,7 +674,7 @@ func (a *KeyManagementApi) UpdateApplicationKey(ctx _context.Context, key string } localVarPath := localBasePath + "/api/v1/application_key/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.PathEscape(datadog.ParameterToString(key, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{key}", _neturl.PathEscape(datadog.ParameterToString(key, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_logs_indexes.go b/api/datadogV1/api_logs_indexes.go index 5269c52afd5..b66ea02146e 100644 --- a/api/datadogV1/api_logs_indexes.go +++ b/api/datadogV1/api_logs_indexes.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -113,7 +112,7 @@ func (a *LogsIndexesApi) GetLogsIndex(ctx _context.Context, name string) (LogsIn } localVarPath := localBasePath + "/api/v1/logs/config/indexes/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", _neturl.PathEscape(datadog.ParameterToString(name, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{name}", _neturl.PathEscape(datadog.ParameterToString(name, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -338,7 +337,7 @@ func (a *LogsIndexesApi) UpdateLogsIndex(ctx _context.Context, name string, body } localVarPath := localBasePath + "/api/v1/logs/config/indexes/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", _neturl.PathEscape(datadog.ParameterToString(name, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{name}", _neturl.PathEscape(datadog.ParameterToString(name, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_logs_pipelines.go b/api/datadogV1/api_logs_pipelines.go index 5136ae9efb5..ba4cc818686 100644 --- a/api/datadogV1/api_logs_pipelines.go +++ b/api/datadogV1/api_logs_pipelines.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -113,7 +112,7 @@ func (a *LogsPipelinesApi) DeleteLogsPipeline(ctx _context.Context, pipelineId s } localVarPath := localBasePath + "/api/v1/logs/config/pipelines/{pipeline_id}" - localVarPath = strings.Replace(localVarPath, "{"+"pipeline_id"+"}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pipeline_id}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -185,7 +184,7 @@ func (a *LogsPipelinesApi) GetLogsPipeline(ctx _context.Context, pipelineId stri } localVarPath := localBasePath + "/api/v1/logs/config/pipelines/{pipeline_id}" - localVarPath = strings.Replace(localVarPath, "{"+"pipeline_id"+"}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pipeline_id}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -410,7 +409,7 @@ func (a *LogsPipelinesApi) UpdateLogsPipeline(ctx _context.Context, pipelineId s } localVarPath := localBasePath + "/api/v1/logs/config/pipelines/{pipeline_id}" - localVarPath = strings.Replace(localVarPath, "{"+"pipeline_id"+"}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pipeline_id}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_metrics.go b/api/datadogV1/api_metrics.go index 6d1abffa48e..66f63cbfc27 100644 --- a/api/datadogV1/api_metrics.go +++ b/api/datadogV1/api_metrics.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *MetricsApi) GetMetricMetadata(ctx _context.Context, metricName string) } localVarPath := localBasePath + "/api/v1/metrics/{metric_name}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -567,7 +566,7 @@ func (a *MetricsApi) UpdateMetricMetadata(ctx _context.Context, metricName strin } localVarPath := localBasePath + "/api/v1/metrics/{metric_name}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_monitors.go b/api/datadogV1/api_monitors.go index 09551deaf0e..caa73a7d913 100644 --- a/api/datadogV1/api_monitors.go +++ b/api/datadogV1/api_monitors.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -402,7 +401,7 @@ func (a *MonitorsApi) DeleteMonitor(ctx _context.Context, monitorId int64, o ... } localVarPath := localBasePath + "/api/v1/monitor/{monitor_id}" - localVarPath = strings.Replace(localVarPath, "{"+"monitor_id"+"}", _neturl.PathEscape(datadog.ParameterToString(monitorId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{monitor_id}", _neturl.PathEscape(datadog.ParameterToString(monitorId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -508,7 +507,7 @@ func (a *MonitorsApi) GetMonitor(ctx _context.Context, monitorId int64, o ...Get } localVarPath := localBasePath + "/api/v1/monitor/{monitor_id}" - localVarPath = strings.Replace(localVarPath, "{"+"monitor_id"+"}", _neturl.PathEscape(datadog.ParameterToString(monitorId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{monitor_id}", _neturl.PathEscape(datadog.ParameterToString(monitorId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1053,7 +1052,7 @@ func (a *MonitorsApi) UpdateMonitor(ctx _context.Context, monitorId int64, body } localVarPath := localBasePath + "/api/v1/monitor/{monitor_id}" - localVarPath = strings.Replace(localVarPath, "{"+"monitor_id"+"}", _neturl.PathEscape(datadog.ParameterToString(monitorId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{monitor_id}", _neturl.PathEscape(datadog.ParameterToString(monitorId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1127,7 +1126,7 @@ func (a *MonitorsApi) ValidateExistingMonitor(ctx _context.Context, monitorId in } localVarPath := localBasePath + "/api/v1/monitor/{monitor_id}/validate" - localVarPath = strings.Replace(localVarPath, "{"+"monitor_id"+"}", _neturl.PathEscape(datadog.ParameterToString(monitorId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{monitor_id}", _neturl.PathEscape(datadog.ParameterToString(monitorId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_notebooks.go b/api/datadogV1/api_notebooks.go index 20f87495f90..a381f63475d 100644 --- a/api/datadogV1/api_notebooks.go +++ b/api/datadogV1/api_notebooks.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *NotebooksApi) DeleteNotebook(ctx _context.Context, notebookId int64) (* } localVarPath := localBasePath + "/api/v1/notebooks/{notebook_id}" - localVarPath = strings.Replace(localVarPath, "{"+"notebook_id"+"}", _neturl.PathEscape(datadog.ParameterToString(notebookId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{notebook_id}", _neturl.PathEscape(datadog.ParameterToString(notebookId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *NotebooksApi) GetNotebook(ctx _context.Context, notebookId int64) (Note } localVarPath := localBasePath + "/api/v1/notebooks/{notebook_id}" - localVarPath = strings.Replace(localVarPath, "{"+"notebook_id"+"}", _neturl.PathEscape(datadog.ParameterToString(notebookId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{notebook_id}", _neturl.PathEscape(datadog.ParameterToString(notebookId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -475,7 +474,7 @@ func (a *NotebooksApi) UpdateNotebook(ctx _context.Context, notebookId int64, bo } localVarPath := localBasePath + "/api/v1/notebooks/{notebook_id}" - localVarPath = strings.Replace(localVarPath, "{"+"notebook_id"+"}", _neturl.PathEscape(datadog.ParameterToString(notebookId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{notebook_id}", _neturl.PathEscape(datadog.ParameterToString(notebookId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_organizations.go b/api/datadogV1/api_organizations.go index 9fd4ca25d46..11d40ac52c5 100644 --- a/api/datadogV1/api_organizations.go +++ b/api/datadogV1/api_organizations.go @@ -9,7 +9,6 @@ import ( _io "io" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -114,7 +113,7 @@ func (a *OrganizationsApi) DowngradeOrg(ctx _context.Context, publicId string) ( } localVarPath := localBasePath + "/api/v1/org/{public_id}/downgrade" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -185,7 +184,7 @@ func (a *OrganizationsApi) GetOrg(ctx _context.Context, publicId string) (Organi } localVarPath := localBasePath + "/api/v1/org/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -326,7 +325,7 @@ func (a *OrganizationsApi) UpdateOrg(ctx _context.Context, publicId string, body } localVarPath := localBasePath + "/api/v1/org/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -405,7 +404,7 @@ func (a *OrganizationsApi) UploadIdPForOrg(ctx _context.Context, publicId string } localVarPath := localBasePath + "/api/v1/org/{public_id}/idp_metadata" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_pager_duty_integration.go b/api/datadogV1/api_pager_duty_integration.go index 74d593dcaf3..40ecbfe5ea3 100644 --- a/api/datadogV1/api_pager_duty_integration.go +++ b/api/datadogV1/api_pager_duty_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *PagerDutyIntegrationApi) DeletePagerDutyIntegrationService(ctx _context } localVarPath := localBasePath + "/api/v1/integration/pagerduty/configuration/services/{service_name}" - localVarPath = strings.Replace(localVarPath, "{"+"service_name"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_name}", _neturl.PathEscape(datadog.ParameterToString(serviceName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *PagerDutyIntegrationApi) GetPagerDutyIntegrationService(ctx _context.Co } localVarPath := localBasePath + "/api/v1/integration/pagerduty/configuration/services/{service_name}" - localVarPath = strings.Replace(localVarPath, "{"+"service_name"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_name}", _neturl.PathEscape(datadog.ParameterToString(serviceName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -235,7 +234,7 @@ func (a *PagerDutyIntegrationApi) UpdatePagerDutyIntegrationService(ctx _context } localVarPath := localBasePath + "/api/v1/integration/pagerduty/configuration/services/{service_name}" - localVarPath = strings.Replace(localVarPath, "{"+"service_name"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_name}", _neturl.PathEscape(datadog.ParameterToString(serviceName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_security_monitoring.go b/api/datadogV1/api_security_monitoring.go index 053e82c36bc..89619c6e714 100644 --- a/api/datadogV1/api_security_monitoring.go +++ b/api/datadogV1/api_security_monitoring.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *SecurityMonitoringApi) AddSecurityMonitoringSignalToIncident(ctx _conte } localVarPath := localBasePath + "/api/v1/security_analytics/signals/{signal_id}/add_to_incident" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -105,7 +104,7 @@ func (a *SecurityMonitoringApi) EditSecurityMonitoringSignalAssignee(ctx _contex } localVarPath := localBasePath + "/api/v1/security_analytics/signals/{signal_id}/assignee" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -179,7 +178,7 @@ func (a *SecurityMonitoringApi) EditSecurityMonitoringSignalState(ctx _context.C } localVarPath := localBasePath + "/api/v1/security_analytics/signals/{signal_id}/state" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_service_level_objective_corrections.go b/api/datadogV1/api_service_level_objective_corrections.go index 7d88be9196e..715830eac32 100644 --- a/api/datadogV1/api_service_level_objective_corrections.go +++ b/api/datadogV1/api_service_level_objective_corrections.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *ServiceLevelObjectiveCorrectionsApi) DeleteSLOCorrection(ctx _context.C } localVarPath := localBasePath + "/api/v1/slo/correction/{slo_correction_id}" - localVarPath = strings.Replace(localVarPath, "{"+"slo_correction_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloCorrectionId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_correction_id}", _neturl.PathEscape(datadog.ParameterToString(sloCorrectionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *ServiceLevelObjectiveCorrectionsApi) GetSLOCorrection(ctx _context.Cont } localVarPath := localBasePath + "/api/v1/slo/correction/{slo_correction_id}" - localVarPath = strings.Replace(localVarPath, "{"+"slo_correction_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloCorrectionId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_correction_id}", _neturl.PathEscape(datadog.ParameterToString(sloCorrectionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -394,7 +393,7 @@ func (a *ServiceLevelObjectiveCorrectionsApi) UpdateSLOCorrection(ctx _context.C } localVarPath := localBasePath + "/api/v1/slo/correction/{slo_correction_id}" - localVarPath = strings.Replace(localVarPath, "{"+"slo_correction_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloCorrectionId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_correction_id}", _neturl.PathEscape(datadog.ParameterToString(sloCorrectionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_service_level_objectives.go b/api/datadogV1/api_service_level_objectives.go index 6fab1ef3589..43ec4b6e9c6 100644 --- a/api/datadogV1/api_service_level_objectives.go +++ b/api/datadogV1/api_service_level_objectives.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -213,7 +212,7 @@ func (a *ServiceLevelObjectivesApi) DeleteSLO(ctx _context.Context, sloId string } localVarPath := localBasePath + "/api/v1/slo/{slo_id}" - localVarPath = strings.Replace(localVarPath, "{"+"slo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_id}", _neturl.PathEscape(datadog.ParameterToString(sloId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -398,7 +397,7 @@ func (a *ServiceLevelObjectivesApi) GetSLO(ctx _context.Context, sloId string, o } localVarPath := localBasePath + "/api/v1/slo/{slo_id}" - localVarPath = strings.Replace(localVarPath, "{"+"slo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_id}", _neturl.PathEscape(datadog.ParameterToString(sloId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -472,7 +471,7 @@ func (a *ServiceLevelObjectivesApi) GetSLOCorrections(ctx _context.Context, sloI } localVarPath := localBasePath + "/api/v1/slo/{slo_id}/corrections" - localVarPath = strings.Replace(localVarPath, "{"+"slo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_id}", _neturl.PathEscape(datadog.ParameterToString(sloId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -582,7 +581,7 @@ func (a *ServiceLevelObjectivesApi) GetSLOHistory(ctx _context.Context, sloId st } localVarPath := localBasePath + "/api/v1/slo/{slo_id}/history" - localVarPath = strings.Replace(localVarPath, "{"+"slo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_id}", _neturl.PathEscape(datadog.ParameterToString(sloId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -987,7 +986,7 @@ func (a *ServiceLevelObjectivesApi) UpdateSLO(ctx _context.Context, sloId string } localVarPath := localBasePath + "/api/v1/slo/{slo_id}" - localVarPath = strings.Replace(localVarPath, "{"+"slo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(sloId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slo_id}", _neturl.PathEscape(datadog.ParameterToString(sloId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_slack_integration.go b/api/datadogV1/api_slack_integration.go index c94c1667dab..7c6b4294ec1 100644 --- a/api/datadogV1/api_slack_integration.go +++ b/api/datadogV1/api_slack_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *SlackIntegrationApi) CreateSlackIntegrationChannel(ctx _context.Context } localVarPath := localBasePath + "/api/v1/integration/slack/configuration/accounts/{account_name}/channels" - localVarPath = strings.Replace(localVarPath, "{"+"account_name"+"}", _neturl.PathEscape(datadog.ParameterToString(accountName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_name}", _neturl.PathEscape(datadog.ParameterToString(accountName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -105,8 +104,8 @@ func (a *SlackIntegrationApi) GetSlackIntegrationChannel(ctx _context.Context, a } localVarPath := localBasePath + "/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}" - localVarPath = strings.Replace(localVarPath, "{"+"account_name"+"}", _neturl.PathEscape(datadog.ParameterToString(accountName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"channel_name"+"}", _neturl.PathEscape(datadog.ParameterToString(channelName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_name}", _neturl.PathEscape(datadog.ParameterToString(accountName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{channel_name}", _neturl.PathEscape(datadog.ParameterToString(channelName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -177,7 +176,7 @@ func (a *SlackIntegrationApi) GetSlackIntegrationChannels(ctx _context.Context, } localVarPath := localBasePath + "/api/v1/integration/slack/configuration/accounts/{account_name}/channels" - localVarPath = strings.Replace(localVarPath, "{"+"account_name"+"}", _neturl.PathEscape(datadog.ParameterToString(accountName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_name}", _neturl.PathEscape(datadog.ParameterToString(accountName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -247,8 +246,8 @@ func (a *SlackIntegrationApi) RemoveSlackIntegrationChannel(ctx _context.Context } localVarPath := localBasePath + "/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}" - localVarPath = strings.Replace(localVarPath, "{"+"account_name"+"}", _neturl.PathEscape(datadog.ParameterToString(accountName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"channel_name"+"}", _neturl.PathEscape(datadog.ParameterToString(channelName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_name}", _neturl.PathEscape(datadog.ParameterToString(accountName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{channel_name}", _neturl.PathEscape(datadog.ParameterToString(channelName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -310,8 +309,8 @@ func (a *SlackIntegrationApi) UpdateSlackIntegrationChannel(ctx _context.Context } localVarPath := localBasePath + "/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}" - localVarPath = strings.Replace(localVarPath, "{"+"account_name"+"}", _neturl.PathEscape(datadog.ParameterToString(accountName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"channel_name"+"}", _neturl.PathEscape(datadog.ParameterToString(channelName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_name}", _neturl.PathEscape(datadog.ParameterToString(accountName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{channel_name}", _neturl.PathEscape(datadog.ParameterToString(channelName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_synthetics.go b/api/datadogV1/api_synthetics.go index aa03d152a08..c08e9a37e43 100644 --- a/api/datadogV1/api_synthetics.go +++ b/api/datadogV1/api_synthetics.go @@ -9,7 +9,6 @@ import ( _nethttp "net/http" _neturl "net/url" "reflect" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -396,7 +395,7 @@ func (a *SyntheticsApi) DeleteGlobalVariable(ctx _context.Context, variableId st } localVarPath := localBasePath + "/api/v1/synthetics/variables/{variable_id}" - localVarPath = strings.Replace(localVarPath, "{"+"variable_id"+"}", _neturl.PathEscape(datadog.ParameterToString(variableId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{variable_id}", _neturl.PathEscape(datadog.ParameterToString(variableId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -457,7 +456,7 @@ func (a *SyntheticsApi) DeletePrivateLocation(ctx _context.Context, locationId s } localVarPath := localBasePath + "/api/v1/synthetics/private-locations/{location_id}" - localVarPath = strings.Replace(localVarPath, "{"+"location_id"+"}", _neturl.PathEscape(datadog.ParameterToString(locationId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{location_id}", _neturl.PathEscape(datadog.ParameterToString(locationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -592,7 +591,7 @@ func (a *SyntheticsApi) EditGlobalVariable(ctx _context.Context, variableId stri } localVarPath := localBasePath + "/api/v1/synthetics/variables/{variable_id}" - localVarPath = strings.Replace(localVarPath, "{"+"variable_id"+"}", _neturl.PathEscape(datadog.ParameterToString(variableId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{variable_id}", _neturl.PathEscape(datadog.ParameterToString(variableId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -740,7 +739,7 @@ func (a *SyntheticsApi) GetAPITest(ctx _context.Context, publicId string) (Synth } localVarPath := localBasePath + "/api/v1/synthetics/tests/api/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -850,7 +849,7 @@ func (a *SyntheticsApi) GetAPITestLatestResults(ctx _context.Context, publicId s } localVarPath := localBasePath + "/api/v1/synthetics/tests/{public_id}/results" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -938,8 +937,8 @@ func (a *SyntheticsApi) GetAPITestResult(ctx _context.Context, publicId string, } localVarPath := localBasePath + "/api/v1/synthetics/tests/{public_id}/results/{result_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"result_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resultId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{result_id}", _neturl.PathEscape(datadog.ParameterToString(resultId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1011,7 +1010,7 @@ func (a *SyntheticsApi) GetBrowserTest(ctx _context.Context, publicId string) (S } localVarPath := localBasePath + "/api/v1/synthetics/tests/browser/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1121,7 +1120,7 @@ func (a *SyntheticsApi) GetBrowserTestLatestResults(ctx _context.Context, public } localVarPath := localBasePath + "/api/v1/synthetics/tests/browser/{public_id}/results" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1209,8 +1208,8 @@ func (a *SyntheticsApi) GetBrowserTestResult(ctx _context.Context, publicId stri } localVarPath := localBasePath + "/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"result_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resultId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{result_id}", _neturl.PathEscape(datadog.ParameterToString(resultId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1281,7 +1280,7 @@ func (a *SyntheticsApi) GetGlobalVariable(ctx _context.Context, variableId strin } localVarPath := localBasePath + "/api/v1/synthetics/variables/{variable_id}" - localVarPath = strings.Replace(localVarPath, "{"+"variable_id"+"}", _neturl.PathEscape(datadog.ParameterToString(variableId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{variable_id}", _neturl.PathEscape(datadog.ParameterToString(variableId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1353,7 +1352,7 @@ func (a *SyntheticsApi) GetMobileTest(ctx _context.Context, publicId string) (Sy } localVarPath := localBasePath + "/api/v1/synthetics/tests/mobile/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1424,7 +1423,7 @@ func (a *SyntheticsApi) GetPrivateLocation(ctx _context.Context, locationId stri } localVarPath := localBasePath + "/api/v1/synthetics/private-locations/{location_id}" - localVarPath = strings.Replace(localVarPath, "{"+"location_id"+"}", _neturl.PathEscape(datadog.ParameterToString(locationId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{location_id}", _neturl.PathEscape(datadog.ParameterToString(locationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1495,7 +1494,7 @@ func (a *SyntheticsApi) GetSyntheticsCIBatch(ctx _context.Context, batchId strin } localVarPath := localBasePath + "/api/v1/synthetics/ci/batch/{batch_id}" - localVarPath = strings.Replace(localVarPath, "{"+"batch_id"+"}", _neturl.PathEscape(datadog.ParameterToString(batchId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{batch_id}", _neturl.PathEscape(datadog.ParameterToString(batchId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1636,7 +1635,7 @@ func (a *SyntheticsApi) GetTest(ctx _context.Context, publicId string) (Syntheti } localVarPath := localBasePath + "/api/v1/synthetics/tests/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2004,7 +2003,7 @@ func (a *SyntheticsApi) PatchTest(ctx _context.Context, publicId string, body Sy } localVarPath := localBasePath + "/api/v1/synthetics/tests/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2224,7 +2223,7 @@ func (a *SyntheticsApi) UpdateAPITest(ctx _context.Context, publicId string, bod } localVarPath := localBasePath + "/api/v1/synthetics/tests/api/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2298,7 +2297,7 @@ func (a *SyntheticsApi) UpdateBrowserTest(ctx _context.Context, publicId string, } localVarPath := localBasePath + "/api/v1/synthetics/tests/browser/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2372,7 +2371,7 @@ func (a *SyntheticsApi) UpdateMobileTest(ctx _context.Context, publicId string, } localVarPath := localBasePath + "/api/v1/synthetics/tests/mobile/{public_id}" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2446,7 +2445,7 @@ func (a *SyntheticsApi) UpdatePrivateLocation(ctx _context.Context, locationId s } localVarPath := localBasePath + "/api/v1/synthetics/private-locations/{location_id}" - localVarPath = strings.Replace(localVarPath, "{"+"location_id"+"}", _neturl.PathEscape(datadog.ParameterToString(locationId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{location_id}", _neturl.PathEscape(datadog.ParameterToString(locationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2520,7 +2519,7 @@ func (a *SyntheticsApi) UpdateTestPauseStatus(ctx _context.Context, publicId str } localVarPath := localBasePath + "/api/v1/synthetics/tests/{public_id}/status" - localVarPath = strings.Replace(localVarPath, "{"+"public_id"+"}", _neturl.PathEscape(datadog.ParameterToString(publicId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_tags.go b/api/datadogV1/api_tags.go index 613e92080cb..182fc6c16e1 100644 --- a/api/datadogV1/api_tags.go +++ b/api/datadogV1/api_tags.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -57,7 +56,7 @@ func (a *TagsApi) CreateHostTags(ctx _context.Context, hostName string, body Hos } localVarPath := localBasePath + "/api/v1/tags/hosts/{host_name}" - localVarPath = strings.Replace(localVarPath, "{"+"host_name"+"}", _neturl.PathEscape(datadog.ParameterToString(hostName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{host_name}", _neturl.PathEscape(datadog.ParameterToString(hostName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -159,7 +158,7 @@ func (a *TagsApi) DeleteHostTags(ctx _context.Context, hostName string, o ...Del } localVarPath := localBasePath + "/api/v1/tags/hosts/{host_name}" - localVarPath = strings.Replace(localVarPath, "{"+"host_name"+"}", _neturl.PathEscape(datadog.ParameterToString(hostName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{host_name}", _neturl.PathEscape(datadog.ParameterToString(hostName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -249,7 +248,7 @@ func (a *TagsApi) GetHostTags(ctx _context.Context, hostName string, o ...GetHos } localVarPath := localBasePath + "/api/v1/tags/hosts/{host_name}" - localVarPath = strings.Replace(localVarPath, "{"+"host_name"+"}", _neturl.PathEscape(datadog.ParameterToString(hostName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{host_name}", _neturl.PathEscape(datadog.ParameterToString(hostName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -447,7 +446,7 @@ func (a *TagsApi) UpdateHostTags(ctx _context.Context, hostName string, body Hos } localVarPath := localBasePath + "/api/v1/tags/hosts/{host_name}" - localVarPath = strings.Replace(localVarPath, "{"+"host_name"+"}", _neturl.PathEscape(datadog.ParameterToString(hostName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{host_name}", _neturl.PathEscape(datadog.ParameterToString(hostName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_usage_metering.go b/api/datadogV1/api_usage_metering.go index 68cd2dbfe4b..c806906cd42 100644 --- a/api/datadogV1/api_usage_metering.go +++ b/api/datadogV1/api_usage_metering.go @@ -9,7 +9,6 @@ import ( _nethttp "net/http" _neturl "net/url" "reflect" - "strings" "time" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" @@ -817,7 +816,7 @@ func (a *UsageMeteringApi) GetSpecifiedDailyCustomReports(ctx _context.Context, } localVarPath := localBasePath + "/api/v1/daily_custom_reports/{report_id}" - localVarPath = strings.Replace(localVarPath, "{"+"report_id"+"}", _neturl.PathEscape(datadog.ParameterToString(reportId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{report_id}", _neturl.PathEscape(datadog.ParameterToString(reportId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -892,7 +891,7 @@ func (a *UsageMeteringApi) GetSpecifiedMonthlyCustomReports(ctx _context.Context } localVarPath := localBasePath + "/api/v1/monthly_custom_reports/{report_id}" - localVarPath = strings.Replace(localVarPath, "{"+"report_id"+"}", _neturl.PathEscape(datadog.ParameterToString(reportId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{report_id}", _neturl.PathEscape(datadog.ParameterToString(reportId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_users.go b/api/datadogV1/api_users.go index 4cedde09f55..19583698607 100644 --- a/api/datadogV1/api_users.go +++ b/api/datadogV1/api_users.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -110,7 +109,7 @@ func (a *UsersApi) DisableUser(ctx _context.Context, userHandle string) (UserDis } localVarPath := localBasePath + "/api/v1/user/{user_handle}" - localVarPath = strings.Replace(localVarPath, "{"+"user_handle"+"}", _neturl.PathEscape(datadog.ParameterToString(userHandle, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_handle}", _neturl.PathEscape(datadog.ParameterToString(userHandle, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -181,7 +180,7 @@ func (a *UsersApi) GetUser(ctx _context.Context, userHandle string) (UserRespons } localVarPath := localBasePath + "/api/v1/user/{user_handle}" - localVarPath = strings.Replace(localVarPath, "{"+"user_handle"+"}", _neturl.PathEscape(datadog.ParameterToString(userHandle, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_handle}", _neturl.PathEscape(datadog.ParameterToString(userHandle, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -324,7 +323,7 @@ func (a *UsersApi) UpdateUser(ctx _context.Context, userHandle string, body User } localVarPath := localBasePath + "/api/v1/user/{user_handle}" - localVarPath = strings.Replace(localVarPath, "{"+"user_handle"+"}", _neturl.PathEscape(datadog.ParameterToString(userHandle, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_handle}", _neturl.PathEscape(datadog.ParameterToString(userHandle, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV1/api_webhooks_integration.go b/api/datadogV1/api_webhooks_integration.go index dcff392a45d..f9c0656acbf 100644 --- a/api/datadogV1/api_webhooks_integration.go +++ b/api/datadogV1/api_webhooks_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -176,7 +175,7 @@ func (a *WebhooksIntegrationApi) DeleteWebhooksIntegration(ctx _context.Context, } localVarPath := localBasePath + "/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}" - localVarPath = strings.Replace(localVarPath, "{"+"webhook_name"+"}", _neturl.PathEscape(datadog.ParameterToString(webhookName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{webhook_name}", _neturl.PathEscape(datadog.ParameterToString(webhookName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -237,7 +236,7 @@ func (a *WebhooksIntegrationApi) DeleteWebhooksIntegrationCustomVariable(ctx _co } localVarPath := localBasePath + "/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}" - localVarPath = strings.Replace(localVarPath, "{"+"custom_variable_name"+"}", _neturl.PathEscape(datadog.ParameterToString(customVariableName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_variable_name}", _neturl.PathEscape(datadog.ParameterToString(customVariableName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -299,7 +298,7 @@ func (a *WebhooksIntegrationApi) GetWebhooksIntegration(ctx _context.Context, we } localVarPath := localBasePath + "/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}" - localVarPath = strings.Replace(localVarPath, "{"+"webhook_name"+"}", _neturl.PathEscape(datadog.ParameterToString(webhookName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{webhook_name}", _neturl.PathEscape(datadog.ParameterToString(webhookName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -373,7 +372,7 @@ func (a *WebhooksIntegrationApi) GetWebhooksIntegrationCustomVariable(ctx _conte } localVarPath := localBasePath + "/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}" - localVarPath = strings.Replace(localVarPath, "{"+"custom_variable_name"+"}", _neturl.PathEscape(datadog.ParameterToString(customVariableName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_variable_name}", _neturl.PathEscape(datadog.ParameterToString(customVariableName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -444,7 +443,7 @@ func (a *WebhooksIntegrationApi) UpdateWebhooksIntegration(ctx _context.Context, } localVarPath := localBasePath + "/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}" - localVarPath = strings.Replace(localVarPath, "{"+"webhook_name"+"}", _neturl.PathEscape(datadog.ParameterToString(webhookName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{webhook_name}", _neturl.PathEscape(datadog.ParameterToString(webhookName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -518,7 +517,7 @@ func (a *WebhooksIntegrationApi) UpdateWebhooksIntegrationCustomVariable(ctx _co } localVarPath := localBasePath + "/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}" - localVarPath = strings.Replace(localVarPath, "{"+"custom_variable_name"+"}", _neturl.PathEscape(datadog.ParameterToString(customVariableName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_variable_name}", _neturl.PathEscape(datadog.ParameterToString(customVariableName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_api_management.go b/api/datadogV2/api_api_management.go index 331bc31b824..c40cc682498 100644 --- a/api/datadogV2/api_api_management.go +++ b/api/datadogV2/api_api_management.go @@ -11,7 +11,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/google/uuid" @@ -170,7 +169,7 @@ func (a *APIManagementApi) DeleteOpenAPI(ctx _context.Context, id uuid.UUID) (*_ } localVarPath := localBasePath + "/api/v2/apicatalog/api/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -250,7 +249,7 @@ func (a *APIManagementApi) GetOpenAPI(ctx _context.Context, id uuid.UUID) (_io.R } localVarPath := localBasePath + "/api/v2/apicatalog/api/{id}/openapi" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -493,7 +492,7 @@ func (a *APIManagementApi) UpdateOpenAPI(ctx _context.Context, id uuid.UUID, o . } localVarPath := localBasePath + "/api/v2/apicatalog/api/{id}/openapi" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_apm_retention_filters.go b/api/datadogV2/api_apm_retention_filters.go index 6ab0f867b6b..fa6fa0797d4 100644 --- a/api/datadogV2/api_apm_retention_filters.go +++ b/api/datadogV2/api_apm_retention_filters.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -108,7 +107,7 @@ func (a *APMRetentionFiltersApi) DeleteApmRetentionFilter(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/apm/config/retention-filters/{filter_id}" - localVarPath = strings.Replace(localVarPath, "{"+"filter_id"+"}", _neturl.PathEscape(datadog.ParameterToString(filterId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{filter_id}", _neturl.PathEscape(datadog.ParameterToString(filterId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -170,7 +169,7 @@ func (a *APMRetentionFiltersApi) GetApmRetentionFilter(ctx _context.Context, fil } localVarPath := localBasePath + "/api/v2/apm/config/retention-filters/{filter_id}" - localVarPath = strings.Replace(localVarPath, "{"+"filter_id"+"}", _neturl.PathEscape(datadog.ParameterToString(filterId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{filter_id}", _neturl.PathEscape(datadog.ParameterToString(filterId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -376,7 +375,7 @@ func (a *APMRetentionFiltersApi) UpdateApmRetentionFilter(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/apm/config/retention-filters/{filter_id}" - localVarPath = strings.Replace(localVarPath, "{"+"filter_id"+"}", _neturl.PathEscape(datadog.ParameterToString(filterId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{filter_id}", _neturl.PathEscape(datadog.ParameterToString(filterId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_app_deployment.go b/api/datadogV2/api_app_deployment.go index 3249b9ac6b8..6e5e20ab6e4 100644 --- a/api/datadogV2/api_app_deployment.go +++ b/api/datadogV2/api_app_deployment.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -42,7 +41,7 @@ func (a *AppDeploymentApi) DeployApp(ctx _context.Context, appId string) (Deploy } localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -131,7 +130,7 @@ func (a *AppDeploymentApi) DisableApp(ctx _context.Context, appId string) (Disab } localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_apps.go b/api/datadogV2/api_apps.go index 4af20fc72a6..4c8652a6f84 100644 --- a/api/datadogV2/api_apps.go +++ b/api/datadogV2/api_apps.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -133,7 +132,7 @@ func (a *AppsApi) DeleteApp(ctx _context.Context, appId string) (DeleteAppRespon } localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -313,7 +312,7 @@ func (a *AppsApi) GetApp(ctx _context.Context, appId string) (GetAppResponse, *_ } localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -608,7 +607,7 @@ func (a *AppsApi) UpdateApp(ctx _context.Context, appId string, body UpdateAppRe } localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_auth_n_mappings.go b/api/datadogV2/api_auth_n_mappings.go index df01394c1d8..9ab29936de3 100644 --- a/api/datadogV2/api_auth_n_mappings.go +++ b/api/datadogV2/api_auth_n_mappings.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *AuthNMappingsApi) DeleteAuthNMapping(ctx _context.Context, authnMapping } localVarPath := localBasePath + "/api/v2/authn_mappings/{authn_mapping_id}" - localVarPath = strings.Replace(localVarPath, "{"+"authn_mapping_id"+"}", _neturl.PathEscape(datadog.ParameterToString(authnMappingId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{authn_mapping_id}", _neturl.PathEscape(datadog.ParameterToString(authnMappingId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *AuthNMappingsApi) GetAuthNMapping(ctx _context.Context, authnMappingId } localVarPath := localBasePath + "/api/v2/authn_mappings/{authn_mapping_id}" - localVarPath = strings.Replace(localVarPath, "{"+"authn_mapping_id"+"}", _neturl.PathEscape(datadog.ParameterToString(authnMappingId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{authn_mapping_id}", _neturl.PathEscape(datadog.ParameterToString(authnMappingId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -374,7 +373,7 @@ func (a *AuthNMappingsApi) UpdateAuthNMapping(ctx _context.Context, authnMapping } localVarPath := localBasePath + "/api/v2/authn_mappings/{authn_mapping_id}" - localVarPath = strings.Replace(localVarPath, "{"+"authn_mapping_id"+"}", _neturl.PathEscape(datadog.ParameterToString(authnMappingId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{authn_mapping_id}", _neturl.PathEscape(datadog.ParameterToString(authnMappingId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_aws_integration.go b/api/datadogV2/api_aws_integration.go index 554babae290..d05add9c057 100644 --- a/api/datadogV2/api_aws_integration.go +++ b/api/datadogV2/api_aws_integration.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -202,7 +201,7 @@ func (a *AWSIntegrationApi) DeleteAWSAccount(ctx _context.Context, awsAccountCon } localVarPath := localBasePath + "/api/v2/integration/aws/accounts/{aws_account_config_id}" - localVarPath = strings.Replace(localVarPath, "{"+"aws_account_config_id"+"}", _neturl.PathEscape(datadog.ParameterToString(awsAccountConfigId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{aws_account_config_id}", _neturl.PathEscape(datadog.ParameterToString(awsAccountConfigId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -273,7 +272,7 @@ func (a *AWSIntegrationApi) GetAWSAccount(ctx _context.Context, awsAccountConfig } localVarPath := localBasePath + "/api/v2/integration/aws/accounts/{aws_account_config_id}" - localVarPath = strings.Replace(localVarPath, "{"+"aws_account_config_id"+"}", _neturl.PathEscape(datadog.ParameterToString(awsAccountConfigId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{aws_account_config_id}", _neturl.PathEscape(datadog.ParameterToString(awsAccountConfigId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -539,7 +538,7 @@ func (a *AWSIntegrationApi) UpdateAWSAccount(ctx _context.Context, awsAccountCon } localVarPath := localBasePath + "/api/v2/integration/aws/accounts/{aws_account_config_id}" - localVarPath = strings.Replace(localVarPath, "{"+"aws_account_config_id"+"}", _neturl.PathEscape(datadog.ParameterToString(awsAccountConfigId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{aws_account_config_id}", _neturl.PathEscape(datadog.ParameterToString(awsAccountConfigId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_case_management.go b/api/datadogV2/api_case_management.go index f391ce0f202..86e719828e1 100644 --- a/api/datadogV2/api_case_management.go +++ b/api/datadogV2/api_case_management.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *CaseManagementApi) ArchiveCase(ctx _context.Context, caseId string, bod } localVarPath := localBasePath + "/api/v2/cases/{case_id}/archive" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -105,7 +104,7 @@ func (a *CaseManagementApi) AssignCase(ctx _context.Context, caseId string, body } localVarPath := localBasePath + "/api/v2/cases/{case_id}/assign" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -324,7 +323,7 @@ func (a *CaseManagementApi) DeleteProject(ctx _context.Context, projectId string } localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" - localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", _neturl.PathEscape(datadog.ParameterToString(projectId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -386,7 +385,7 @@ func (a *CaseManagementApi) GetCase(ctx _context.Context, caseId string) (CaseRe } localVarPath := localBasePath + "/api/v2/cases/{case_id}" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -457,7 +456,7 @@ func (a *CaseManagementApi) GetProject(ctx _context.Context, projectId string) ( } localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" - localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", _neturl.PathEscape(datadog.ParameterToString(projectId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -784,7 +783,7 @@ func (a *CaseManagementApi) UnarchiveCase(ctx _context.Context, caseId string, b } localVarPath := localBasePath + "/api/v2/cases/{case_id}/unarchive" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -858,7 +857,7 @@ func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, bo } localVarPath := localBasePath + "/api/v2/cases/{case_id}/unassign" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -932,7 +931,7 @@ func (a *CaseManagementApi) UpdatePriority(ctx _context.Context, caseId string, } localVarPath := localBasePath + "/api/v2/cases/{case_id}/priority" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1006,7 +1005,7 @@ func (a *CaseManagementApi) UpdateStatus(ctx _context.Context, caseId string, bo } localVarPath := localBasePath + "/api/v2/cases/{case_id}/status" - localVarPath = strings.Replace(localVarPath, "{"+"case_id"+"}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_cloud_cost_management.go b/api/datadogV2/api_cloud_cost_management.go index 6049530a61b..a330d0066da 100644 --- a/api/datadogV2/api_cloud_cost_management.go +++ b/api/datadogV2/api_cloud_cost_management.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -176,7 +175,7 @@ func (a *CloudCostManagementApi) DeleteCostAWSCURConfig(ctx _context.Context, cl } localVarPath := localBasePath + "/api/v2/cost/aws_cur_config/{cloud_account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"cloud_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -237,7 +236,7 @@ func (a *CloudCostManagementApi) DeleteCostAzureUCConfig(ctx _context.Context, c } localVarPath := localBasePath + "/api/v2/cost/azure_uc_config/{cloud_account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"cloud_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -298,7 +297,7 @@ func (a *CloudCostManagementApi) DeleteCustomCostsFile(ctx _context.Context, fil } localVarPath := localBasePath + "/api/v2/cost/custom_costs/{file_id}" - localVarPath = strings.Replace(localVarPath, "{"+"file_id"+"}", _neturl.PathEscape(datadog.ParameterToString(fileId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{file_id}", _neturl.PathEscape(datadog.ParameterToString(fileId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -360,7 +359,7 @@ func (a *CloudCostManagementApi) GetCustomCostsFile(ctx _context.Context, fileId } localVarPath := localBasePath + "/api/v2/cost/custom_costs/{file_id}" - localVarPath = strings.Replace(localVarPath, "{"+"file_id"+"}", _neturl.PathEscape(datadog.ParameterToString(fileId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{file_id}", _neturl.PathEscape(datadog.ParameterToString(fileId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -641,7 +640,7 @@ func (a *CloudCostManagementApi) UpdateCostAWSCURConfig(ctx _context.Context, cl } localVarPath := localBasePath + "/api/v2/cost/aws_cur_config/{cloud_account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"cloud_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -715,7 +714,7 @@ func (a *CloudCostManagementApi) UpdateCostAzureUCConfigs(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/cost/azure_uc_config/{cloud_account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"cloud_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_cloudflare_integration.go b/api/datadogV2/api_cloudflare_integration.go index 3f88e6fecfd..d478a8c0f34 100644 --- a/api/datadogV2/api_cloudflare_integration.go +++ b/api/datadogV2/api_cloudflare_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *CloudflareIntegrationApi) DeleteCloudflareAccount(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/integrations/cloudflare/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *CloudflareIntegrationApi) GetCloudflareAccount(ctx _context.Context, ac } localVarPath := localBasePath + "/api/v2/integrations/cloudflare/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -306,7 +305,7 @@ func (a *CloudflareIntegrationApi) UpdateCloudflareAccount(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/integrations/cloudflare/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_confluent_cloud.go b/api/datadogV2/api_confluent_cloud.go index eb2e16529eb..3f745d60123 100644 --- a/api/datadogV2/api_confluent_cloud.go +++ b/api/datadogV2/api_confluent_cloud.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *ConfluentCloudApi) CreateConfluentResource(ctx _context.Context, accoun } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -177,7 +176,7 @@ func (a *ConfluentCloudApi) DeleteConfluentAccount(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -238,8 +237,8 @@ func (a *ConfluentCloudApi) DeleteConfluentResource(ctx _context.Context, accoun } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"resource_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resourceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{resource_id}", _neturl.PathEscape(datadog.ParameterToString(resourceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -301,7 +300,7 @@ func (a *ConfluentCloudApi) GetConfluentAccount(ctx _context.Context, accountId } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -372,8 +371,8 @@ func (a *ConfluentCloudApi) GetConfluentResource(ctx _context.Context, accountId } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"resource_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resourceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{resource_id}", _neturl.PathEscape(datadog.ParameterToString(resourceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -514,7 +513,7 @@ func (a *ConfluentCloudApi) ListConfluentResource(ctx _context.Context, accountI } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -585,7 +584,7 @@ func (a *ConfluentCloudApi) UpdateConfluentAccount(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -659,8 +658,8 @@ func (a *ConfluentCloudApi) UpdateConfluentResource(ctx _context.Context, accoun } localVarPath := localBasePath + "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"resource_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resourceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{resource_id}", _neturl.PathEscape(datadog.ParameterToString(resourceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_csm_threats.go b/api/datadogV2/api_csm_threats.go index ccfba17dffe..88a18bedd44 100644 --- a/api/datadogV2/api_csm_threats.go +++ b/api/datadogV2/api_csm_threats.go @@ -9,7 +9,6 @@ import ( _io "io" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -177,7 +176,7 @@ func (a *CSMThreatsApi) DeleteCSMThreatsAgentRule(ctx _context.Context, agentRul } localVarPath := localBasePath + "/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"agent_rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{agent_rule_id}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -238,7 +237,7 @@ func (a *CSMThreatsApi) DeleteCloudWorkloadSecurityAgentRule(ctx _context.Contex } localVarPath := localBasePath + "/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"agent_rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{agent_rule_id}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -428,7 +427,7 @@ func (a *CSMThreatsApi) GetCSMThreatsAgentRule(ctx _context.Context, agentRuleId } localVarPath := localBasePath + "/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"agent_rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{agent_rule_id}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -499,7 +498,7 @@ func (a *CSMThreatsApi) GetCloudWorkloadSecurityAgentRule(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"agent_rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{agent_rule_id}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -711,7 +710,7 @@ func (a *CSMThreatsApi) UpdateCSMThreatsAgentRule(ctx _context.Context, agentRul } localVarPath := localBasePath + "/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"agent_rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{agent_rule_id}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -786,7 +785,7 @@ func (a *CSMThreatsApi) UpdateCloudWorkloadSecurityAgentRule(ctx _context.Contex } localVarPath := localBasePath + "/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"agent_rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{agent_rule_id}", _neturl.PathEscape(datadog.ParameterToString(agentRuleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_dashboard_lists.go b/api/datadogV2/api_dashboard_lists.go index 629a9a102fc..72c7aa7a57c 100644 --- a/api/datadogV2/api_dashboard_lists.go +++ b/api/datadogV2/api_dashboard_lists.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *DashboardListsApi) CreateDashboardListItems(ctx _context.Context, dashb } localVarPath := localBasePath + "/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_list_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -105,7 +104,7 @@ func (a *DashboardListsApi) DeleteDashboardListItems(ctx _context.Context, dashb } localVarPath := localBasePath + "/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_list_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -179,7 +178,7 @@ func (a *DashboardListsApi) GetDashboardListItems(ctx _context.Context, dashboar } localVarPath := localBasePath + "/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_list_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -250,7 +249,7 @@ func (a *DashboardListsApi) UpdateDashboardListItems(ctx _context.Context, dashb } localVarPath := localBasePath + "/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards" - localVarPath = strings.Replace(localVarPath, "{"+"dashboard_list_id"+"}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_list_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardListId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_data_deletion.go b/api/datadogV2/api_data_deletion.go index c382a3087af..2027567a77a 100644 --- a/api/datadogV2/api_data_deletion.go +++ b/api/datadogV2/api_data_deletion.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -42,7 +41,7 @@ func (a *DataDeletionApi) CancelDataDeletionRequest(ctx _context.Context, id str } localVarPath := localBasePath + "/api/v2/deletion/requests/{id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -122,7 +121,7 @@ func (a *DataDeletionApi) CreateDataDeletionRequest(ctx _context.Context, produc } localVarPath := localBasePath + "/api/v2/deletion/data/{product}" - localVarPath = strings.Replace(localVarPath, "{"+"product"+"}", _neturl.PathEscape(datadog.ParameterToString(product, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{product}", _neturl.PathEscape(datadog.ParameterToString(product, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_downtimes.go b/api/datadogV2/api_downtimes.go index ee1407ec198..438f8b9e3ac 100644 --- a/api/datadogV2/api_downtimes.go +++ b/api/datadogV2/api_downtimes.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -30,7 +29,7 @@ func (a *DowntimesApi) CancelDowntime(ctx _context.Context, downtimeId string) ( } localVarPath := localBasePath + "/api/v2/downtime/{downtime_id}" - localVarPath = strings.Replace(localVarPath, "{"+"downtime_id"+"}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{downtime_id}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -190,7 +189,7 @@ func (a *DowntimesApi) GetDowntime(ctx _context.Context, downtimeId string, o .. } localVarPath := localBasePath + "/api/v2/downtime/{downtime_id}" - localVarPath = strings.Replace(localVarPath, "{"+"downtime_id"+"}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{downtime_id}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -474,7 +473,7 @@ func (a *DowntimesApi) ListMonitorDowntimes(ctx _context.Context, monitorId int6 } localVarPath := localBasePath + "/api/v2/monitor/{monitor_id}/downtime_matches" - localVarPath = strings.Replace(localVarPath, "{"+"monitor_id"+"}", _neturl.PathEscape(datadog.ParameterToString(monitorId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{monitor_id}", _neturl.PathEscape(datadog.ParameterToString(monitorId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -601,7 +600,7 @@ func (a *DowntimesApi) UpdateDowntime(ctx _context.Context, downtimeId string, b } localVarPath := localBasePath + "/api/v2/downtime/{downtime_id}" - localVarPath = strings.Replace(localVarPath, "{"+"downtime_id"+"}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{downtime_id}", _neturl.PathEscape(datadog.ParameterToString(downtimeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_fastly_integration.go b/api/datadogV2/api_fastly_integration.go index e8db897c730..3d6cdc8d39f 100644 --- a/api/datadogV2/api_fastly_integration.go +++ b/api/datadogV2/api_fastly_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *FastlyIntegrationApi) CreateFastlyService(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}/services" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -177,7 +176,7 @@ func (a *FastlyIntegrationApi) DeleteFastlyAccount(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -238,8 +237,8 @@ func (a *FastlyIntegrationApi) DeleteFastlyService(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_id}", _neturl.PathEscape(datadog.ParameterToString(serviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -301,7 +300,7 @@ func (a *FastlyIntegrationApi) GetFastlyAccount(ctx _context.Context, accountId } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -372,8 +371,8 @@ func (a *FastlyIntegrationApi) GetFastlyService(ctx _context.Context, accountId } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_id}", _neturl.PathEscape(datadog.ParameterToString(serviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -514,7 +513,7 @@ func (a *FastlyIntegrationApi) ListFastlyServices(ctx _context.Context, accountI } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}/services" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -585,7 +584,7 @@ func (a *FastlyIntegrationApi) UpdateFastlyAccount(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -659,8 +658,8 @@ func (a *FastlyIntegrationApi) UpdateFastlyService(ctx _context.Context, account } localVarPath := localBasePath + "/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_id}", _neturl.PathEscape(datadog.ParameterToString(serviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_gcp_integration.go b/api/datadogV2/api_gcp_integration.go index c241027d4da..efac506d178 100644 --- a/api/datadogV2/api_gcp_integration.go +++ b/api/datadogV2/api_gcp_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *GCPIntegrationApi) DeleteGCPSTSAccount(ctx _context.Context, accountId } localVarPath := localBasePath + "/api/v2/integration/gcp/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -405,7 +404,7 @@ func (a *GCPIntegrationApi) UpdateGCPSTSAccount(ctx _context.Context, accountId } localVarPath := localBasePath + "/api/v2/integration/gcp/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_incident_services.go b/api/datadogV2/api_incident_services.go index 157eb4a2a5a..5c4172cdc69 100644 --- a/api/datadogV2/api_incident_services.go +++ b/api/datadogV2/api_incident_services.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -127,7 +126,7 @@ func (a *IncidentServicesApi) DeleteIncidentService(ctx _context.Context, servic } localVarPath := localBasePath + "/api/v2/services/{service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_id}", _neturl.PathEscape(datadog.ParameterToString(serviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -226,7 +225,7 @@ func (a *IncidentServicesApi) GetIncidentService(ctx _context.Context, serviceId } localVarPath := localBasePath + "/api/v2/services/{service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_id}", _neturl.PathEscape(datadog.ParameterToString(serviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -450,7 +449,7 @@ func (a *IncidentServicesApi) UpdateIncidentService(ctx _context.Context, servic } localVarPath := localBasePath + "/api/v2/services/{service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_id}", _neturl.PathEscape(datadog.ParameterToString(serviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_incident_teams.go b/api/datadogV2/api_incident_teams.go index 6d5a9a029e1..aefb314e24e 100644 --- a/api/datadogV2/api_incident_teams.go +++ b/api/datadogV2/api_incident_teams.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -127,7 +126,7 @@ func (a *IncidentTeamsApi) DeleteIncidentTeam(ctx _context.Context, teamId strin } localVarPath := localBasePath + "/api/v2/teams/{team_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -226,7 +225,7 @@ func (a *IncidentTeamsApi) GetIncidentTeam(ctx _context.Context, teamId string, } localVarPath := localBasePath + "/api/v2/teams/{team_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -450,7 +449,7 @@ func (a *IncidentTeamsApi) UpdateIncidentTeam(ctx _context.Context, teamId strin } localVarPath := localBasePath + "/api/v2/teams/{team_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_incidents.go b/api/datadogV2/api_incidents.go index 163a7488e3f..a3925187a34 100644 --- a/api/datadogV2/api_incidents.go +++ b/api/datadogV2/api_incidents.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -124,7 +123,7 @@ func (a *IncidentsApi) CreateIncidentIntegration(ctx _context.Context, incidentI } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/integrations" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -207,7 +206,7 @@ func (a *IncidentsApi) CreateIncidentTodo(ctx _context.Context, incidentId strin } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/todos" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -371,7 +370,7 @@ func (a *IncidentsApi) DeleteIncident(ctx _context.Context, incidentId string) ( } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -441,8 +440,8 @@ func (a *IncidentsApi) DeleteIncidentIntegration(ctx _context.Context, incidentI } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integration_metadata_id"+"}", _neturl.PathEscape(datadog.ParameterToString(integrationMetadataId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_metadata_id}", _neturl.PathEscape(datadog.ParameterToString(integrationMetadataId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -512,8 +511,8 @@ func (a *IncidentsApi) DeleteIncidentTodo(ctx _context.Context, incidentId strin } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"todo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(todoId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{todo_id}", _neturl.PathEscape(datadog.ParameterToString(todoId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -583,7 +582,7 @@ func (a *IncidentsApi) DeleteIncidentType(ctx _context.Context, incidentTypeId s } localVarPath := localBasePath + "/api/v2/incidents/config/types/{incident_type_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_type_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentTypeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_type_id}", _neturl.PathEscape(datadog.ParameterToString(incidentTypeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -679,7 +678,7 @@ func (a *IncidentsApi) GetIncident(ctx _context.Context, incidentId string, o .. } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -762,8 +761,8 @@ func (a *IncidentsApi) GetIncidentIntegration(ctx _context.Context, incidentId s } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integration_metadata_id"+"}", _neturl.PathEscape(datadog.ParameterToString(integrationMetadataId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_metadata_id}", _neturl.PathEscape(datadog.ParameterToString(integrationMetadataId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -843,8 +842,8 @@ func (a *IncidentsApi) GetIncidentTodo(ctx _context.Context, incidentId string, } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"todo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(todoId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{todo_id}", _neturl.PathEscape(datadog.ParameterToString(todoId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -924,7 +923,7 @@ func (a *IncidentsApi) GetIncidentType(ctx _context.Context, incidentTypeId stri } localVarPath := localBasePath + "/api/v2/incidents/config/types/{incident_type_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_type_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentTypeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_type_id}", _neturl.PathEscape(datadog.ParameterToString(incidentTypeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1036,7 +1035,7 @@ func (a *IncidentsApi) ListIncidentAttachments(ctx _context.Context, incidentId } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/attachments" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1122,7 +1121,7 @@ func (a *IncidentsApi) ListIncidentIntegrations(ctx _context.Context, incidentId } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/integrations" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1202,7 +1201,7 @@ func (a *IncidentsApi) ListIncidentTodos(ctx _context.Context, incidentId string } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/todos" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1787,7 +1786,7 @@ func (a *IncidentsApi) UpdateIncident(ctx _context.Context, incidentId string, b } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1898,7 +1897,7 @@ func (a *IncidentsApi) UpdateIncidentAttachments(ctx _context.Context, incidentI } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/attachments" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1984,8 +1983,8 @@ func (a *IncidentsApi) UpdateIncidentIntegration(ctx _context.Context, incidentI } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integration_metadata_id"+"}", _neturl.PathEscape(datadog.ParameterToString(integrationMetadataId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_metadata_id}", _neturl.PathEscape(datadog.ParameterToString(integrationMetadataId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2068,8 +2067,8 @@ func (a *IncidentsApi) UpdateIncidentTodo(ctx _context.Context, incidentId strin } localVarPath := localBasePath + "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"todo_id"+"}", _neturl.PathEscape(datadog.ParameterToString(todoId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_id}", _neturl.PathEscape(datadog.ParameterToString(incidentId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{todo_id}", _neturl.PathEscape(datadog.ParameterToString(todoId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2152,7 +2151,7 @@ func (a *IncidentsApi) UpdateIncidentType(ctx _context.Context, incidentTypeId s } localVarPath := localBasePath + "/api/v2/incidents/config/types/{incident_type_id}" - localVarPath = strings.Replace(localVarPath, "{"+"incident_type_id"+"}", _neturl.PathEscape(datadog.ParameterToString(incidentTypeId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{incident_type_id}", _neturl.PathEscape(datadog.ParameterToString(incidentTypeId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_key_management.go b/api/datadogV2/api_key_management.go index a9235e3b038..7125c5fccc1 100644 --- a/api/datadogV2/api_key_management.go +++ b/api/datadogV2/api_key_management.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -176,7 +175,7 @@ func (a *KeyManagementApi) DeleteAPIKey(ctx _context.Context, apiKeyId string) ( } localVarPath := localBasePath + "/api/v2/api_keys/{api_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"api_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(apiKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{api_key_id}", _neturl.PathEscape(datadog.ParameterToString(apiKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -237,7 +236,7 @@ func (a *KeyManagementApi) DeleteApplicationKey(ctx _context.Context, appKeyId s } localVarPath := localBasePath + "/api/v2/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -298,7 +297,7 @@ func (a *KeyManagementApi) DeleteCurrentUserApplicationKey(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/current_user/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -385,7 +384,7 @@ func (a *KeyManagementApi) GetAPIKey(ctx _context.Context, apiKeyId string, o .. } localVarPath := localBasePath + "/api/v2/api_keys/{api_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"api_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(apiKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{api_key_id}", _neturl.PathEscape(datadog.ParameterToString(apiKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -484,7 +483,7 @@ func (a *KeyManagementApi) GetApplicationKey(ctx _context.Context, appKeyId stri } localVarPath := localBasePath + "/api/v2/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -558,7 +557,7 @@ func (a *KeyManagementApi) GetCurrentUserApplicationKey(ctx _context.Context, ap } localVarPath := localBasePath + "/api/v2/current_user/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1143,7 +1142,7 @@ func (a *KeyManagementApi) UpdateAPIKey(ctx _context.Context, apiKeyId string, b } localVarPath := localBasePath + "/api/v2/api_keys/{api_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"api_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(apiKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{api_key_id}", _neturl.PathEscape(datadog.ParameterToString(apiKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1217,7 +1216,7 @@ func (a *KeyManagementApi) UpdateApplicationKey(ctx _context.Context, appKeyId s } localVarPath := localBasePath + "/api/v2/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1291,7 +1290,7 @@ func (a *KeyManagementApi) UpdateCurrentUserApplicationKey(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/current_user/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_logs_archives.go b/api/datadogV2/api_logs_archives.go index c1d7b3f3ff4..ab9498ea675 100644 --- a/api/datadogV2/api_logs_archives.go +++ b/api/datadogV2/api_logs_archives.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -30,7 +29,7 @@ func (a *LogsArchivesApi) AddReadRoleToArchive(ctx _context.Context, archiveId s } localVarPath := localBasePath + "/api/v2/logs/config/archives/{archive_id}/readers" - localVarPath = strings.Replace(localVarPath, "{"+"archive_id"+"}", _neturl.PathEscape(datadog.ParameterToString(archiveId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{archive_id}", _neturl.PathEscape(datadog.ParameterToString(archiveId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -167,7 +166,7 @@ func (a *LogsArchivesApi) DeleteLogsArchive(ctx _context.Context, archiveId stri } localVarPath := localBasePath + "/api/v2/logs/config/archives/{archive_id}" - localVarPath = strings.Replace(localVarPath, "{"+"archive_id"+"}", _neturl.PathEscape(datadog.ParameterToString(archiveId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{archive_id}", _neturl.PathEscape(datadog.ParameterToString(archiveId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -229,7 +228,7 @@ func (a *LogsArchivesApi) GetLogsArchive(ctx _context.Context, archiveId string) } localVarPath := localBasePath + "/api/v2/logs/config/archives/{archive_id}" - localVarPath = strings.Replace(localVarPath, "{"+"archive_id"+"}", _neturl.PathEscape(datadog.ParameterToString(archiveId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{archive_id}", _neturl.PathEscape(datadog.ParameterToString(archiveId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -371,7 +370,7 @@ func (a *LogsArchivesApi) ListArchiveReadRoles(ctx _context.Context, archiveId s } localVarPath := localBasePath + "/api/v2/logs/config/archives/{archive_id}/readers" - localVarPath = strings.Replace(localVarPath, "{"+"archive_id"+"}", _neturl.PathEscape(datadog.ParameterToString(archiveId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{archive_id}", _neturl.PathEscape(datadog.ParameterToString(archiveId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -511,7 +510,7 @@ func (a *LogsArchivesApi) RemoveRoleFromArchive(ctx _context.Context, archiveId } localVarPath := localBasePath + "/api/v2/logs/config/archives/{archive_id}/readers" - localVarPath = strings.Replace(localVarPath, "{"+"archive_id"+"}", _neturl.PathEscape(datadog.ParameterToString(archiveId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{archive_id}", _neturl.PathEscape(datadog.ParameterToString(archiveId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -579,7 +578,7 @@ func (a *LogsArchivesApi) UpdateLogsArchive(ctx _context.Context, archiveId stri } localVarPath := localBasePath + "/api/v2/logs/config/archives/{archive_id}" - localVarPath = strings.Replace(localVarPath, "{"+"archive_id"+"}", _neturl.PathEscape(datadog.ParameterToString(archiveId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{archive_id}", _neturl.PathEscape(datadog.ParameterToString(archiveId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_logs_custom_destinations.go b/api/datadogV2/api_logs_custom_destinations.go index 7f9e63db644..9fc6a3e454f 100644 --- a/api/datadogV2/api_logs_custom_destinations.go +++ b/api/datadogV2/api_logs_custom_destinations.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *LogsCustomDestinationsApi) DeleteLogsCustomDestination(ctx _context.Con } localVarPath := localBasePath + "/api/v2/logs/config/custom-destinations/{custom_destination_id}" - localVarPath = strings.Replace(localVarPath, "{"+"custom_destination_id"+"}", _neturl.PathEscape(datadog.ParameterToString(customDestinationId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_destination_id}", _neturl.PathEscape(datadog.ParameterToString(customDestinationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *LogsCustomDestinationsApi) GetLogsCustomDestination(ctx _context.Contex } localVarPath := localBasePath + "/api/v2/logs/config/custom-destinations/{custom_destination_id}" - localVarPath = strings.Replace(localVarPath, "{"+"custom_destination_id"+"}", _neturl.PathEscape(datadog.ParameterToString(customDestinationId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_destination_id}", _neturl.PathEscape(datadog.ParameterToString(customDestinationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -306,7 +305,7 @@ func (a *LogsCustomDestinationsApi) UpdateLogsCustomDestination(ctx _context.Con } localVarPath := localBasePath + "/api/v2/logs/config/custom-destinations/{custom_destination_id}" - localVarPath = strings.Replace(localVarPath, "{"+"custom_destination_id"+"}", _neturl.PathEscape(datadog.ParameterToString(customDestinationId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_destination_id}", _neturl.PathEscape(datadog.ParameterToString(customDestinationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_logs_metrics.go b/api/datadogV2/api_logs_metrics.go index 45136ca35d6..199ab71f3bd 100644 --- a/api/datadogV2/api_logs_metrics.go +++ b/api/datadogV2/api_logs_metrics.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *LogsMetricsApi) DeleteLogsMetric(ctx _context.Context, metricId string) } localVarPath := localBasePath + "/api/v2/logs/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -166,7 +165,7 @@ func (a *LogsMetricsApi) GetLogsMetric(ctx _context.Context, metricId string) (L } localVarPath := localBasePath + "/api/v2/logs/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -308,7 +307,7 @@ func (a *LogsMetricsApi) UpdateLogsMetric(ctx _context.Context, metricId string, } localVarPath := localBasePath + "/api/v2/logs/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_metrics.go b/api/datadogV2/api_metrics.go index 971a6ce9547..d7346dfa7a2 100644 --- a/api/datadogV2/api_metrics.go +++ b/api/datadogV2/api_metrics.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -114,7 +113,7 @@ func (a *MetricsApi) CreateTagConfiguration(ctx _context.Context, metricName str } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/tags" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -264,7 +263,7 @@ func (a *MetricsApi) DeleteTagConfiguration(ctx _context.Context, metricName str } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/tags" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -379,7 +378,7 @@ func (a *MetricsApi) EstimateMetricsOutputSeries(ctx _context.Context, metricNam } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/estimate" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -490,7 +489,7 @@ func (a *MetricsApi) ListActiveMetricConfigurations(ctx _context.Context, metric } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/active-configurations" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -564,7 +563,7 @@ func (a *MetricsApi) ListMetricAssets(ctx _context.Context, metricName string) ( } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/assets" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -635,7 +634,7 @@ func (a *MetricsApi) ListTagConfigurationByName(ctx _context.Context, metricName } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/tags" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -945,7 +944,7 @@ func (a *MetricsApi) ListTagsByMetricName(ctx _context.Context, metricName strin } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/all-tags" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1018,7 +1017,7 @@ func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName st } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/volumes" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1354,7 +1353,7 @@ func (a *MetricsApi) UpdateTagConfiguration(ctx _context.Context, metricName str } localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/tags" - localVarPath = strings.Replace(localVarPath, "{"+"metric_name"+"}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_microsoft_teams_integration.go b/api/datadogV2/api_microsoft_teams_integration.go index a074189eea8..fe8f5f8d4db 100644 --- a/api/datadogV2/api_microsoft_teams_integration.go +++ b/api/datadogV2/api_microsoft_teams_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *MicrosoftTeamsIntegrationApi) DeleteTenantBasedHandle(ctx _context.Cont } localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}" - localVarPath = strings.Replace(localVarPath, "{"+"handle_id"+"}", _neturl.PathEscape(datadog.ParameterToString(handleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{handle_id}", _neturl.PathEscape(datadog.ParameterToString(handleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,9 +164,9 @@ func (a *MicrosoftTeamsIntegrationApi) GetChannelByName(ctx _context.Context, te } localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}" - localVarPath = strings.Replace(localVarPath, "{"+"tenant_name"+"}", _neturl.PathEscape(datadog.ParameterToString(tenantName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"team_name"+"}", _neturl.PathEscape(datadog.ParameterToString(teamName, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"channel_name"+"}", _neturl.PathEscape(datadog.ParameterToString(channelName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{tenant_name}", _neturl.PathEscape(datadog.ParameterToString(tenantName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_name}", _neturl.PathEscape(datadog.ParameterToString(teamName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{channel_name}", _neturl.PathEscape(datadog.ParameterToString(channelName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -238,7 +237,7 @@ func (a *MicrosoftTeamsIntegrationApi) GetTenantBasedHandle(ctx _context.Context } localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}" - localVarPath = strings.Replace(localVarPath, "{"+"handle_id"+"}", _neturl.PathEscape(datadog.ParameterToString(handleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{handle_id}", _neturl.PathEscape(datadog.ParameterToString(handleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -417,7 +416,7 @@ func (a *MicrosoftTeamsIntegrationApi) UpdateTenantBasedHandle(ctx _context.Cont } localVarPath := localBasePath + "/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}" - localVarPath = strings.Replace(localVarPath, "{"+"handle_id"+"}", _neturl.PathEscape(datadog.ParameterToString(handleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{handle_id}", _neturl.PathEscape(datadog.ParameterToString(handleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_monitors.go b/api/datadogV2/api_monitors.go index a2ac86578ae..2fdde1bd878 100644 --- a/api/datadogV2/api_monitors.go +++ b/api/datadogV2/api_monitors.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *MonitorsApi) DeleteMonitorConfigPolicy(ctx _context.Context, policyId s } localVarPath := localBasePath + "/api/v2/monitor/policy/{policy_id}" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", _neturl.PathEscape(datadog.ParameterToString(policyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{policy_id}", _neturl.PathEscape(datadog.ParameterToString(policyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *MonitorsApi) GetMonitorConfigPolicy(ctx _context.Context, policyId stri } localVarPath := localBasePath + "/api/v2/monitor/policy/{policy_id}" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", _neturl.PathEscape(datadog.ParameterToString(policyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{policy_id}", _neturl.PathEscape(datadog.ParameterToString(policyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -306,7 +305,7 @@ func (a *MonitorsApi) UpdateMonitorConfigPolicy(ctx _context.Context, policyId s } localVarPath := localBasePath + "/api/v2/monitor/policy/{policy_id}" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", _neturl.PathEscape(datadog.ParameterToString(policyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{policy_id}", _neturl.PathEscape(datadog.ParameterToString(policyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_network_device_monitoring.go b/api/datadogV2/api_network_device_monitoring.go index 105de413700..ba4df63e19d 100644 --- a/api/datadogV2/api_network_device_monitoring.go +++ b/api/datadogV2/api_network_device_monitoring.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *NetworkDeviceMonitoringApi) GetDevice(ctx _context.Context, deviceId st } localVarPath := localBasePath + "/api/v2/ndm/devices/{device_id}" - localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", _neturl.PathEscape(datadog.ParameterToString(deviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{device_id}", _neturl.PathEscape(datadog.ParameterToString(deviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -173,7 +172,7 @@ func (a *NetworkDeviceMonitoringApi) ListDeviceUserTags(ctx _context.Context, de } localVarPath := localBasePath + "/api/v2/ndm/tags/devices/{device_id}" - localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", _neturl.PathEscape(datadog.ParameterToString(deviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{device_id}", _neturl.PathEscape(datadog.ParameterToString(deviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -372,7 +371,7 @@ func (a *NetworkDeviceMonitoringApi) UpdateDeviceUserTags(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/ndm/tags/devices/{device_id}" - localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", _neturl.PathEscape(datadog.ParameterToString(deviceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{device_id}", _neturl.PathEscape(datadog.ParameterToString(deviceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_okta_integration.go b/api/datadogV2/api_okta_integration.go index 936b0793fa5..79b949b09b5 100644 --- a/api/datadogV2/api_okta_integration.go +++ b/api/datadogV2/api_okta_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *OktaIntegrationApi) DeleteOktaAccount(ctx _context.Context, accountId s } localVarPath := localBasePath + "/api/v2/integrations/okta/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *OktaIntegrationApi) GetOktaAccount(ctx _context.Context, accountId stri } localVarPath := localBasePath + "/api/v2/integrations/okta/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -306,7 +305,7 @@ func (a *OktaIntegrationApi) UpdateOktaAccount(ctx _context.Context, accountId s } localVarPath := localBasePath + "/api/v2/integrations/okta/accounts/{account_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(accountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_opsgenie_integration.go b/api/datadogV2/api_opsgenie_integration.go index febc4170a2e..7f7f84ce629 100644 --- a/api/datadogV2/api_opsgenie_integration.go +++ b/api/datadogV2/api_opsgenie_integration.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *OpsgenieIntegrationApi) DeleteOpsgenieService(ctx _context.Context, int } localVarPath := localBasePath + "/api/v2/integration/opsgenie/services/{integration_service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"integration_service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(integrationServiceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_service_id}", _neturl.PathEscape(datadog.ParameterToString(integrationServiceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *OpsgenieIntegrationApi) GetOpsgenieService(ctx _context.Context, integr } localVarPath := localBasePath + "/api/v2/integration/opsgenie/services/{integration_service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"integration_service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(integrationServiceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_service_id}", _neturl.PathEscape(datadog.ParameterToString(integrationServiceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -306,7 +305,7 @@ func (a *OpsgenieIntegrationApi) UpdateOpsgenieService(ctx _context.Context, int } localVarPath := localBasePath + "/api/v2/integration/opsgenie/services/{integration_service_id}" - localVarPath = strings.Replace(localVarPath, "{"+"integration_service_id"+"}", _neturl.PathEscape(datadog.ParameterToString(integrationServiceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_service_id}", _neturl.PathEscape(datadog.ParameterToString(integrationServiceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_organizations.go b/api/datadogV2/api_organizations.go index 8ac36228001..99c7cb83c4a 100644 --- a/api/datadogV2/api_organizations.go +++ b/api/datadogV2/api_organizations.go @@ -9,7 +9,6 @@ import ( _io "io" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -32,7 +31,7 @@ func (a *OrganizationsApi) GetOrgConfig(ctx _context.Context, orgConfigName stri } localVarPath := localBasePath + "/api/v2/org_configs/{org_config_name}" - localVarPath = strings.Replace(localVarPath, "{"+"org_config_name"+"}", _neturl.PathEscape(datadog.ParameterToString(orgConfigName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{org_config_name}", _neturl.PathEscape(datadog.ParameterToString(orgConfigName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -173,7 +172,7 @@ func (a *OrganizationsApi) UpdateOrgConfig(ctx _context.Context, orgConfigName s } localVarPath := localBasePath + "/api/v2/org_configs/{org_config_name}" - localVarPath = strings.Replace(localVarPath, "{"+"org_config_name"+"}", _neturl.PathEscape(datadog.ParameterToString(orgConfigName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{org_config_name}", _neturl.PathEscape(datadog.ParameterToString(orgConfigName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_powerpack.go b/api/datadogV2/api_powerpack.go index f2bbd7a6a8e..446d0df0c8e 100644 --- a/api/datadogV2/api_powerpack.go +++ b/api/datadogV2/api_powerpack.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *PowerpackApi) DeletePowerpack(ctx _context.Context, powerpackId string) } localVarPath := localBasePath + "/api/v2/powerpacks/{powerpack_id}" - localVarPath = strings.Replace(localVarPath, "{"+"powerpack_id"+"}", _neturl.PathEscape(datadog.ParameterToString(powerpackId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{powerpack_id}", _neturl.PathEscape(datadog.ParameterToString(powerpackId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -165,7 +164,7 @@ func (a *PowerpackApi) GetPowerpack(ctx _context.Context, powerpackId string) (P } localVarPath := localBasePath + "/api/v2/powerpacks/{powerpack_id}" - localVarPath = strings.Replace(localVarPath, "{"+"powerpack_id"+"}", _neturl.PathEscape(datadog.ParameterToString(powerpackId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{powerpack_id}", _neturl.PathEscape(datadog.ParameterToString(powerpackId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -394,7 +393,7 @@ func (a *PowerpackApi) UpdatePowerpack(ctx _context.Context, powerpackId string, } localVarPath := localBasePath + "/api/v2/powerpacks/{powerpack_id}" - localVarPath = strings.Replace(localVarPath, "{"+"powerpack_id"+"}", _neturl.PathEscape(datadog.ParameterToString(powerpackId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{powerpack_id}", _neturl.PathEscape(datadog.ParameterToString(powerpackId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_restriction_policies.go b/api/datadogV2/api_restriction_policies.go index 0edf731d1dc..38b3bb385e7 100644 --- a/api/datadogV2/api_restriction_policies.go +++ b/api/datadogV2/api_restriction_policies.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -30,7 +29,7 @@ func (a *RestrictionPoliciesApi) DeleteRestrictionPolicy(ctx _context.Context, r } localVarPath := localBasePath + "/api/v2/restriction_policy/{resource_id}" - localVarPath = strings.Replace(localVarPath, "{"+"resource_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resourceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{resource_id}", _neturl.PathEscape(datadog.ParameterToString(resourceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -92,7 +91,7 @@ func (a *RestrictionPoliciesApi) GetRestrictionPolicy(ctx _context.Context, reso } localVarPath := localBasePath + "/api/v2/restriction_policy/{resource_id}" - localVarPath = strings.Replace(localVarPath, "{"+"resource_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resourceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{resource_id}", _neturl.PathEscape(datadog.ParameterToString(resourceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -190,7 +189,7 @@ func (a *RestrictionPoliciesApi) UpdateRestrictionPolicy(ctx _context.Context, r } localVarPath := localBasePath + "/api/v2/restriction_policy/{resource_id}" - localVarPath = strings.Replace(localVarPath, "{"+"resource_id"+"}", _neturl.PathEscape(datadog.ParameterToString(resourceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{resource_id}", _neturl.PathEscape(datadog.ParameterToString(resourceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_roles.go b/api/datadogV2/api_roles.go index d5a7d1ead84..ae65b293da9 100644 --- a/api/datadogV2/api_roles.go +++ b/api/datadogV2/api_roles.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,7 +30,7 @@ func (a *RolesApi) AddPermissionToRole(ctx _context.Context, roleId string, body } localVarPath := localBasePath + "/api/v2/roles/{role_id}/permissions" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -105,7 +104,7 @@ func (a *RolesApi) AddUserToRole(ctx _context.Context, roleId string, body Relat } localVarPath := localBasePath + "/api/v2/roles/{role_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -179,7 +178,7 @@ func (a *RolesApi) CloneRole(ctx _context.Context, roleId string, body RoleClone } localVarPath := localBasePath + "/api/v2/roles/{role_id}/clone" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -325,7 +324,7 @@ func (a *RolesApi) DeleteRole(ctx _context.Context, roleId string) (*_nethttp.Re } localVarPath := localBasePath + "/api/v2/roles/{role_id}" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -387,7 +386,7 @@ func (a *RolesApi) GetRole(ctx _context.Context, roleId string) (RoleResponse, * } localVarPath := localBasePath + "/api/v2/roles/{role_id}" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -528,7 +527,7 @@ func (a *RolesApi) ListRolePermissions(ctx _context.Context, roleId string) (Per } localVarPath := localBasePath + "/api/v2/roles/{role_id}/permissions" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -645,7 +644,7 @@ func (a *RolesApi) ListRoleUsers(ctx _context.Context, roleId string, o ...ListR } localVarPath := localBasePath + "/api/v2/roles/{role_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -866,7 +865,7 @@ func (a *RolesApi) RemovePermissionFromRole(ctx _context.Context, roleId string, } localVarPath := localBasePath + "/api/v2/roles/{role_id}/permissions" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -940,7 +939,7 @@ func (a *RolesApi) RemoveUserFromRole(ctx _context.Context, roleId string, body } localVarPath := localBasePath + "/api/v2/roles/{role_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1014,7 +1013,7 @@ func (a *RolesApi) UpdateRole(ctx _context.Context, roleId string, body RoleUpda } localVarPath := localBasePath + "/api/v2/roles/{role_id}" - localVarPath = strings.Replace(localVarPath, "{"+"role_id"+"}", _neturl.PathEscape(datadog.ParameterToString(roleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{role_id}", _neturl.PathEscape(datadog.ParameterToString(roleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_rum.go b/api/datadogV2/api_rum.go index a2d89bcaba6..62d328bb1b2 100644 --- a/api/datadogV2/api_rum.go +++ b/api/datadogV2/api_rum.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "time" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" @@ -177,7 +176,7 @@ func (a *RUMApi) DeleteRUMApplication(ctx _context.Context, id string) (*_nethtt } localVarPath := localBasePath + "/api/v2/rum/applications/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -239,7 +238,7 @@ func (a *RUMApi) GetRUMApplication(ctx _context.Context, id string) (RUMApplicat } localVarPath := localBasePath + "/api/v2/rum/applications/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -729,7 +728,7 @@ func (a *RUMApi) UpdateRUMApplication(ctx _context.Context, id string, body RUMA } localVarPath := localBasePath + "/api/v2/rum/applications/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(datadog.ParameterToString(id, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_rum_metrics.go b/api/datadogV2/api_rum_metrics.go index 8af90fd9763..663f331669d 100644 --- a/api/datadogV2/api_rum_metrics.go +++ b/api/datadogV2/api_rum_metrics.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *RumMetricsApi) DeleteRumMetric(ctx _context.Context, metricId string) ( } localVarPath := localBasePath + "/api/v2/rum/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -166,7 +165,7 @@ func (a *RumMetricsApi) GetRumMetric(ctx _context.Context, metricId string) (Rum } localVarPath := localBasePath + "/api/v2/rum/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -308,7 +307,7 @@ func (a *RumMetricsApi) UpdateRumMetric(ctx _context.Context, metricId string, b } localVarPath := localBasePath + "/api/v2/rum/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_security_monitoring.go b/api/datadogV2/api_security_monitoring.go index bf313c121f5..334b89bab0d 100644 --- a/api/datadogV2/api_security_monitoring.go +++ b/api/datadogV2/api_security_monitoring.go @@ -11,7 +11,6 @@ import ( _nethttp "net/http" _neturl "net/url" "reflect" - "strings" "time" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" @@ -43,7 +42,7 @@ func (a *SecurityMonitoringApi) CancelHistoricalJob(ctx _context.Context, jobId } localVarPath := localBasePath + "/api/v2/siem-historical-detections/jobs/{job_id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", _neturl.PathEscape(datadog.ParameterToString(jobId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{job_id}", _neturl.PathEscape(datadog.ParameterToString(jobId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -106,7 +105,7 @@ func (a *SecurityMonitoringApi) ConvertExistingSecurityMonitoringRule(ctx _conte } localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}/convert" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -553,7 +552,7 @@ func (a *SecurityMonitoringApi) DeleteHistoricalJob(ctx _context.Context, jobId } localVarPath := localBasePath + "/api/v2/siem-historical-detections/jobs/{job_id}" - localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", _neturl.PathEscape(datadog.ParameterToString(jobId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{job_id}", _neturl.PathEscape(datadog.ParameterToString(jobId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -614,7 +613,7 @@ func (a *SecurityMonitoringApi) DeleteSecurityFilter(ctx _context.Context, secur } localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - localVarPath = strings.Replace(localVarPath, "{"+"security_filter_id"+"}", _neturl.PathEscape(datadog.ParameterToString(securityFilterId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{security_filter_id}", _neturl.PathEscape(datadog.ParameterToString(securityFilterId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -675,7 +674,7 @@ func (a *SecurityMonitoringApi) DeleteSecurityMonitoringRule(ctx _context.Contex } localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -736,7 +735,7 @@ func (a *SecurityMonitoringApi) DeleteSecurityMonitoringSuppression(ctx _context } localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - localVarPath = strings.Replace(localVarPath, "{"+"suppression_id"+"}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -798,7 +797,7 @@ func (a *SecurityMonitoringApi) EditSecurityMonitoringSignalAssignee(ctx _contex } localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}/assignee" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -872,7 +871,7 @@ func (a *SecurityMonitoringApi) EditSecurityMonitoringSignalIncidents(ctx _conte } localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}/incidents" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -946,7 +945,7 @@ func (a *SecurityMonitoringApi) EditSecurityMonitoringSignalState(ctx _context.C } localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}/state" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1054,7 +1053,7 @@ func (a *SecurityMonitoringApi) GetFinding(ctx _context.Context, findingId strin } localVarPath := localBasePath + "/api/v2/posture_management/findings/{finding_id}" - localVarPath = strings.Replace(localVarPath, "{"+"finding_id"+"}", _neturl.PathEscape(datadog.ParameterToString(findingId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{finding_id}", _neturl.PathEscape(datadog.ParameterToString(findingId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1137,7 +1136,7 @@ func (a *SecurityMonitoringApi) GetHistoricalJob(ctx _context.Context, jobId str } localVarPath := localBasePath + "/api/v2/siem-historical-detections/jobs/{job_id}" - localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", _neturl.PathEscape(datadog.ParameterToString(jobId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{job_id}", _neturl.PathEscape(datadog.ParameterToString(jobId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1211,7 +1210,7 @@ func (a *SecurityMonitoringApi) GetSecurityFilter(ctx _context.Context, security } localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - localVarPath = strings.Replace(localVarPath, "{"+"security_filter_id"+"}", _neturl.PathEscape(datadog.ParameterToString(securityFilterId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{security_filter_id}", _neturl.PathEscape(datadog.ParameterToString(securityFilterId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1282,7 +1281,7 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringRule(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1353,7 +1352,7 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringSignal(ctx _context.Context } localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}" - localVarPath = strings.Replace(localVarPath, "{"+"signal_id"+"}", _neturl.PathEscape(datadog.ParameterToString(signalId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1424,7 +1423,7 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringSuppression(ctx _context.Co } localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - localVarPath = strings.Replace(localVarPath, "{"+"suppression_id"+"}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2742,7 +2741,7 @@ func (a *SecurityMonitoringApi) TestExistingSecurityMonitoringRule(ctx _context. } localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}/test" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2890,7 +2889,7 @@ func (a *SecurityMonitoringApi) UpdateSecurityFilter(ctx _context.Context, secur } localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - localVarPath = strings.Replace(localVarPath, "{"+"security_filter_id"+"}", _neturl.PathEscape(datadog.ParameterToString(securityFilterId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{security_filter_id}", _neturl.PathEscape(datadog.ParameterToString(securityFilterId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2967,7 +2966,7 @@ func (a *SecurityMonitoringApi) UpdateSecurityMonitoringRule(ctx _context.Contex } localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -3041,7 +3040,7 @@ func (a *SecurityMonitoringApi) UpdateSecurityMonitoringSuppression(ctx _context } localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - localVarPath = strings.Replace(localVarPath, "{"+"suppression_id"+"}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_sensitive_data_scanner.go b/api/datadogV2/api_sensitive_data_scanner.go index 18668421baf..0db59e5c1de 100644 --- a/api/datadogV2/api_sensitive_data_scanner.go +++ b/api/datadogV2/api_sensitive_data_scanner.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -185,7 +184,7 @@ func (a *SensitiveDataScannerApi) DeleteScanningGroup(ctx _context.Context, grou } localVarPath := localBasePath + "/api/v2/sensitive-data-scanner/config/groups/{group_id}" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.PathEscape(datadog.ParameterToString(groupId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{group_id}", _neturl.PathEscape(datadog.ParameterToString(groupId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -259,7 +258,7 @@ func (a *SensitiveDataScannerApi) DeleteScanningRule(ctx _context.Context, ruleI } localVarPath := localBasePath + "/api/v2/sensitive-data-scanner/config/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -549,7 +548,7 @@ func (a *SensitiveDataScannerApi) UpdateScanningGroup(ctx _context.Context, grou } localVarPath := localBasePath + "/api/v2/sensitive-data-scanner/config/groups/{group_id}" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", _neturl.PathEscape(datadog.ParameterToString(groupId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{group_id}", _neturl.PathEscape(datadog.ParameterToString(groupId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -626,7 +625,7 @@ func (a *SensitiveDataScannerApi) UpdateScanningRule(ctx _context.Context, ruleI } localVarPath := localBasePath + "/api/v2/sensitive-data-scanner/config/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_service_accounts.go b/api/datadogV2/api_service_accounts.go index 16dffa6ee1f..e59bdbada2e 100644 --- a/api/datadogV2/api_service_accounts.go +++ b/api/datadogV2/api_service_accounts.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *ServiceAccountsApi) CreateServiceAccountApplicationKey(ctx _context.Con } localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/application_keys" - localVarPath = strings.Replace(localVarPath, "{"+"service_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -177,8 +176,8 @@ func (a *ServiceAccountsApi) DeleteServiceAccountApplicationKey(ctx _context.Con } localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"service_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -240,8 +239,8 @@ func (a *ServiceAccountsApi) GetServiceAccountApplicationKey(ctx _context.Contex } localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"service_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -372,7 +371,7 @@ func (a *ServiceAccountsApi) ListServiceAccountApplicationKeys(ctx _context.Cont } localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/application_keys" - localVarPath = strings.Replace(localVarPath, "{"+"service_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -461,8 +460,8 @@ func (a *ServiceAccountsApi) UpdateServiceAccountApplicationKey(ctx _context.Con } localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}" - localVarPath = strings.Replace(localVarPath, "{"+"service_account_id"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"app_key_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_service_definition.go b/api/datadogV2/api_service_definition.go index dd87e855040..4f001a8aa6f 100644 --- a/api/datadogV2/api_service_definition.go +++ b/api/datadogV2/api_service_definition.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -103,7 +102,7 @@ func (a *ServiceDefinitionApi) DeleteServiceDefinition(ctx _context.Context, ser } localVarPath := localBasePath + "/api/v2/services/definitions/{service_name}" - localVarPath = strings.Replace(localVarPath, "{"+"service_name"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_name}", _neturl.PathEscape(datadog.ParameterToString(serviceName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -190,7 +189,7 @@ func (a *ServiceDefinitionApi) GetServiceDefinition(ctx _context.Context, servic } localVarPath := localBasePath + "/api/v2/services/definitions/{service_name}" - localVarPath = strings.Replace(localVarPath, "{"+"service_name"+"}", _neturl.PathEscape(datadog.ParameterToString(serviceName, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_name}", _neturl.PathEscape(datadog.ParameterToString(serviceName, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_service_level_objectives.go b/api/datadogV2/api_service_level_objectives.go index ec5100df1a9..da3e8173897 100644 --- a/api/datadogV2/api_service_level_objectives.go +++ b/api/datadogV2/api_service_level_objectives.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -128,7 +127,7 @@ func (a *ServiceLevelObjectivesApi) GetSLOReport(ctx _context.Context, reportId } localVarPath := localBasePath + "/api/v2/slo/report/{report_id}/download" - localVarPath = strings.Replace(localVarPath, "{"+"report_id"+"}", _neturl.PathEscape(datadog.ParameterToString(reportId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{report_id}", _neturl.PathEscape(datadog.ParameterToString(reportId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -208,7 +207,7 @@ func (a *ServiceLevelObjectivesApi) GetSLOReportJobStatus(ctx _context.Context, } localVarPath := localBasePath + "/api/v2/slo/report/{report_id}/status" - localVarPath = strings.Replace(localVarPath, "{"+"report_id"+"}", _neturl.PathEscape(datadog.ParameterToString(reportId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{report_id}", _neturl.PathEscape(datadog.ParameterToString(reportId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_service_scorecards.go b/api/datadogV2/api_service_scorecards.go index 1faf6a5c931..2b840803b49 100644 --- a/api/datadogV2/api_service_scorecards.go +++ b/api/datadogV2/api_service_scorecards.go @@ -10,7 +10,6 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -205,7 +204,7 @@ func (a *ServiceScorecardsApi) DeleteScorecardRule(ctx _context.Context, ruleId } localVarPath := localBasePath + "/api/v2/scorecard/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -770,7 +769,7 @@ func (a *ServiceScorecardsApi) UpdateScorecardRule(ctx _context.Context, ruleId } localVarPath := localBasePath + "/api/v2/scorecard/rules/{rule_id}" - localVarPath = strings.Replace(localVarPath, "{"+"rule_id"+"}", _neturl.PathEscape(datadog.ParameterToString(ruleId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_software_catalog.go b/api/datadogV2/api_software_catalog.go index 2016ed8b9ec..ee4ea59a955 100644 --- a/api/datadogV2/api_software_catalog.go +++ b/api/datadogV2/api_software_catalog.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -30,7 +29,7 @@ func (a *SoftwareCatalogApi) DeleteCatalogEntity(ctx _context.Context, entityId } localVarPath := localBasePath + "/api/v2/catalog/entity/{entity_id}" - localVarPath = strings.Replace(localVarPath, "{"+"entity_id"+"}", _neturl.PathEscape(datadog.ParameterToString(entityId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{entity_id}", _neturl.PathEscape(datadog.ParameterToString(entityId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_spans_metrics.go b/api/datadogV2/api_spans_metrics.go index 8179f7b032a..1ae8de68a9b 100644 --- a/api/datadogV2/api_spans_metrics.go +++ b/api/datadogV2/api_spans_metrics.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *SpansMetricsApi) DeleteSpansMetric(ctx _context.Context, metricId strin } localVarPath := localBasePath + "/api/v2/apm/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -166,7 +165,7 @@ func (a *SpansMetricsApi) GetSpansMetric(ctx _context.Context, metricId string) } localVarPath := localBasePath + "/api/v2/apm/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -308,7 +307,7 @@ func (a *SpansMetricsApi) UpdateSpansMetric(ctx _context.Context, metricId strin } localVarPath := localBasePath + "/api/v2/apm/config/metrics/{metric_id}" - localVarPath = strings.Replace(localVarPath, "{"+"metric_id"+"}", _neturl.PathEscape(datadog.ParameterToString(metricId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_id}", _neturl.PathEscape(datadog.ParameterToString(metricId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_teams.go b/api/datadogV2/api_teams.go index 4fe12bc19f0..662ef493c8c 100644 --- a/api/datadogV2/api_teams.go +++ b/api/datadogV2/api_teams.go @@ -9,7 +9,6 @@ import ( _nethttp "net/http" _neturl "net/url" "reflect" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -106,7 +105,7 @@ func (a *TeamsApi) CreateTeamLink(ctx _context.Context, teamId string, body Team } localVarPath := localBasePath + "/api/v2/team/{team_id}/links" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -180,7 +179,7 @@ func (a *TeamsApi) CreateTeamMembership(ctx _context.Context, teamId string, bod } localVarPath := localBasePath + "/api/v2/team/{team_id}/memberships" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -253,7 +252,7 @@ func (a *TeamsApi) DeleteTeam(ctx _context.Context, teamId string) (*_nethttp.Re } localVarPath := localBasePath + "/api/v2/team/{team_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -314,8 +313,8 @@ func (a *TeamsApi) DeleteTeamLink(ctx _context.Context, teamId string, linkId st } localVarPath := localBasePath + "/api/v2/team/{team_id}/links/{link_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"link_id"+"}", _neturl.PathEscape(datadog.ParameterToString(linkId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{link_id}", _neturl.PathEscape(datadog.ParameterToString(linkId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -376,8 +375,8 @@ func (a *TeamsApi) DeleteTeamMembership(ctx _context.Context, teamId string, use } localVarPath := localBasePath + "/api/v2/team/{team_id}/memberships/{user_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -439,7 +438,7 @@ func (a *TeamsApi) GetTeam(ctx _context.Context, teamId string) (TeamResponse, * } localVarPath := localBasePath + "/api/v2/team/{team_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -510,8 +509,8 @@ func (a *TeamsApi) GetTeamLink(ctx _context.Context, teamId string, linkId strin } localVarPath := localBasePath + "/api/v2/team/{team_id}/links/{link_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"link_id"+"}", _neturl.PathEscape(datadog.ParameterToString(linkId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{link_id}", _neturl.PathEscape(datadog.ParameterToString(linkId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -582,7 +581,7 @@ func (a *TeamsApi) GetTeamLinks(ctx _context.Context, teamId string) (TeamLinksR } localVarPath := localBasePath + "/api/v2/team/{team_id}/links" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -699,7 +698,7 @@ func (a *TeamsApi) GetTeamMemberships(ctx _context.Context, teamId string, o ... } localVarPath := localBasePath + "/api/v2/team/{team_id}/memberships" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -830,7 +829,7 @@ func (a *TeamsApi) GetTeamPermissionSettings(ctx _context.Context, teamId string } localVarPath := localBasePath + "/api/v2/team/{team_id}/permission-settings" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -901,7 +900,7 @@ func (a *TeamsApi) GetUserMemberships(ctx _context.Context, userUuid string) (Us } localVarPath := localBasePath + "/api/v2/users/{user_uuid}/memberships" - localVarPath = strings.Replace(localVarPath, "{"+"user_uuid"+"}", _neturl.PathEscape(datadog.ParameterToString(userUuid, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_uuid}", _neturl.PathEscape(datadog.ParameterToString(userUuid, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1188,7 +1187,7 @@ func (a *TeamsApi) UpdateTeam(ctx _context.Context, teamId string, body TeamUpda } localVarPath := localBasePath + "/api/v2/team/{team_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1262,8 +1261,8 @@ func (a *TeamsApi) UpdateTeamLink(ctx _context.Context, teamId string, linkId st } localVarPath := localBasePath + "/api/v2/team/{team_id}/links/{link_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"link_id"+"}", _neturl.PathEscape(datadog.ParameterToString(linkId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{link_id}", _neturl.PathEscape(datadog.ParameterToString(linkId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1337,8 +1336,8 @@ func (a *TeamsApi) UpdateTeamMembership(ctx _context.Context, teamId string, use } localVarPath := localBasePath + "/api/v2/team/{team_id}/memberships/{user_id}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1412,8 +1411,8 @@ func (a *TeamsApi) UpdateTeamPermissionSetting(ctx _context.Context, teamId stri } localVarPath := localBasePath + "/api/v2/team/{team_id}/permission-settings/{action}" - localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.PathEscape(datadog.ParameterToString(teamId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"action"+"}", _neturl.PathEscape(datadog.ParameterToString(action, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{team_id}", _neturl.PathEscape(datadog.ParameterToString(teamId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{action}", _neturl.PathEscape(datadog.ParameterToString(action, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_users.go b/api/datadogV2/api_users.go index a476f83ea84..c23b0c88a54 100644 --- a/api/datadogV2/api_users.go +++ b/api/datadogV2/api_users.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -104,7 +103,7 @@ func (a *UsersApi) DisableUser(ctx _context.Context, userId string) (*_nethttp.R } localVarPath := localBasePath + "/api/v2/users/{user_id}" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -166,7 +165,7 @@ func (a *UsersApi) GetInvitation(ctx _context.Context, userInvitationUuid string } localVarPath := localBasePath + "/api/v2/user_invitations/{user_invitation_uuid}" - localVarPath = strings.Replace(localVarPath, "{"+"user_invitation_uuid"+"}", _neturl.PathEscape(datadog.ParameterToString(userInvitationUuid, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_invitation_uuid}", _neturl.PathEscape(datadog.ParameterToString(userInvitationUuid, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -237,7 +236,7 @@ func (a *UsersApi) GetUser(ctx _context.Context, userId string) (UserResponse, * } localVarPath := localBasePath + "/api/v2/users/{user_id}" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -309,7 +308,7 @@ func (a *UsersApi) ListUserOrganizations(ctx _context.Context, userId string) (U } localVarPath := localBasePath + "/api/v2/users/{user_id}/orgs" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -381,7 +380,7 @@ func (a *UsersApi) ListUserPermissions(ctx _context.Context, userId string) (Per } localVarPath := localBasePath + "/api/v2/users/{user_id}/permissions" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -723,7 +722,7 @@ func (a *UsersApi) UpdateUser(ctx _context.Context, userId string, body UserUpda } localVarPath := localBasePath + "/api/v2/users/{user_id}" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", _neturl.PathEscape(datadog.ParameterToString(userId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_id}", _neturl.PathEscape(datadog.ParameterToString(userId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_workflow_automation.go b/api/datadogV2/api_workflow_automation.go index 4c63db9c0c3..513266b1675 100644 --- a/api/datadogV2/api_workflow_automation.go +++ b/api/datadogV2/api_workflow_automation.go @@ -8,7 +8,6 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -31,8 +30,8 @@ func (a *WorkflowAutomationApi) CancelWorkflowInstance(ctx _context.Context, wor } localVarPath := localBasePath + "/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"workflow_id"+"}", _neturl.PathEscape(datadog.ParameterToString(workflowId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instance_id"+"}", _neturl.PathEscape(datadog.ParameterToString(instanceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{workflow_id}", _neturl.PathEscape(datadog.ParameterToString(workflowId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{instance_id}", _neturl.PathEscape(datadog.ParameterToString(instanceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -103,7 +102,7 @@ func (a *WorkflowAutomationApi) CreateWorkflowInstance(ctx _context.Context, wor } localVarPath := localBasePath + "/api/v2/workflows/{workflow_id}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"workflow_id"+"}", _neturl.PathEscape(datadog.ParameterToString(workflowId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{workflow_id}", _neturl.PathEscape(datadog.ParameterToString(workflowId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -177,8 +176,8 @@ func (a *WorkflowAutomationApi) GetWorkflowInstance(ctx _context.Context, workfl } localVarPath := localBasePath + "/api/v2/workflows/{workflow_id}/instances/{instance_id}" - localVarPath = strings.Replace(localVarPath, "{"+"workflow_id"+"}", _neturl.PathEscape(datadog.ParameterToString(workflowId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instance_id"+"}", _neturl.PathEscape(datadog.ParameterToString(instanceId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{workflow_id}", _neturl.PathEscape(datadog.ParameterToString(workflowId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{instance_id}", _neturl.PathEscape(datadog.ParameterToString(instanceId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -281,7 +280,7 @@ func (a *WorkflowAutomationApi) ListWorkflowInstances(ctx _context.Context, work } localVarPath := localBasePath + "/api/v2/workflows/{workflow_id}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"workflow_id"+"}", _neturl.PathEscape(datadog.ParameterToString(workflowId, "")), -1) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{workflow_id}", _neturl.PathEscape(datadog.ParameterToString(workflowId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{}