Skip to content

Commit 5b1e869

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 90667ea6 of spec repo
1 parent c84ad6d commit 5b1e869

13 files changed

+171
-42
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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": "2024-01-04 15:18:08.876360",
8-
"spec_repo_commit": "e7cfa56f"
7+
"regenerated": "2024-01-05 15:46:55.610249",
8+
"spec_repo_commit": "90667ea6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-01-04 15:18:08.899971",
13-
"spec_repo_commit": "e7cfa56f"
12+
"regenerated": "2024-01-05 15:46:55.624666",
13+
"spec_repo_commit": "90667ea6"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16878,6 +16878,44 @@ components:
1687816878
meta:
1687916879
$ref: '#/components/schemas/SensitiveDataScannerMetaVersionOnly'
1688016880
type: object
16881+
SensitiveDataScannerIncludedKeywordConfiguration:
16882+
description: 'Object defining a set of keywords and a number of characters that
16883+
help reduce noise.
16884+
16885+
You can provide a list of keywords you would like to check within a defined
16886+
proximity of the matching pattern.
16887+
16888+
If any of the keywords are found within the proximity check, the match is
16889+
kept.
16890+
16891+
If none are found, the match is discarded.'
16892+
properties:
16893+
character_count:
16894+
description: 'The number of characters behind a match detected by Sensitive
16895+
Data Scanner to look for the keywords defined.
16896+
16897+
`character_count` should be greater than the maximum length of a keyword
16898+
defined for a rule.'
16899+
example: 30
16900+
format: int64
16901+
maximum: 50
16902+
minimum: 1
16903+
type: integer
16904+
keywords:
16905+
description: 'Keyword list that will be checked during scanning in order
16906+
to validate a match.
16907+
16908+
The number of keywords in the list must be less than or equal to 20.'
16909+
example:
16910+
- credit card
16911+
- cc
16912+
items:
16913+
type: string
16914+
type: array
16915+
required:
16916+
- keywords
16917+
- character_count
16918+
type: object
1688116919
SensitiveDataScannerMeta:
1688216920
description: Meta response containing information about the API.
1688316921
properties:
@@ -16971,6 +17009,8 @@ components:
1697117009
items:
1697217010
type: string
1697317011
type: array
17012+
included_keyword_configuration:
17013+
$ref: '#/components/schemas/SensitiveDataScannerIncludedKeywordConfiguration'
1697417014
is_enabled:
1697517015
description: Whether or not the rule is enabled.
1697617016
type: boolean

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7554,6 +7554,13 @@ sensitive\_data\_scanner\_group\_update\_response
75547554
:members:
75557555
:show-inheritance:
75567556

7557+
sensitive\_data\_scanner\_included\_keyword\_configuration
7558+
----------------------------------------------------------
7559+
7560+
.. automodule:: datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration
7561+
:members:
7562+
:show-inheritance:
7563+
75577564
sensitive\_data\_scanner\_meta
75587565
------------------------------
75597566

examples/v2/sensitive-data-scanner/CreateScanningRule.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
from datadog_api_client.v2.model.sensitive_data_scanner_group import SensitiveDataScannerGroup
99
from datadog_api_client.v2.model.sensitive_data_scanner_group_data import SensitiveDataScannerGroupData
1010
from datadog_api_client.v2.model.sensitive_data_scanner_group_type import SensitiveDataScannerGroupType
11+
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
12+
SensitiveDataScannerIncludedKeywordConfiguration,
13+
)
1114
from datadog_api_client.v2.model.sensitive_data_scanner_meta_version_only import SensitiveDataScannerMetaVersionOnly
1215
from datadog_api_client.v2.model.sensitive_data_scanner_rule_attributes import SensitiveDataScannerRuleAttributes
1316
from datadog_api_client.v2.model.sensitive_data_scanner_rule_create import SensitiveDataScannerRuleCreate
@@ -43,6 +46,12 @@
4346
],
4447
is_enabled=True,
4548
priority=1,
49+
included_keyword_configuration=SensitiveDataScannerIncludedKeywordConfiguration(
50+
keywords=[
51+
"credit card",
52+
],
53+
character_count=35,
54+
),
4655
),
4756
relationships=SensitiveDataScannerRuleRelationships(
4857
group=SensitiveDataScannerGroupData(

examples/v2/sensitive-data-scanner/UpdateScanningRule.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
from os import environ
66
from datadog_api_client import ApiClient, Configuration
77
from datadog_api_client.v2.api.sensitive_data_scanner_api import SensitiveDataScannerApi
8-
from datadog_api_client.v2.model.sensitive_data_scanner_group import SensitiveDataScannerGroup
9-
from datadog_api_client.v2.model.sensitive_data_scanner_group_data import SensitiveDataScannerGroupData
10-
from datadog_api_client.v2.model.sensitive_data_scanner_group_type import SensitiveDataScannerGroupType
8+
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
9+
SensitiveDataScannerIncludedKeywordConfiguration,
10+
)
1111
from datadog_api_client.v2.model.sensitive_data_scanner_meta_version_only import SensitiveDataScannerMetaVersionOnly
1212
from datadog_api_client.v2.model.sensitive_data_scanner_rule_attributes import SensitiveDataScannerRuleAttributes
13-
from datadog_api_client.v2.model.sensitive_data_scanner_rule_relationships import SensitiveDataScannerRuleRelationships
1413
from datadog_api_client.v2.model.sensitive_data_scanner_rule_type import SensitiveDataScannerRuleType
1514
from datadog_api_client.v2.model.sensitive_data_scanner_rule_update import SensitiveDataScannerRuleUpdate
1615
from datadog_api_client.v2.model.sensitive_data_scanner_rule_update_request import SensitiveDataScannerRuleUpdateRequest
@@ -22,9 +21,6 @@
2221
# the "scanning_group" has a "scanning_rule"
2322
RULE_DATA_ID = environ["RULE_DATA_ID"]
2423

25-
# there is a valid "scanning_group" in the system
26-
GROUP_DATA_ID = environ["GROUP_DATA_ID"]
27-
2824
body = SensitiveDataScannerRuleUpdateRequest(
2925
meta=SensitiveDataScannerMetaVersionOnly(),
3026
data=SensitiveDataScannerRuleUpdate(
@@ -41,13 +37,12 @@
4137
],
4238
is_enabled=True,
4339
priority=5,
44-
),
45-
relationships=SensitiveDataScannerRuleRelationships(
46-
group=SensitiveDataScannerGroupData(
47-
data=SensitiveDataScannerGroup(
48-
type=SensitiveDataScannerGroupType.SENSITIVE_DATA_SCANNER_GROUP,
49-
id=GROUP_DATA_ID,
50-
),
40+
included_keyword_configuration=SensitiveDataScannerIncludedKeywordConfiguration(
41+
keywords=[
42+
"credit card",
43+
"cc",
44+
],
45+
character_count=35,
5146
),
5247
),
5348
),
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
class SensitiveDataScannerIncludedKeywordConfiguration(ModelNormal):
15+
validations = {
16+
"character_count": {
17+
"inclusive_maximum": 50,
18+
"inclusive_minimum": 1,
19+
},
20+
}
21+
22+
@cached_property
23+
def openapi_types(_):
24+
return {
25+
"character_count": (int,),
26+
"keywords": ([str],),
27+
}
28+
29+
attribute_map = {
30+
"character_count": "character_count",
31+
"keywords": "keywords",
32+
}
33+
34+
def __init__(self_, character_count: int, keywords: List[str], **kwargs):
35+
"""
36+
Object defining a set of keywords and a number of characters that help reduce noise.
37+
You can provide a list of keywords you would like to check within a defined proximity of the matching pattern.
38+
If any of the keywords are found within the proximity check, the match is kept.
39+
If none are found, the match is discarded.
40+
41+
:param character_count: The number of characters behind a match detected by Sensitive Data Scanner to look for the keywords defined.
42+
``character_count`` should be greater than the maximum length of a keyword defined for a rule.
43+
:type character_count: int
44+
45+
:param keywords: Keyword list that will be checked during scanning in order to validate a match.
46+
The number of keywords in the list must be less than or equal to 20.
47+
:type keywords: [str]
48+
"""
49+
super().__init__(kwargs)
50+
51+
self_.character_count = character_count
52+
self_.keywords = keywords

src/datadog_api_client/v2/model/sensitive_data_scanner_rule_attributes.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515

1616
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
18+
SensitiveDataScannerIncludedKeywordConfiguration,
19+
)
1720
from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement import SensitiveDataScannerTextReplacement
1821

1922

@@ -27,13 +30,17 @@ class SensitiveDataScannerRuleAttributes(ModelNormal):
2730

2831
@cached_property
2932
def openapi_types(_):
33+
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
34+
SensitiveDataScannerIncludedKeywordConfiguration,
35+
)
3036
from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement import (
3137
SensitiveDataScannerTextReplacement,
3238
)
3339

3440
return {
3541
"description": (str,),
3642
"excluded_namespaces": ([str],),
43+
"included_keyword_configuration": (SensitiveDataScannerIncludedKeywordConfiguration,),
3744
"is_enabled": (bool,),
3845
"name": (str,),
3946
"namespaces": ([str],),
@@ -46,6 +53,7 @@ def openapi_types(_):
4653
attribute_map = {
4754
"description": "description",
4855
"excluded_namespaces": "excluded_namespaces",
56+
"included_keyword_configuration": "included_keyword_configuration",
4957
"is_enabled": "is_enabled",
5058
"name": "name",
5159
"namespaces": "namespaces",
@@ -59,6 +67,7 @@ def __init__(
5967
self_,
6068
description: Union[str, UnsetType] = unset,
6169
excluded_namespaces: Union[List[str], UnsetType] = unset,
70+
included_keyword_configuration: Union[SensitiveDataScannerIncludedKeywordConfiguration, UnsetType] = unset,
6271
is_enabled: Union[bool, UnsetType] = unset,
6372
name: Union[str, UnsetType] = unset,
6473
namespaces: Union[List[str], UnsetType] = unset,
@@ -77,6 +86,12 @@ def __init__(
7786
:param excluded_namespaces: Attributes excluded from the scan. If namespaces is provided, it has to be a sub-path of the namespaces array.
7887
:type excluded_namespaces: [str], optional
7988
89+
:param included_keyword_configuration: Object defining a set of keywords and a number of characters that help reduce noise.
90+
You can provide a list of keywords you would like to check within a defined proximity of the matching pattern.
91+
If any of the keywords are found within the proximity check, the match is kept.
92+
If none are found, the match is discarded.
93+
:type included_keyword_configuration: SensitiveDataScannerIncludedKeywordConfiguration, optional
94+
8095
:param is_enabled: Whether or not the rule is enabled.
8196
:type is_enabled: bool, optional
8297
@@ -103,6 +118,8 @@ def __init__(
103118
kwargs["description"] = description
104119
if excluded_namespaces is not unset:
105120
kwargs["excluded_namespaces"] = excluded_namespaces
121+
if included_keyword_configuration is not unset:
122+
kwargs["included_keyword_configuration"] = included_keyword_configuration
106123
if is_enabled is not unset:
107124
kwargs["is_enabled"] = is_enabled
108125
if name is not unset:

src/datadog_api_client/v2/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,9 @@
12911291
from datadog_api_client.v2.model.sensitive_data_scanner_group_update_response import (
12921292
SensitiveDataScannerGroupUpdateResponse,
12931293
)
1294+
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
1295+
SensitiveDataScannerIncludedKeywordConfiguration,
1296+
)
12941297
from datadog_api_client.v2.model.sensitive_data_scanner_meta import SensitiveDataScannerMeta
12951298
from datadog_api_client.v2.model.sensitive_data_scanner_meta_version_only import SensitiveDataScannerMetaVersionOnly
12961299
from datadog_api_client.v2.model.sensitive_data_scanner_product import SensitiveDataScannerProduct
@@ -2649,6 +2652,7 @@
26492652
"SensitiveDataScannerGroupUpdate",
26502653
"SensitiveDataScannerGroupUpdateRequest",
26512654
"SensitiveDataScannerGroupUpdateResponse",
2655+
"SensitiveDataScannerIncludedKeywordConfiguration",
26522656
"SensitiveDataScannerMeta",
26532657
"SensitiveDataScannerMetaVersionOnly",
26542658
"SensitiveDataScannerProduct",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-12-13T09:06:38.820Z
1+
2024-01-04T13:51:03.802Z

0 commit comments

Comments
 (0)