Skip to content

Commit 0e90516

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fab55767 of spec repo
1 parent c7336d0 commit 0e90516

File tree

12 files changed

+401
-15
lines changed

12 files changed

+401
-15
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-14 15:59:02.215671",
8-
"spec_repo_commit": "0457044b"
7+
"regenerated": "2025-01-14 18:26:42.846688",
8+
"spec_repo_commit": "fab55767"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-14 15:59:02.231231",
13-
"spec_repo_commit": "0457044b"
12+
"regenerated": "2025-01-14 18:26:42.861341",
13+
"spec_repo_commit": "fab55767"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+100
Original file line numberDiff line numberDiff line change
@@ -7145,6 +7145,38 @@ components:
71457145
type: string
71467146
x-enum-varnames:
71477147
- APPDEFINITIONS
7148+
CreateCustomFrameworkRequest:
7149+
description: Create a custom framework.
7150+
properties:
7151+
description:
7152+
description: Framework Description
7153+
type: string
7154+
handle:
7155+
description: Framework Handle
7156+
example: ''
7157+
type: string
7158+
icon_url:
7159+
description: Framework Icon URL
7160+
type: string
7161+
name:
7162+
description: Framework Name
7163+
example: ''
7164+
type: string
7165+
requirements:
7166+
description: Framework Requirements
7167+
items:
7168+
$ref: '#/components/schemas/FrameworkRequirement'
7169+
type: array
7170+
version:
7171+
description: Framework Version
7172+
example: ''
7173+
type: string
7174+
required:
7175+
- handle
7176+
- version
7177+
- name
7178+
- requirements
7179+
type: object
71487180
CreateDataDeletionRequestBody:
71497181
description: Object needed to create a data deletion request.
71507182
properties:
@@ -11936,6 +11968,40 @@ components:
1193611968
order:
1193711969
$ref: '#/components/schemas/QuerySortOrder'
1193811970
type: object
11971+
FrameworkControl:
11972+
description: Framework Control.
11973+
properties:
11974+
name:
11975+
description: Control Name.
11976+
example: ''
11977+
type: string
11978+
rule_ids:
11979+
description: Rule IDs.
11980+
example:
11981+
- ''
11982+
items:
11983+
type: string
11984+
type: array
11985+
required:
11986+
- name
11987+
- rule_ids
11988+
type: object
11989+
FrameworkRequirement:
11990+
description: Framework Requirement.
11991+
properties:
11992+
controls:
11993+
description: Requirement Controls.
11994+
items:
11995+
$ref: '#/components/schemas/FrameworkControl'
11996+
type: array
11997+
name:
11998+
description: Requirement Name.
11999+
example: ''
12000+
type: string
12001+
required:
12002+
- name
12003+
- controls
12004+
type: object
1193912005
FullAPIKey:
1194012006
description: Datadog API key.
1194112007
properties:
@@ -33028,6 +33094,40 @@ paths:
3302833094
operator: OR
3302933095
permissions:
3303033096
- ci_visibility_read
33097+
/api/v2/cloud_security_management/custom_frameworks:
33098+
post:
33099+
description: Create a custom framework.
33100+
operationId: CreateCustomFramework
33101+
requestBody:
33102+
content:
33103+
application/json:
33104+
schema:
33105+
$ref: '#/components/schemas/CreateCustomFrameworkRequest'
33106+
required: true
33107+
responses:
33108+
'200':
33109+
description: OK
33110+
'400':
33111+
$ref: '#/components/responses/BadRequestResponse'
33112+
'429':
33113+
$ref: '#/components/responses/TooManyRequestsResponse'
33114+
'500':
33115+
$ref: '#/components/responses/BadRequestResponse'
33116+
security:
33117+
- apiKeyAuth: []
33118+
appKeyAuth: []
33119+
- AuthZ:
33120+
- security_monitoring_rules_read
33121+
- security_monitoring_rules_write
33122+
summary: Create a custom framework
33123+
tags:
33124+
- Security Monitoring
33125+
x-codegen-request-body-name: body
33126+
x-permission:
33127+
operator: AND
33128+
permissions:
33129+
- security_monitoring_rules_read
33130+
- security_monitoring_rules_write
3303133131
/api/v2/container_images:
3303233132
get:
3303333133
description: Get all Container Images for your organization.

docs/datadog_api_client.v2.model.rst

+21
Original file line numberDiff line numberDiff line change
@@ -2727,6 +2727,13 @@ datadog\_api\_client.v2.model.create\_app\_response\_data\_type module
27272727
:members:
27282728
:show-inheritance:
27292729

2730+
datadog\_api\_client.v2.model.create\_custom\_framework\_request module
2731+
-----------------------------------------------------------------------
2732+
2733+
.. automodule:: datadog_api_client.v2.model.create_custom_framework_request
2734+
:members:
2735+
:show-inheritance:
2736+
27302737
datadog\_api\_client.v2.model.create\_data\_deletion\_request\_body module
27312738
--------------------------------------------------------------------------
27322739

@@ -4883,6 +4890,20 @@ datadog\_api\_client.v2.model.formula\_limit module
48834890
:members:
48844891
:show-inheritance:
48854892

4893+
datadog\_api\_client.v2.model.framework\_control module
4894+
-------------------------------------------------------
4895+
4896+
.. automodule:: datadog_api_client.v2.model.framework_control
4897+
:members:
4898+
:show-inheritance:
4899+
4900+
datadog\_api\_client.v2.model.framework\_requirement module
4901+
-----------------------------------------------------------
4902+
4903+
.. automodule:: datadog_api_client.v2.model.framework_requirement
4904+
:members:
4905+
:show-inheritance:
4906+
48864907
datadog\_api\_client.v2.model.full\_api\_key module
48874908
---------------------------------------------------
48884909

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Create a custom framework returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
7+
from datadog_api_client.v2.model.create_custom_framework_request import CreateCustomFrameworkRequest
8+
from datadog_api_client.v2.model.framework_control import FrameworkControl
9+
from datadog_api_client.v2.model.framework_requirement import FrameworkRequirement
10+
11+
body = CreateCustomFrameworkRequest(
12+
handle="",
13+
name="",
14+
requirements=[
15+
FrameworkRequirement(
16+
controls=[
17+
FrameworkControl(
18+
name="",
19+
rule_ids=[
20+
"",
21+
],
22+
),
23+
],
24+
name="",
25+
),
26+
],
27+
version="",
28+
)
29+
30+
configuration = Configuration()
31+
with ApiClient(configuration) as api_client:
32+
api_instance = SecurityMonitoringApi(api_client)
33+
api_instance.create_custom_framework(body=body)

src/datadog_api_client/configuration.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,17 @@ def __init__(
249249
"v2.get_app": False,
250250
"v2.list_apps": False,
251251
"v2.update_app": False,
252+
"v2.cancel_historical_job": False,
253+
"v2.convert_job_result_to_signal": False,
254+
"v2.delete_historical_job": False,
255+
"v2.get_finding": False,
256+
"v2.get_historical_job": False,
257+
"v2.list_findings": False,
258+
"v2.list_historical_jobs": False,
259+
"v2.list_vulnerabilities": False,
260+
"v2.list_vulnerable_assets": False,
261+
"v2.mute_findings": False,
262+
"v2.run_historical_job": False,
252263
"v2.get_active_billing_dimensions": False,
253264
"v2.get_billing_dimension_mapping": False,
254265
"v2.get_monthly_cost_attribution": False,
@@ -288,17 +299,6 @@ def __init__(
288299
"v2.list_aws_namespaces": False,
289300
"v2.update_aws_account": False,
290301
"v2.list_aws_logs_services": False,
291-
"v2.cancel_historical_job": False,
292-
"v2.convert_job_result_to_signal": False,
293-
"v2.delete_historical_job": False,
294-
"v2.get_finding": False,
295-
"v2.get_historical_job": False,
296-
"v2.list_findings": False,
297-
"v2.list_historical_jobs": False,
298-
"v2.list_vulnerabilities": False,
299-
"v2.list_vulnerable_assets": False,
300-
"v2.mute_findings": False,
301-
"v2.run_historical_job": False,
302302
"v2.create_scorecard_outcomes_batch": False,
303303
"v2.create_scorecard_rule": False,
304304
"v2.delete_scorecard_rule": False,

src/datadog_api_client/v2/api/security_monitoring_api.py

+37
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
UnsetType,
1616
unset,
1717
)
18+
from datadog_api_client.v2.model.create_custom_framework_request import CreateCustomFrameworkRequest
1819
from datadog_api_client.v2.model.list_findings_response import ListFindingsResponse
1920
from datadog_api_client.v2.model.finding_evaluation import FindingEvaluation
2021
from datadog_api_client.v2.model.finding_status import FindingStatus
@@ -182,6 +183,26 @@ def __init__(self, api_client=None):
182183
api_client=api_client,
183184
)
184185

186+
self._create_custom_framework_endpoint = _Endpoint(
187+
settings={
188+
"response_type": None,
189+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
190+
"endpoint_path": "/api/v2/cloud_security_management/custom_frameworks",
191+
"operation_id": "create_custom_framework",
192+
"http_method": "POST",
193+
"version": "v2",
194+
},
195+
params_map={
196+
"body": {
197+
"required": True,
198+
"openapi_types": (CreateCustomFrameworkRequest,),
199+
"location": "body",
200+
},
201+
},
202+
headers_map={"accept": ["*/*"], "content_type": ["application/json"]},
203+
api_client=api_client,
204+
)
205+
185206
self._create_security_filter_endpoint = _Endpoint(
186207
settings={
187208
"response_type": (SecurityFilterResponse,),
@@ -1401,6 +1422,22 @@ def convert_security_monitoring_rule_from_json_to_terraform(
14011422

14021423
return self._convert_security_monitoring_rule_from_json_to_terraform_endpoint.call_with_http_info(**kwargs)
14031424

1425+
def create_custom_framework(
1426+
self,
1427+
body: CreateCustomFrameworkRequest,
1428+
) -> None:
1429+
"""Create a custom framework.
1430+
1431+
Create a custom framework.
1432+
1433+
:type body: CreateCustomFrameworkRequest
1434+
:rtype: None
1435+
"""
1436+
kwargs: Dict[str, Any] = {}
1437+
kwargs["body"] = body
1438+
1439+
return self._create_custom_framework_endpoint.call_with_http_info(**kwargs)
1440+
14041441
def create_security_filter(
14051442
self,
14061443
body: SecurityFilterCreateRequest,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.framework_requirement import FrameworkRequirement
18+
19+
20+
class CreateCustomFrameworkRequest(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.framework_requirement import FrameworkRequirement
24+
25+
return {
26+
"description": (str,),
27+
"handle": (str,),
28+
"icon_url": (str,),
29+
"name": (str,),
30+
"requirements": ([FrameworkRequirement],),
31+
"version": (str,),
32+
}
33+
34+
attribute_map = {
35+
"description": "description",
36+
"handle": "handle",
37+
"icon_url": "icon_url",
38+
"name": "name",
39+
"requirements": "requirements",
40+
"version": "version",
41+
}
42+
43+
def __init__(
44+
self_,
45+
handle: str,
46+
name: str,
47+
requirements: List[FrameworkRequirement],
48+
version: str,
49+
description: Union[str, UnsetType] = unset,
50+
icon_url: Union[str, UnsetType] = unset,
51+
**kwargs,
52+
):
53+
"""
54+
Create a custom framework.
55+
56+
:param description: Framework Description
57+
:type description: str, optional
58+
59+
:param handle: Framework Handle
60+
:type handle: str
61+
62+
:param icon_url: Framework Icon URL
63+
:type icon_url: str, optional
64+
65+
:param name: Framework Name
66+
:type name: str
67+
68+
:param requirements: Framework Requirements
69+
:type requirements: [FrameworkRequirement]
70+
71+
:param version: Framework Version
72+
:type version: str
73+
"""
74+
if description is not unset:
75+
kwargs["description"] = description
76+
if icon_url is not unset:
77+
kwargs["icon_url"] = icon_url
78+
super().__init__(kwargs)
79+
80+
self_.handle = handle
81+
self_.name = name
82+
self_.requirements = requirements
83+
self_.version = version

0 commit comments

Comments
 (0)