Skip to content

Commit 6ad499b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 02228bc of spec repo
1 parent 27f9b78 commit 6ad499b

19 files changed

+627
-62
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 version history of a suppression.
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.

docs/datadog_api_client.v2.model.rst

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9923,6 +9923,27 @@ datadog\_api\_client.v2.model.get\_sbom\_response module
99239923
:members:
99249924
:show-inheritance:
99259925

9926+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_data module
9927+
-----------------------------------------------------------------------------
9928+
9929+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_data
9930+
:members:
9931+
:show-inheritance:
9932+
9933+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_data\_type module
9934+
-----------------------------------------------------------------------------------
9935+
9936+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_data_type
9937+
:members:
9938+
:show-inheritance:
9939+
9940+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_response module
9941+
---------------------------------------------------------------------------------
9942+
9943+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_response
9944+
:members:
9945+
:show-inheritance:
9946+
99269947
datadog\_api\_client.v2.model.get\_team\_memberships\_sort module
99279948
-----------------------------------------------------------------
99289949

@@ -18617,20 +18638,6 @@ datadog\_api\_client.v2.model.rule\_version\_history module
1861718638
:members:
1861818639
:show-inheritance:
1861918640

18620-
datadog\_api\_client.v2.model.rule\_version\_update module
18621-
----------------------------------------------------------
18622-
18623-
.. automodule:: datadog_api_client.v2.model.rule_version_update
18624-
:members:
18625-
:show-inheritance:
18626-
18627-
datadog\_api\_client.v2.model.rule\_version\_update\_type module
18628-
----------------------------------------------------------------
18629-
18630-
.. automodule:: datadog_api_client.v2.model.rule_version_update_type
18631-
:members:
18632-
:show-inheritance:
18633-
1863418641
datadog\_api\_client.v2.model.rule\_versions module
1863518642
---------------------------------------------------
1863618643

@@ -22684,6 +22691,20 @@ datadog\_api\_client.v2.model.step\_display\_bounds module
2268422691
:members:
2268522692
:show-inheritance:
2268622693

22694+
datadog\_api\_client.v2.model.suppression\_version\_history module
22695+
------------------------------------------------------------------
22696+
22697+
.. automodule:: datadog_api_client.v2.model.suppression_version_history
22698+
:members:
22699+
:show-inheritance:
22700+
22701+
datadog\_api\_client.v2.model.suppression\_versions module
22702+
----------------------------------------------------------
22703+
22704+
.. automodule:: datadog_api_client.v2.model.suppression_versions
22705+
:members:
22706+
:show-inheritance:
22707+
2268722708
datadog\_api\_client.v2.model.table\_result\_v2 module
2268822709
------------------------------------------------------
2268922710

@@ -24616,6 +24637,20 @@ datadog\_api\_client.v2.model.validation\_response module
2461624637
:members:
2461724638
:show-inheritance:
2461824639

24640+
datadog\_api\_client.v2.model.version\_history\_update module
24641+
-------------------------------------------------------------
24642+
24643+
.. automodule:: datadog_api_client.v2.model.version_history_update
24644+
:members:
24645+
:show-inheritance:
24646+
24647+
datadog\_api\_client.v2.model.version\_history\_update\_type module
24648+
-------------------------------------------------------------------
24649+
24650+
.. automodule:: datadog_api_client.v2.model.version_history_update_type
24651+
:members:
24652+
:show-inheritance:
24653+
2461924654
datadog\_api\_client.v2.model.virus\_total\_api\_key module
2462024655
-----------------------------------------------------------
2462124656

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Get a suppression's version history returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
8+
9+
# there is a valid "suppression" in the system
10+
SUPPRESSION_DATA_ID = environ["SUPPRESSION_DATA_ID"]
11+
12+
configuration = Configuration()
13+
with ApiClient(configuration) as api_client:
14+
api_instance = SecurityMonitoringApi(api_client)
15+
response = api_instance.get_suppression_version_history(
16+
suppression_id=SUPPRESSION_DATA_ID,
17+
)
18+
19+
print(response)

src/datadog_api_client/v2/api/security_monitoring_api.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
from datadog_api_client.v2.model.security_monitoring_suppression_update_request import (
7474
SecurityMonitoringSuppressionUpdateRequest,
7575
)
76+
from datadog_api_client.v2.model.get_suppression_version_history_response import GetSuppressionVersionHistoryResponse
7677
from datadog_api_client.v2.model.security_monitoring_list_rules_response import SecurityMonitoringListRulesResponse
7778
from datadog_api_client.v2.model.security_monitoring_rule_response import SecurityMonitoringRuleResponse
7879
from datadog_api_client.v2.model.security_monitoring_rule_convert_response import SecurityMonitoringRuleConvertResponse
@@ -1006,6 +1007,39 @@ def __init__(self, api_client=None):
10061007
api_client=api_client,
10071008
)
10081009

1010+
self._get_suppression_version_history_endpoint = _Endpoint(
1011+
settings={
1012+
"response_type": (GetSuppressionVersionHistoryResponse,),
1013+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
1014+
"endpoint_path": "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history",
1015+
"operation_id": "get_suppression_version_history",
1016+
"http_method": "GET",
1017+
"version": "v2",
1018+
},
1019+
params_map={
1020+
"suppression_id": {
1021+
"required": True,
1022+
"openapi_types": (str,),
1023+
"attribute": "suppression_id",
1024+
"location": "path",
1025+
},
1026+
"page_size": {
1027+
"openapi_types": (int,),
1028+
"attribute": "page[size]",
1029+
"location": "query",
1030+
},
1031+
"page_number": {
1032+
"openapi_types": (int,),
1033+
"attribute": "page[number]",
1034+
"location": "query",
1035+
},
1036+
},
1037+
headers_map={
1038+
"accept": ["application/json"],
1039+
},
1040+
api_client=api_client,
1041+
)
1042+
10091043
self._get_threat_hunting_job_endpoint = _Endpoint(
10101044
settings={
10111045
"response_type": (ThreatHuntingJobResponse,),
@@ -2940,6 +2974,36 @@ def get_suppressions_affecting_rule(
29402974

29412975
return self._get_suppressions_affecting_rule_endpoint.call_with_http_info(**kwargs)
29422976

2977+
def get_suppression_version_history(
2978+
self,
2979+
suppression_id: str,
2980+
*,
2981+
page_size: Union[int, UnsetType] = unset,
2982+
page_number: Union[int, UnsetType] = unset,
2983+
) -> GetSuppressionVersionHistoryResponse:
2984+
"""Get a suppression's version history.
2985+
2986+
Get a suppression's version history.
2987+
2988+
:param suppression_id: The ID of the suppression rule
2989+
:type suppression_id: str
2990+
:param page_size: Size for a given page. The maximum allowed value is 100.
2991+
:type page_size: int, optional
2992+
:param page_number: Specific page number to return.
2993+
:type page_number: int, optional
2994+
:rtype: GetSuppressionVersionHistoryResponse
2995+
"""
2996+
kwargs: Dict[str, Any] = {}
2997+
kwargs["suppression_id"] = suppression_id
2998+
2999+
if page_size is not unset:
3000+
kwargs["page_size"] = page_size
3001+
3002+
if page_number is not unset:
3003+
kwargs["page_number"] = page_number
3004+
3005+
return self._get_suppression_version_history_endpoint.call_with_http_info(**kwargs)
3006+
29433007
def get_threat_hunting_job(
29443008
self,
29453009
job_id: str,

0 commit comments

Comments
 (0)