-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit d52b053f of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Sep 5, 2024
1 parent
f50b368
commit 18caced
Showing
10 changed files
with
509 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2019-Present Datadog, Inc. | ||
|
||
package datadogV2 | ||
|
||
import ( | ||
_context "context" | ||
_nethttp "net/http" | ||
_neturl "net/url" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
) | ||
|
||
// ASMExclusionFiltersApi service type | ||
type ASMExclusionFiltersApi datadog.Service | ||
|
||
// ListASMExclusionFilters List ASM Exclusion Filters. | ||
// Retrieve a list of ASM exclusion filters. | ||
func (a *ASMExclusionFiltersApi) ListASMExclusionFilters(ctx _context.Context) (ASMExclusionFilterResponse, *_nethttp.Response, error) { | ||
var ( | ||
localVarHTTPMethod = _nethttp.MethodGet | ||
localVarPostBody interface{} | ||
localVarReturnValue ASMExclusionFilterResponse | ||
) | ||
|
||
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ASMExclusionFiltersApi.ListASMExclusionFilters") | ||
if err != nil { | ||
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} | ||
} | ||
|
||
localVarPath := localBasePath + "/api/v2/remote_config/products/asm/waf/exclusion_filters" | ||
|
||
localVarHeaderParams := make(map[string]string) | ||
localVarQueryParams := _neturl.Values{} | ||
localVarFormParams := _neturl.Values{} | ||
localVarHeaderParams["Accept"] = "application/json" | ||
|
||
datadog.SetAuthKeys( | ||
ctx, | ||
&localVarHeaderParams, | ||
[2]string{"apiKeyAuth", "DD-API-KEY"}, | ||
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, | ||
) | ||
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) | ||
if err != nil { | ||
return localVarReturnValue, nil, err | ||
} | ||
|
||
localVarHTTPResponse, err := a.Client.CallAPI(req) | ||
if err != nil || localVarHTTPResponse == nil { | ||
return localVarReturnValue, localVarHTTPResponse, err | ||
} | ||
|
||
localVarBody, err := datadog.ReadBody(localVarHTTPResponse) | ||
if err != nil { | ||
return localVarReturnValue, localVarHTTPResponse, err | ||
} | ||
|
||
if localVarHTTPResponse.StatusCode >= 300 { | ||
newErr := datadog.GenericOpenAPIError{ | ||
ErrorBody: localVarBody, | ||
ErrorMessage: localVarHTTPResponse.Status, | ||
} | ||
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { | ||
var v APIErrorResponse | ||
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
return localVarReturnValue, localVarHTTPResponse, newErr | ||
} | ||
newErr.ErrorModel = v | ||
} | ||
return localVarReturnValue, localVarHTTPResponse, newErr | ||
} | ||
|
||
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) | ||
if err != nil { | ||
newErr := datadog.GenericOpenAPIError{ | ||
ErrorBody: localVarBody, | ||
ErrorMessage: err.Error(), | ||
} | ||
return localVarReturnValue, localVarHTTPResponse, newErr | ||
} | ||
|
||
return localVarReturnValue, localVarHTTPResponse, nil | ||
} | ||
|
||
// NewASMExclusionFiltersApi Returns NewASMExclusionFiltersApi. | ||
func NewASMExclusionFiltersApi(client *datadog.APIClient) *ASMExclusionFiltersApi { | ||
return &ASMExclusionFiltersApi{ | ||
Client: client, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.