Skip to content

Commit 42a20f2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update response for retention filters API (#1947)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent dc9b08e commit 42a20f2

File tree

7 files changed

+73
-15
lines changed

7 files changed

+73
-15
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-04-22 11:29:47.866511",
8-
"spec_repo_commit": "0f37d2e6"
7+
"regenerated": "2024-04-22 13:22:17.696733",
8+
"spec_repo_commit": "c2c10f21"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-22 11:29:47.883528",
13-
"spec_repo_commit": "0f37d2e6"
12+
"regenerated": "2024-04-22 13:22:17.713681",
13+
"spec_repo_commit": "c2c10f21"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16174,12 +16174,18 @@ components:
1617416174
required:
1617516175
- data
1617616176
type: object
16177-
RetentionFilterResponse:
16177+
RetentionFilterCreateResponse:
1617816178
description: The retention filters definition.
1617916179
properties:
1618016180
data:
1618116181
$ref: '#/components/schemas/RetentionFilter'
1618216182
type: object
16183+
RetentionFilterResponse:
16184+
description: The retention filters definition.
16185+
properties:
16186+
data:
16187+
$ref: '#/components/schemas/RetentionFilterAll'
16188+
type: object
1618316189
RetentionFilterType:
1618416190
default: spans-sampling-processor
1618516191
description: The type of retention filter. The value should always be spans-sampling-processor.
@@ -23321,7 +23327,7 @@ paths:
2332123327
content:
2332223328
application/json:
2332323329
schema:
23324-
$ref: '#/components/schemas/RetentionFilterResponse'
23330+
$ref: '#/components/schemas/RetentionFilterCreateResponse'
2332523331
description: OK
2332623332
'400':
2332723333
$ref: '#/components/responses/BadRequestResponse'

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6938,6 +6938,13 @@ retention\_filter\_create\_request
69386938
:members:
69396939
:show-inheritance:
69406940

6941+
retention\_filter\_create\_response
6942+
-----------------------------------
6943+
6944+
.. automodule:: datadog_api_client.v2.model.retention_filter_create_response
6945+
:members:
6946+
:show-inheritance:
6947+
69416948
retention\_filter\_response
69426949
---------------------------
69436950

src/datadog_api_client/v2/api/apm_retention_filters_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
99
from datadog_api_client.configuration import Configuration
1010
from datadog_api_client.v2.model.retention_filters_response import RetentionFiltersResponse
11-
from datadog_api_client.v2.model.retention_filter_response import RetentionFilterResponse
11+
from datadog_api_client.v2.model.retention_filter_create_response import RetentionFilterCreateResponse
1212
from datadog_api_client.v2.model.retention_filter_create_request import RetentionFilterCreateRequest
1313
from datadog_api_client.v2.model.reorder_retention_filters_request import ReorderRetentionFiltersRequest
14+
from datadog_api_client.v2.model.retention_filter_response import RetentionFilterResponse
1415
from datadog_api_client.v2.model.retention_filter_update_request import RetentionFilterUpdateRequest
1516

1617

@@ -26,7 +27,7 @@ def __init__(self, api_client=None):
2627

2728
self._create_apm_retention_filter_endpoint = _Endpoint(
2829
settings={
29-
"response_type": (RetentionFilterResponse,),
30+
"response_type": (RetentionFilterCreateResponse,),
3031
"auth": ["apiKeyAuth", "appKeyAuth"],
3132
"endpoint_path": "/api/v2/apm/config/retention-filters",
3233
"operation_id": "create_apm_retention_filter",
@@ -155,7 +156,7 @@ def __init__(self, api_client=None):
155156
def create_apm_retention_filter(
156157
self,
157158
body: RetentionFilterCreateRequest,
158-
) -> RetentionFilterResponse:
159+
) -> RetentionFilterCreateResponse:
159160
"""Create a retention filter.
160161
161162
Create a retention filter to index spans in your organization.
@@ -165,7 +166,7 @@ def create_apm_retention_filter(
165166
166167
:param body: The definition of the new retention filter.
167168
:type body: RetentionFilterCreateRequest
168-
:rtype: RetentionFilterResponse
169+
:rtype: RetentionFilterCreateResponse
169170
"""
170171
kwargs: Dict[str, Any] = {}
171172
kwargs["body"] = body
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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, 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.retention_filter import RetentionFilter
18+
19+
20+
class RetentionFilterCreateResponse(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.retention_filter import RetentionFilter
24+
25+
return {
26+
"data": (RetentionFilter,),
27+
}
28+
29+
attribute_map = {
30+
"data": "data",
31+
}
32+
33+
def __init__(self_, data: Union[RetentionFilter, UnsetType] = unset, **kwargs):
34+
"""
35+
The retention filters definition.
36+
37+
:param data: The definition of the retention filter.
38+
:type data: RetentionFilter, optional
39+
"""
40+
if data is not unset:
41+
kwargs["data"] = data
42+
super().__init__(kwargs)

src/datadog_api_client/v2/model/retention_filter_response.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@
1414

1515

1616
if TYPE_CHECKING:
17-
from datadog_api_client.v2.model.retention_filter import RetentionFilter
17+
from datadog_api_client.v2.model.retention_filter_all import RetentionFilterAll
1818

1919

2020
class RetentionFilterResponse(ModelNormal):
2121
@cached_property
2222
def openapi_types(_):
23-
from datadog_api_client.v2.model.retention_filter import RetentionFilter
23+
from datadog_api_client.v2.model.retention_filter_all import RetentionFilterAll
2424

2525
return {
26-
"data": (RetentionFilter,),
26+
"data": (RetentionFilterAll,),
2727
}
2828

2929
attribute_map = {
3030
"data": "data",
3131
}
3232

33-
def __init__(self_, data: Union[RetentionFilter, UnsetType] = unset, **kwargs):
33+
def __init__(self_, data: Union[RetentionFilterAll, UnsetType] = unset, **kwargs):
3434
"""
3535
The retention filters definition.
3636
3737
:param data: The definition of the retention filter.
38-
:type data: RetentionFilter, optional
38+
:type data: RetentionFilterAll, optional
3939
"""
4040
if data is not unset:
4141
kwargs["data"] = data

src/datadog_api_client/v2/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,7 @@
12201220
from datadog_api_client.v2.model.retention_filter_create_attributes import RetentionFilterCreateAttributes
12211221
from datadog_api_client.v2.model.retention_filter_create_data import RetentionFilterCreateData
12221222
from datadog_api_client.v2.model.retention_filter_create_request import RetentionFilterCreateRequest
1223+
from datadog_api_client.v2.model.retention_filter_create_response import RetentionFilterCreateResponse
12231224
from datadog_api_client.v2.model.retention_filter_response import RetentionFilterResponse
12241225
from datadog_api_client.v2.model.retention_filter_type import RetentionFilterType
12251226
from datadog_api_client.v2.model.retention_filter_update_attributes import RetentionFilterUpdateAttributes
@@ -2831,6 +2832,7 @@
28312832
"RetentionFilterCreateAttributes",
28322833
"RetentionFilterCreateData",
28332834
"RetentionFilterCreateRequest",
2835+
"RetentionFilterCreateResponse",
28342836
"RetentionFilterResponse",
28352837
"RetentionFilterType",
28362838
"RetentionFilterUpdateAttributes",

0 commit comments

Comments
 (0)