Skip to content

Commit abc310a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a989199 of spec repo
1 parent 6be4c93 commit abc310a

19 files changed

+1096
-129
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 105 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23526,6 +23526,30 @@ components:
2352623526
required:
2352723527
- data
2352823528
type: object
23529+
GetSuppressionVersionHistoryData:
23530+
description: Data for the suppression version history.
23531+
properties:
23532+
attributes:
23533+
$ref: '#/components/schemas/SuppressionVersionHistory'
23534+
id:
23535+
description: ID of the suppression.
23536+
type: string
23537+
type:
23538+
$ref: '#/components/schemas/GetSuppressionVersionHistoryDataType'
23539+
type: object
23540+
GetSuppressionVersionHistoryDataType:
23541+
description: Type of data.
23542+
enum:
23543+
- suppression_version_history
23544+
type: string
23545+
x-enum-varnames:
23546+
- SUPPRESSIONVERSIONHISTORY
23547+
GetSuppressionVersionHistoryResponse:
23548+
description: Response for getting the suppression version history.
23549+
properties:
23550+
data:
23551+
$ref: '#/components/schemas/GetSuppressionVersionHistoryData'
23552+
type: object
2352923553
GetTeamMembershipsSort:
2353023554
description: Specifies the order of returned team memberships
2353123555
enum:
@@ -42745,38 +42769,13 @@ components:
4274542769
description: The `RuleVersionHistory` `data`.
4274642770
type: object
4274742771
type: object
42748-
RuleVersionUpdate:
42749-
description: A change in a rule version.
42750-
properties:
42751-
change:
42752-
description: The new value of the field.
42753-
example: cloud_provider:aws
42754-
type: string
42755-
field:
42756-
description: The field that was changed.
42757-
example: Tags
42758-
type: string
42759-
type:
42760-
$ref: '#/components/schemas/RuleVersionUpdateType'
42761-
type: object
42762-
RuleVersionUpdateType:
42763-
description: The type of change.
42764-
enum:
42765-
- create
42766-
- update
42767-
- delete
42768-
type: string
42769-
x-enum-varnames:
42770-
- CREATE
42771-
- UPDATE
42772-
- DELETE
4277342772
RuleVersions:
4277442773
description: A rule version with a list of updates.
4277542774
properties:
4277642775
changes:
4277742776
description: A list of changes.
4277842777
items:
42779-
$ref: '#/components/schemas/RuleVersionUpdate'
42778+
$ref: '#/components/schemas/VersionHistoryUpdate'
4278042779
type: array
4278142780
rule:
4278242781
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
@@ -51322,6 +51321,32 @@ components:
5132251321
format: double
5132351322
type: number
5132451323
type: object
51324+
SuppressionVersionHistory:
51325+
description: Response object containing the version history of a suppression.
51326+
properties:
51327+
count:
51328+
description: The number of suppression versions.
51329+
format: int32
51330+
maximum: 2147483647
51331+
type: integer
51332+
data:
51333+
additionalProperties:
51334+
$ref: '#/components/schemas/SuppressionVersions'
51335+
description: A suppression version with a list of updates.
51336+
description: The `SuppressionVersionHistory` `data`.
51337+
type: object
51338+
type: object
51339+
SuppressionVersions:
51340+
description: A suppression version with a list of updates.
51341+
properties:
51342+
changes:
51343+
description: A list of changes.
51344+
items:
51345+
$ref: '#/components/schemas/VersionHistoryUpdate'
51346+
type: array
51347+
suppression:
51348+
$ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes'
51349+
type: object
5132551350
TableResultV2:
5132651351
description: A reference table resource containing its full configuration and
5132751352
state.
@@ -55372,6 +55397,31 @@ components:
5537255397
example: 1
5537355398
format: int64
5537455399
type: integer
55400+
VersionHistoryUpdate:
55401+
description: A change in a rule version.
55402+
properties:
55403+
change:
55404+
description: The new value of the field.
55405+
example: cloud_provider:aws
55406+
type: string
55407+
field:
55408+
description: The field that was changed.
55409+
example: Tags
55410+
type: string
55411+
type:
55412+
$ref: '#/components/schemas/VersionHistoryUpdateType'
55413+
type: object
55414+
VersionHistoryUpdateType:
55415+
description: The type of change.
55416+
enum:
55417+
- create
55418+
- update
55419+
- delete
55420+
type: string
55421+
x-enum-varnames:
55422+
- CREATE
55423+
- UPDATE
55424+
- DELETE
5537555425
VirusTotalAPIKey:
5537655426
description: The definition of the `VirusTotalAPIKey` object.
5537755427
properties:
@@ -79065,6 +79115,35 @@ paths:
7906579115
summary: Update a suppression rule
7906679116
tags:
7906779117
- Security Monitoring
79118+
/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history:
79119+
get:
79120+
description: Get a suppression's version history.
79121+
operationId: GetSuppressionVersionHistory
79122+
parameters:
79123+
- $ref: '#/components/parameters/SecurityMonitoringSuppressionID'
79124+
- $ref: '#/components/parameters/PageSize'
79125+
- $ref: '#/components/parameters/PageNumber'
79126+
responses:
79127+
'200':
79128+
content:
79129+
application/json:
79130+
schema:
79131+
$ref: '#/components/schemas/GetSuppressionVersionHistoryResponse'
79132+
description: OK
79133+
'403':
79134+
$ref: '#/components/responses/NotAuthorizedResponse'
79135+
'404':
79136+
$ref: '#/components/responses/NotFoundResponse'
79137+
'429':
79138+
$ref: '#/components/responses/TooManyRequestsResponse'
79139+
security:
79140+
- apiKeyAuth: []
79141+
appKeyAuth: []
79142+
- AuthZ:
79143+
- security_monitoring_suppressions_read
79144+
summary: Get a suppression's version history
79145+
tags:
79146+
- Security Monitoring
7906879147
/api/v2/security_monitoring/rules:
7906979148
get:
7907079149
description: List rules.

api/datadogV2/api_security_monitoring.go

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,6 +2954,122 @@ func (a *SecurityMonitoringApi) GetSignalNotificationRules(ctx _context.Context)
29542954
return localVarReturnValue, localVarHTTPResponse, nil
29552955
}
29562956

2957+
// GetSuppressionVersionHistoryOptionalParameters holds optional parameters for GetSuppressionVersionHistory.
2958+
type GetSuppressionVersionHistoryOptionalParameters struct {
2959+
PageSize *int64
2960+
PageNumber *int64
2961+
}
2962+
2963+
// NewGetSuppressionVersionHistoryOptionalParameters creates an empty struct for parameters.
2964+
func NewGetSuppressionVersionHistoryOptionalParameters() *GetSuppressionVersionHistoryOptionalParameters {
2965+
this := GetSuppressionVersionHistoryOptionalParameters{}
2966+
return &this
2967+
}
2968+
2969+
// WithPageSize sets the corresponding parameter name and returns the struct.
2970+
func (r *GetSuppressionVersionHistoryOptionalParameters) WithPageSize(pageSize int64) *GetSuppressionVersionHistoryOptionalParameters {
2971+
r.PageSize = &pageSize
2972+
return r
2973+
}
2974+
2975+
// WithPageNumber sets the corresponding parameter name and returns the struct.
2976+
func (r *GetSuppressionVersionHistoryOptionalParameters) WithPageNumber(pageNumber int64) *GetSuppressionVersionHistoryOptionalParameters {
2977+
r.PageNumber = &pageNumber
2978+
return r
2979+
}
2980+
2981+
// GetSuppressionVersionHistory Get a suppression's version history.
2982+
// Get a suppression's version history.
2983+
func (a *SecurityMonitoringApi) GetSuppressionVersionHistory(ctx _context.Context, suppressionId string, o ...GetSuppressionVersionHistoryOptionalParameters) (GetSuppressionVersionHistoryResponse, *_nethttp.Response, error) {
2984+
var (
2985+
localVarHTTPMethod = _nethttp.MethodGet
2986+
localVarPostBody interface{}
2987+
localVarReturnValue GetSuppressionVersionHistoryResponse
2988+
optionalParams GetSuppressionVersionHistoryOptionalParameters
2989+
)
2990+
2991+
if len(o) > 1 {
2992+
return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSuppressionVersionHistoryOptionalParameters is allowed")
2993+
}
2994+
if len(o) == 1 {
2995+
optionalParams = o[0]
2996+
}
2997+
2998+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSuppressionVersionHistory")
2999+
if err != nil {
3000+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
3001+
}
3002+
3003+
localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history"
3004+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, "")))
3005+
3006+
localVarHeaderParams := make(map[string]string)
3007+
localVarQueryParams := _neturl.Values{}
3008+
localVarFormParams := _neturl.Values{}
3009+
if optionalParams.PageSize != nil {
3010+
localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, ""))
3011+
}
3012+
if optionalParams.PageNumber != nil {
3013+
localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, ""))
3014+
}
3015+
localVarHeaderParams["Accept"] = "application/json"
3016+
3017+
if a.Client.Cfg.DelegatedTokenConfig != nil {
3018+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
3019+
if err != nil {
3020+
return localVarReturnValue, nil, err
3021+
}
3022+
} else {
3023+
datadog.SetAuthKeys(
3024+
ctx,
3025+
&localVarHeaderParams,
3026+
[2]string{"apiKeyAuth", "DD-API-KEY"},
3027+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
3028+
)
3029+
}
3030+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
3031+
if err != nil {
3032+
return localVarReturnValue, nil, err
3033+
}
3034+
3035+
localVarHTTPResponse, err := a.Client.CallAPI(req)
3036+
if err != nil || localVarHTTPResponse == nil {
3037+
return localVarReturnValue, localVarHTTPResponse, err
3038+
}
3039+
3040+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
3041+
if err != nil {
3042+
return localVarReturnValue, localVarHTTPResponse, err
3043+
}
3044+
3045+
if localVarHTTPResponse.StatusCode >= 300 {
3046+
newErr := datadog.GenericOpenAPIError{
3047+
ErrorBody: localVarBody,
3048+
ErrorMessage: localVarHTTPResponse.Status,
3049+
}
3050+
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {
3051+
var v APIErrorResponse
3052+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
3053+
if err != nil {
3054+
return localVarReturnValue, localVarHTTPResponse, newErr
3055+
}
3056+
newErr.ErrorModel = v
3057+
}
3058+
return localVarReturnValue, localVarHTTPResponse, newErr
3059+
}
3060+
3061+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
3062+
if err != nil {
3063+
newErr := datadog.GenericOpenAPIError{
3064+
ErrorBody: localVarBody,
3065+
ErrorMessage: err.Error(),
3066+
}
3067+
return localVarReturnValue, localVarHTTPResponse, newErr
3068+
}
3069+
3070+
return localVarReturnValue, localVarHTTPResponse, nil
3071+
}
3072+
29573073
// GetSuppressionsAffectingFutureRule Get suppressions affecting future rule.
29583074
// Get the list of suppressions that would affect a rule.
29593075
func (a *SecurityMonitoringApi) GetSuppressionsAffectingFutureRule(ctx _context.Context, body SecurityMonitoringRuleCreatePayload) (SecurityMonitoringSuppressionsResponse, *_nethttp.Response, error) {

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@
542542
// - [SecurityMonitoringApi.GetSecurityMonitoringSuppression]
543543
// - [SecurityMonitoringApi.GetSignalNotificationRule]
544544
// - [SecurityMonitoringApi.GetSignalNotificationRules]
545+
// - [SecurityMonitoringApi.GetSuppressionVersionHistory]
545546
// - [SecurityMonitoringApi.GetSuppressionsAffectingFutureRule]
546547
// - [SecurityMonitoringApi.GetSuppressionsAffectingRule]
547548
// - [SecurityMonitoringApi.GetThreatHuntingJob]

0 commit comments

Comments
 (0)