|
3 | 3 | # Copyright 2019-Present Datadog, Inc. |
4 | 4 | from __future__ import annotations |
5 | 5 |
|
6 | | -from typing import Any, Dict, List, Union, TYPE_CHECKING |
| 6 | +from typing import Union, TYPE_CHECKING |
7 | 7 |
|
8 | 8 | from datadog_api_client.model_utils import ( |
9 | 9 | ModelNormal, |
10 | 10 | cached_property, |
11 | | - date, |
12 | | - datetime, |
13 | | - none_type, |
14 | 11 | unset, |
15 | 12 | UnsetType, |
16 | 13 | ) |
17 | 14 |
|
18 | 15 |
|
19 | 16 | 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 |
24 | 19 |
|
25 | 20 |
|
26 | 21 | class SpansAggregateBucket(ModelNormal): |
27 | 22 | @cached_property |
28 | 23 | 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 |
30 | 26 |
|
31 | 27 | 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,), |
48 | 31 | } |
49 | 32 |
|
50 | 33 | attribute_map = { |
51 | | - "by": "by", |
52 | | - "computes": "computes", |
| 34 | + "attributes": "attributes", |
| 35 | + "id": "id", |
| 36 | + "type": "type", |
53 | 37 | } |
54 | 38 |
|
55 | 39 | def __init__( |
56 | 40 | 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, |
62 | 44 | **kwargs, |
63 | 45 | ): |
64 | 46 | """ |
65 | | - A bucket values. |
| 47 | + Spans aggregate. |
66 | 48 |
|
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 |
69 | 51 |
|
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 |
72 | 57 | """ |
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 |
77 | 64 | super().__init__(kwargs) |
0 commit comments