Skip to content

Commit a7b334f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 943c430 of spec repo
1 parent 9567308 commit a7b334f

8 files changed

Lines changed: 438 additions & 11 deletions

File tree

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 136 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7039,6 +7039,8 @@ components:
70397039
description: The programming language of the source code.
70407040
example: python
70417041
type: string
7042+
options:
7043+
$ref: "#/components/schemas/AnalysisRequestOptions"
70427044
rules:
70437045
description: The list of static analysis rules to apply during analysis.
70447046
items:
@@ -7060,6 +7062,20 @@ components:
70607062
type: string
70617063
x-enum-varnames:
70627064
- ANALYSIS_REQUEST
7065+
AnalysisRequestOptions:
7066+
description: |-
7067+
Analyzer options sent by browser-based clients. Accepted but ignored: the API always runs
7068+
the analysis with tree-sitter enabled and rule output logged.
7069+
properties:
7070+
log_output:
7071+
description: Whether to capture the output logged by rules during execution. Ignored by this operation.
7072+
example: true
7073+
type: boolean
7074+
use_tree_sitter:
7075+
description: Whether to use tree-sitter to parse the source code. Ignored by this operation.
7076+
example: true
7077+
type: boolean
7078+
type: object
70637079
AnalysisRequestRule:
70647080
additionalProperties: {}
70657081
description: |-
@@ -29880,9 +29896,7 @@ components:
2988029896
example: foobarbaz
2988129897
type: string
2988229898
last_revision:
29883-
$ref: "#/components/schemas/CustomRuleRevisionEmbedded"
29884-
description: Most recent revision of the rule, or null when the rule has no revisions.
29885-
nullable: true
29899+
$ref: "#/components/schemas/CustomRuleNullableRevisionEmbedded"
2988629900
name:
2988729901
description: Rule name
2988829902
example: my-rule
@@ -29907,6 +29921,125 @@ components:
2990729921
type: string
2990829922
x-enum-varnames:
2990929923
- CUSTOM_RULE
29924+
CustomRuleNullableRevisionEmbedded:
29925+
description: The most recent revision of the rule, or null when the rule has no revisions.
29926+
nullable: true
29927+
properties:
29928+
arguments:
29929+
description: Rule arguments
29930+
items:
29931+
$ref: "#/components/schemas/Argument"
29932+
nullable: true
29933+
type: array
29934+
category:
29935+
$ref: "#/components/schemas/CustomRuleRevisionAttributesCategory"
29936+
checksum:
29937+
description: Code checksum
29938+
example: 8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99
29939+
type: string
29940+
code:
29941+
description: Rule code
29942+
example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==
29943+
type: string
29944+
created_at:
29945+
description: Creation timestamp
29946+
example: "2026-01-09T13:00:57.473141Z"
29947+
format: date-time
29948+
type: string
29949+
created_by:
29950+
description: Creator identifier
29951+
example: foobarbaz
29952+
type: string
29953+
creation_message:
29954+
description: Revision creation message
29955+
example: Initial revision
29956+
type: string
29957+
cve:
29958+
description: Associated CVE. Omitted when the revision has no associated CVE.
29959+
example: CVE-2024-1234
29960+
type: string
29961+
cwe:
29962+
description: Associated CWE. Omitted when the revision has no associated CWE.
29963+
example: CWE-79
29964+
type: string
29965+
description:
29966+
description: Full description
29967+
example: bG9uZyBkZXNjcmlwdGlvbg==
29968+
type: string
29969+
documentation_url:
29970+
description: Documentation URL. Omitted when the revision has no documentation URL.
29971+
example: https://docs.example.com/rules/my-rule
29972+
type: string
29973+
id:
29974+
description: Revision identifier
29975+
example: revision-123
29976+
type: string
29977+
is_published:
29978+
description: Whether the revision is published
29979+
example: false
29980+
type: boolean
29981+
is_testing:
29982+
description: Whether this is a testing revision
29983+
example: false
29984+
type: boolean
29985+
language:
29986+
$ref: "#/components/schemas/Language"
29987+
severity:
29988+
$ref: "#/components/schemas/CustomRuleRevisionAttributesSeverity"
29989+
short_description:
29990+
description: Short description
29991+
example: c2hvcnQgZGVzY3JpcHRpb24=
29992+
type: string
29993+
should_use_ai_fix:
29994+
description: Whether to use AI for fixes
29995+
example: false
29996+
type: boolean
29997+
tags:
29998+
description: Rule tags
29999+
example:
30000+
- security
30001+
- custom
30002+
items:
30003+
description: A tag attached to the rule.
30004+
type: string
30005+
nullable: true
30006+
type: array
30007+
tests:
30008+
description: Rule tests
30009+
items:
30010+
$ref: "#/components/schemas/CustomRuleRevisionTest"
30011+
nullable: true
30012+
type: array
30013+
tree_sitter_query:
30014+
description: Tree-sitter query
30015+
example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==
30016+
type: string
30017+
version_id:
30018+
description: Monotonically increasing version number of the revision.
30019+
example: 1
30020+
format: int64
30021+
type: integer
30022+
required:
30023+
- id
30024+
- version_id
30025+
- creation_message
30026+
- short_description
30027+
- description
30028+
- code
30029+
- checksum
30030+
- language
30031+
- tree_sitter_query
30032+
- created_at
30033+
- created_by
30034+
- severity
30035+
- category
30036+
- arguments
30037+
- tests
30038+
- tags
30039+
- is_published
30040+
- should_use_ai_fix
30041+
- is_testing
30042+
type: object
2991030043
CustomRuleRequest:
2991130044
description: Request body for creating or updating a custom rule.
2991230045
properties:

‎examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datadog_api_client.v2.model.analysis_request_data import AnalysisRequestData
1010
from datadog_api_client.v2.model.analysis_request_data_attributes import AnalysisRequestDataAttributes
1111
from datadog_api_client.v2.model.analysis_request_data_type import AnalysisRequestDataType
12+
from datadog_api_client.v2.model.analysis_request_options import AnalysisRequestOptions
1213
from datadog_api_client.v2.model.analysis_request_rule import AnalysisRequestRule
1314
from datadog_api_client.v2.model.analysis_request_rule_argument import AnalysisRequestRuleArgument
1415
from datadog_api_client.v2.model.analysis_request_rule_test import AnalysisRequestRuleTest
@@ -20,6 +21,10 @@
2021
file_encoding="utf-8",
2122
filename="test.py",
2223
language="python",
24+
options=AnalysisRequestOptions(
25+
log_output=True,
26+
use_tree_sitter=True,
27+
),
2328
rules=[
2429
AnalysisRequestRule(
2530
arguments=[

‎src/datadog_api_client/v2/model/analysis_request_data_attributes.py‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,33 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
unset,
12+
UnsetType,
1113
)
1214

1315

1416
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.analysis_request_options import AnalysisRequestOptions
1518
from datadog_api_client.v2.model.analysis_request_rule import AnalysisRequestRule
1619

1720

1821
class AnalysisRequestDataAttributes(ModelNormal):
1922
@cached_property
2023
def openapi_types(_):
24+
from datadog_api_client.v2.model.analysis_request_options import AnalysisRequestOptions
2125
from datadog_api_client.v2.model.analysis_request_rule import AnalysisRequestRule
2226

2327
return {
2428
"code": (str,),
2529
"file_encoding": (str,),
2630
"filename": (str,),
2731
"language": (str,),
32+
"options": (AnalysisRequestOptions,),
2833
"rules": ([AnalysisRequestRule],),
2934
}
3035

@@ -33,11 +38,19 @@ def openapi_types(_):
3338
"file_encoding": "file_encoding",
3439
"filename": "filename",
3540
"language": "language",
41+
"options": "options",
3642
"rules": "rules",
3743
}
3844

3945
def __init__(
40-
self_, code: str, file_encoding: str, filename: str, language: str, rules: List[AnalysisRequestRule], **kwargs
46+
self_,
47+
code: str,
48+
file_encoding: str,
49+
filename: str,
50+
language: str,
51+
rules: List[AnalysisRequestRule],
52+
options: Union[AnalysisRequestOptions, UnsetType] = unset,
53+
**kwargs,
4154
):
4255
"""
4356
The attributes of the analysis request, containing the source code and rules to apply.
@@ -54,9 +67,15 @@ def __init__(
5467
:param language: The programming language of the source code.
5568
:type language: str
5669
70+
:param options: Analyzer options sent by browser-based clients. Accepted but ignored: the API always runs
71+
the analysis with tree-sitter enabled and rule output logged.
72+
:type options: AnalysisRequestOptions, optional
73+
5774
:param rules: The list of static analysis rules to apply during analysis.
5875
:type rules: [AnalysisRequestRule]
5976
"""
77+
if options is not unset:
78+
kwargs["options"] = options
6079
super().__init__(kwargs)
6180

6281
self_.code = code
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
class AnalysisRequestOptions(ModelNormal):
17+
@cached_property
18+
def openapi_types(_):
19+
return {
20+
"log_output": (bool,),
21+
"use_tree_sitter": (bool,),
22+
}
23+
24+
attribute_map = {
25+
"log_output": "log_output",
26+
"use_tree_sitter": "use_tree_sitter",
27+
}
28+
29+
def __init__(
30+
self_, log_output: Union[bool, UnsetType] = unset, use_tree_sitter: Union[bool, UnsetType] = unset, **kwargs
31+
):
32+
"""
33+
Analyzer options sent by browser-based clients. Accepted but ignored: the API always runs
34+
the analysis with tree-sitter enabled and rule output logged.
35+
36+
:param log_output: Whether to capture the output logged by rules during execution. Ignored by this operation.
37+
:type log_output: bool, optional
38+
39+
:param use_tree_sitter: Whether to use tree-sitter to parse the source code. Ignored by this operation.
40+
:type use_tree_sitter: bool, optional
41+
"""
42+
if log_output is not unset:
43+
kwargs["log_output"] = log_output
44+
if use_tree_sitter is not unset:
45+
kwargs["use_tree_sitter"] = use_tree_sitter
46+
super().__init__(kwargs)

‎src/datadog_api_client/v2/model/custom_rule_attributes.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,22 @@
1414

1515

1616
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.custom_rule_nullable_revision_embedded import CustomRuleNullableRevisionEmbedded
1718
from datadog_api_client.v2.model.custom_rule_revision_embedded import CustomRuleRevisionEmbedded
1819

1920

2021
class CustomRuleAttributes(ModelNormal):
2122
@cached_property
2223
def openapi_types(_):
24+
from datadog_api_client.v2.model.custom_rule_nullable_revision_embedded import (
25+
CustomRuleNullableRevisionEmbedded,
26+
)
2327
from datadog_api_client.v2.model.custom_rule_revision_embedded import CustomRuleRevisionEmbedded
2428

2529
return {
2630
"created_at": (datetime,),
2731
"created_by": (str,),
28-
"last_revision": (CustomRuleRevisionEmbedded,),
32+
"last_revision": (CustomRuleNullableRevisionEmbedded,),
2933
"name": (str,),
3034
"revisions": ([CustomRuleRevisionEmbedded], none_type),
3135
}
@@ -42,7 +46,7 @@ def __init__(
4246
self_,
4347
created_at: datetime,
4448
created_by: str,
45-
last_revision: CustomRuleRevisionEmbedded,
49+
last_revision: Union[CustomRuleNullableRevisionEmbedded, none_type],
4650
name: str,
4751
revisions: Union[List[CustomRuleRevisionEmbedded], none_type],
4852
**kwargs,
@@ -56,8 +60,8 @@ def __init__(
5660
:param created_by: Creator identifier
5761
:type created_by: str
5862
59-
:param last_revision: A revision of a custom static analysis rule as embedded in a rule or ruleset response.
60-
:type last_revision: CustomRuleRevisionEmbedded
63+
:param last_revision: The most recent revision of the rule, or null when the rule has no revisions.
64+
:type last_revision: CustomRuleNullableRevisionEmbedded, none_type
6165
6266
:param name: Rule name
6367
:type name: str

0 commit comments

Comments
 (0)