Skip to content

Commit 4e52c63

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix Spans endpoint schemas (#1580)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 83dd302 commit 4e52c63

File tree

8 files changed

+218
-45
lines changed

8 files changed

+218
-45
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.5",
7-
"regenerated": "2023-07-14 13:32:03.152627",
8-
"spec_repo_commit": "2bd58701"
7+
"regenerated": "2023-07-14 14:04:10.985041",
8+
"spec_repo_commit": "3868f953"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.5",
12-
"regenerated": "2023-07-14 13:32:03.246638",
13-
"spec_repo_commit": "2bd58701"
12+
"regenerated": "2023-07-14 14:04:11.045806",
13+
"spec_repo_commit": "3868f953"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15010,6 +15010,17 @@ components:
1501015010
$ref: '#/components/schemas/SpansType'
1501115011
type: object
1501215012
SpansAggregateBucket:
15013+
description: Spans aggregate.
15014+
properties:
15015+
attributes:
15016+
$ref: '#/components/schemas/SpansAggregateBucketAttributes'
15017+
id:
15018+
description: ID of the spans aggregate.
15019+
type: string
15020+
type:
15021+
$ref: '#/components/schemas/SpansAggregateBucketType'
15022+
type: object
15023+
SpansAggregateBucketAttributes:
1501315024
description: A bucket values.
1501415025
properties:
1501515026
by:
@@ -15020,13 +15031,24 @@ components:
1502015031
'@state': success
1502115032
'@version': abc
1502215033
type: object
15034+
compute:
15035+
description: The compute data.
15036+
type: object
1502315037
computes:
1502415038
additionalProperties:
1502515039
$ref: '#/components/schemas/SpansAggregateBucketValue'
1502615040
description: A map of the metric name -> value for regular compute or list
1502715041
of values for a timeseries.
1502815042
type: object
1502915043
type: object
15044+
SpansAggregateBucketType:
15045+
description: The spans aggregate bucket type.
15046+
enum:
15047+
- bucket
15048+
example: bucket
15049+
type: string
15050+
x-enum-varnames:
15051+
- BUCKET
1503015052
SpansAggregateBucketValue:
1503115053
description: A bucket value, can be either a timeseries or a single value.
1503215054
oneOf:
@@ -15214,6 +15236,10 @@ components:
1521415236
customAttribute: 123
1521515237
duration: 2345
1521615238
type: object
15239+
custom:
15240+
additionalProperties: {}
15241+
description: JSON object of custom spans data.
15242+
type: object
1521715243
end_timestamp:
1521815244
description: End timestamp of your span.
1521915245
example: '2023-01-02T09:42:36.420Z'

docs/datadog_api_client.v2.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6728,6 +6728,20 @@ spans\_aggregate\_bucket
67286728
:members:
67296729
:show-inheritance:
67306730

6731+
spans\_aggregate\_bucket\_attributes
6732+
------------------------------------
6733+
6734+
.. automodule:: datadog_api_client.v2.model.spans_aggregate_bucket_attributes
6735+
:members:
6736+
:show-inheritance:
6737+
6738+
spans\_aggregate\_bucket\_type
6739+
------------------------------
6740+
6741+
.. automodule:: datadog_api_client.v2.model.spans_aggregate_bucket_type
6742+
:members:
6743+
:show-inheritance:
6744+
67316745
spans\_aggregate\_bucket\_value
67326746
-------------------------------
67336747

src/datadog_api_client/v2/model/spans_aggregate_bucket.py

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

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

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11-
date,
12-
datetime,
13-
none_type,
1411
unset,
1512
UnsetType,
1613
)
1714

1815

1916
if TYPE_CHECKING:
20-
from datadog_api_client.v2.model.spans_aggregate_bucket_value import SpansAggregateBucketValue
21-
from datadog_api_client.v2.model.spans_aggregate_bucket_value_timeseries_point import (
22-
SpansAggregateBucketValueTimeseriesPoint,
23-
)
17+
from datadog_api_client.v2.model.spans_aggregate_bucket_attributes import SpansAggregateBucketAttributes
18+
from datadog_api_client.v2.model.spans_aggregate_bucket_type import SpansAggregateBucketType
2419

2520

2621
class SpansAggregateBucket(ModelNormal):
2722
@cached_property
2823
def openapi_types(_):
29-
from datadog_api_client.v2.model.spans_aggregate_bucket_value import SpansAggregateBucketValue
24+
from datadog_api_client.v2.model.spans_aggregate_bucket_attributes import SpansAggregateBucketAttributes
25+
from datadog_api_client.v2.model.spans_aggregate_bucket_type import SpansAggregateBucketType
3026

3127
return {
32-
"by": (
33-
{
34-
str: (
35-
bool,
36-
date,
37-
datetime,
38-
dict,
39-
float,
40-
int,
41-
list,
42-
str,
43-
none_type,
44-
)
45-
},
46-
),
47-
"computes": ({str: (SpansAggregateBucketValue,)},),
28+
"attributes": (SpansAggregateBucketAttributes,),
29+
"id": (str,),
30+
"type": (SpansAggregateBucketType,),
4831
}
4932

5033
attribute_map = {
51-
"by": "by",
52-
"computes": "computes",
34+
"attributes": "attributes",
35+
"id": "id",
36+
"type": "type",
5337
}
5438

5539
def __init__(
5640
self_,
57-
by: Union[Dict[str, Any], UnsetType] = unset,
58-
computes: Union[
59-
Dict[str, Union[SpansAggregateBucketValue, str, float, List[SpansAggregateBucketValueTimeseriesPoint]]],
60-
UnsetType,
61-
] = unset,
41+
attributes: Union[SpansAggregateBucketAttributes, UnsetType] = unset,
42+
id: Union[str, UnsetType] = unset,
43+
type: Union[SpansAggregateBucketType, UnsetType] = unset,
6244
**kwargs,
6345
):
6446
"""
65-
A bucket values.
47+
Spans aggregate.
6648
67-
:param by: The key, value pairs for each group by.
68-
:type by: {str: (bool, date, datetime, dict, float, int, list, str, none_type,)}, optional
49+
:param attributes: A bucket values.
50+
:type attributes: SpansAggregateBucketAttributes, optional
6951
70-
:param computes: A map of the metric name -> value for regular compute or list of values for a timeseries.
71-
:type computes: {str: (SpansAggregateBucketValue,)}, optional
52+
:param id: ID of the spans aggregate.
53+
:type id: str, optional
54+
55+
:param type: The spans aggregate bucket type.
56+
:type type: SpansAggregateBucketType, optional
7257
"""
73-
if by is not unset:
74-
kwargs["by"] = by
75-
if computes is not unset:
76-
kwargs["computes"] = computes
58+
if attributes is not unset:
59+
kwargs["attributes"] = attributes
60+
if id is not unset:
61+
kwargs["id"] = id
62+
if type is not unset:
63+
kwargs["type"] = type
7764
super().__init__(kwargs)
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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 Any, Dict, List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
date,
12+
datetime,
13+
none_type,
14+
unset,
15+
UnsetType,
16+
)
17+
18+
19+
if TYPE_CHECKING:
20+
from datadog_api_client.v2.model.spans_aggregate_bucket_value import SpansAggregateBucketValue
21+
from datadog_api_client.v2.model.spans_aggregate_bucket_value_timeseries_point import (
22+
SpansAggregateBucketValueTimeseriesPoint,
23+
)
24+
25+
26+
class SpansAggregateBucketAttributes(ModelNormal):
27+
@cached_property
28+
def openapi_types(_):
29+
from datadog_api_client.v2.model.spans_aggregate_bucket_value import SpansAggregateBucketValue
30+
31+
return {
32+
"by": (
33+
{
34+
str: (
35+
bool,
36+
date,
37+
datetime,
38+
dict,
39+
float,
40+
int,
41+
list,
42+
str,
43+
none_type,
44+
)
45+
},
46+
),
47+
"compute": (dict,),
48+
"computes": ({str: (SpansAggregateBucketValue,)},),
49+
}
50+
51+
attribute_map = {
52+
"by": "by",
53+
"compute": "compute",
54+
"computes": "computes",
55+
}
56+
57+
def __init__(
58+
self_,
59+
by: Union[Dict[str, Any], UnsetType] = unset,
60+
compute: Union[dict, UnsetType] = unset,
61+
computes: Union[
62+
Dict[str, Union[SpansAggregateBucketValue, str, float, List[SpansAggregateBucketValueTimeseriesPoint]]],
63+
UnsetType,
64+
] = unset,
65+
**kwargs,
66+
):
67+
"""
68+
A bucket values.
69+
70+
:param by: The key, value pairs for each group by.
71+
:type by: {str: (bool, date, datetime, dict, float, int, list, str, none_type,)}, optional
72+
73+
:param compute: The compute data.
74+
:type compute: dict, optional
75+
76+
:param computes: A map of the metric name -> value for regular compute or list of values for a timeseries.
77+
:type computes: {str: (SpansAggregateBucketValue,)}, optional
78+
"""
79+
if by is not unset:
80+
kwargs["by"] = by
81+
if compute is not unset:
82+
kwargs["compute"] = compute
83+
if computes is not unset:
84+
kwargs["computes"] = computes
85+
super().__init__(kwargs)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class SpansAggregateBucketType(ModelSimple):
16+
"""
17+
The spans aggregate bucket type.
18+
19+
:param value: If omitted defaults to "bucket". Must be one of ["bucket"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"bucket",
25+
}
26+
BUCKET: ClassVar["SpansAggregateBucketType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
SpansAggregateBucketType.BUCKET = SpansAggregateBucketType("bucket")

src/datadog_api_client/v2/model/spans_attributes.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ def openapi_types(_):
3535
)
3636
},
3737
),
38+
"custom": (
39+
{
40+
str: (
41+
bool,
42+
date,
43+
datetime,
44+
dict,
45+
float,
46+
int,
47+
list,
48+
str,
49+
none_type,
50+
)
51+
},
52+
),
3853
"end_timestamp": (datetime,),
3954
"env": (str,),
4055
"host": (str,),
@@ -54,6 +69,7 @@ def openapi_types(_):
5469

5570
attribute_map = {
5671
"attributes": "attributes",
72+
"custom": "custom",
5773
"end_timestamp": "end_timestamp",
5874
"env": "env",
5975
"host": "host",
@@ -74,6 +90,7 @@ def openapi_types(_):
7490
def __init__(
7591
self_,
7692
attributes: Union[Dict[str, Any], UnsetType] = unset,
93+
custom: Union[Dict[str, Any], UnsetType] = unset,
7794
end_timestamp: Union[datetime, UnsetType] = unset,
7895
env: Union[str, UnsetType] = unset,
7996
host: Union[str, UnsetType] = unset,
@@ -97,6 +114,9 @@ def __init__(
97114
:param attributes: JSON object of attributes from your span.
98115
:type attributes: {str: (bool, date, datetime, dict, float, int, list, str, none_type,)}, optional
99116
117+
:param custom: JSON object of custom spans data.
118+
:type custom: {str: (bool, date, datetime, dict, float, int, list, str, none_type,)}, optional
119+
100120
:param end_timestamp: End timestamp of your span.
101121
:type end_timestamp: datetime, optional
102122
@@ -146,6 +166,8 @@ def __init__(
146166
"""
147167
if attributes is not unset:
148168
kwargs["attributes"] = attributes
169+
if custom is not unset:
170+
kwargs["custom"] = custom
149171
if end_timestamp is not unset:
150172
kwargs["end_timestamp"] = end_timestamp
151173
if env 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
@@ -1184,6 +1184,8 @@
11841184
from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem
11851185
from datadog_api_client.v2.model.span import Span
11861186
from datadog_api_client.v2.model.spans_aggregate_bucket import SpansAggregateBucket
1187+
from datadog_api_client.v2.model.spans_aggregate_bucket_attributes import SpansAggregateBucketAttributes
1188+
from datadog_api_client.v2.model.spans_aggregate_bucket_type import SpansAggregateBucketType
11871189
from datadog_api_client.v2.model.spans_aggregate_bucket_value import SpansAggregateBucketValue
11881190
from datadog_api_client.v2.model.spans_aggregate_bucket_value_timeseries_point import (
11891191
SpansAggregateBucketValueTimeseriesPoint,
@@ -2302,6 +2304,8 @@
23022304
"SlackIntegrationMetadataChannelItem",
23032305
"Span",
23042306
"SpansAggregateBucket",
2307+
"SpansAggregateBucketAttributes",
2308+
"SpansAggregateBucketType",
23052309
"SpansAggregateBucketValue",
23062310
"SpansAggregateBucketValueTimeseriesPoint",
23072311
"SpansAggregateData",

0 commit comments

Comments
 (0)