Skip to content

Commit 15f0b47

Browse files
api-clients-generation-pipeline[bot]anbnycci.datadog-api-spec
authored
Rename to ApmStats and add required properties (#92)
* Delete test_apm_resources_query_definition.py * Regenerate client from commit 28213aa of spec repo Co-authored-by: Alec Barrett <[email protected]> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent c2426a7 commit 15f0b47

12 files changed

+276
-28
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.2.0",
7-
"regenerated": "2020-09-28 17:45:15.578351",
8-
"spec_repo_commit": "3fc3b9c"
7+
"regenerated": "2020-09-29 10:49:50.689281",
8+
"spec_repo_commit": "28213aa"
99
},
1010
"v2": {
1111
"apigentools_version": "1.2.0",
12-
"regenerated": "2020-09-28 17:45:26.835204",
13-
"spec_repo_commit": "3fc3b9c"
12+
"regenerated": "2020-09-29 10:50:02.485322",
13+
"spec_repo_commit": "28213aa"
1414
}
1515
}
1616
}

docs/v1/ApmResourcesQueryDefinition.md renamed to docs/v1/ApmStatsQueryDefinition.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# ApmResourcesQueryDefinition
1+
# ApmStatsQueryDefinition
22

3-
The APM resources (stats) query for Table Widget.
3+
The APM stats query for table and distributions widgets.
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**env** | **str** | Environment name. |
88
**name** | **str** | Operation name associated with service. |
9+
**primary_tag** | **str** | The organization&#39;s host group name and value. |
10+
**row_type** | [**ApmStatsQueryRowType**](ApmStatsQueryRowType.md) | |
911
**service** | **str** | Service name. |
1012
**columns** | **[str]** | Column names used by front end for display. | [optional]
1113
**resource** | **str** | Resource name. | [optional]

docs/v1/ApmStatsQueryRowType.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ApmStatsQueryRowType
2+
3+
The level of detail for the request.
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **str** | The level of detail for the request. | must be one of ["service", "resource", "span", ]
8+
9+
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)
10+
11+

docs/v1/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ Class | Method | HTTP request | Description
297297
- [ApiKey](Datadog API key..md)
298298
- [ApiKeyListResponse](List of API and application keys available for a given organization..md)
299299
- [ApiKeyResponse](An API key with its associated metadata..md)
300-
- [ApmResourcesQueryDefinition](The APM resources (stats) query for Table Widget..md)
300+
- [ApmStatsQueryDefinition](The APM stats query for table and distributions widgets..md)
301+
- [ApmStatsQueryRowType](The level of detail for the request..md)
301302
- [ApplicationKey](An application key with its associated metadata..md)
302303
- [ApplicationKeyListResponse](An application key response..md)
303304
- [ApplicationKeyResponse](An application key response..md)

docs/v1/TableWidgetRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**aggregator** | [**WidgetAggregator**](WidgetAggregator.md) | | [optional]
88
**alias** | **str** | The column name (defaults to the metric name). | [optional]
99
**apm_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional]
10-
**apm_resources_query** | [**ApmResourcesQueryDefinition**](ApmResourcesQueryDefinition.md) | | [optional]
10+
**apm_stats_query** | [**ApmStatsQueryDefinition**](ApmStatsQueryDefinition.md) | | [optional]
1111
**conditional_formats** | [**[WidgetConditionalFormat]**](WidgetConditionalFormat.md) | List of conditional formats. | [optional]
1212
**event_query** | [**EventQueryDefinition**](EventQueryDefinition.md) | | [optional]
1313
**limit** | **int** | For metric queries, the number of lines to show in the table. Only one request should have this property. | [optional]

src/datadog_api_client/v1/model/apm_resources_query_definition.py renamed to src/datadog_api_client/v1/model/apm_stats_query_definition.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@
2525
validate_get_composed_info,
2626
)
2727

28+
def lazy_import():
29+
from datadog_api_client.v1.model.apm_stats_query_row_type import ApmStatsQueryRowType
30+
globals()['ApmStatsQueryRowType'] = ApmStatsQueryRowType
2831

29-
class ApmResourcesQueryDefinition(ModelNormal):
32+
33+
class ApmStatsQueryDefinition(ModelNormal):
3034
"""NOTE: This class is auto generated by OpenAPI Generator.
3135
Ref: https://openapi-generator.tech
3236
@@ -70,9 +74,12 @@ def openapi_types():
7074
openapi_types (dict): The key is attribute name
7175
and the value is attribute type.
7276
"""
77+
lazy_import()
7378
return {
7479
'env': (str,), # noqa: E501
7580
'name': (str,), # noqa: E501
81+
'primary_tag': (str,), # noqa: E501
82+
'row_type': (ApmStatsQueryRowType,), # noqa: E501
7683
'service': (str,), # noqa: E501
7784
'columns': ([str],), # noqa: E501
7885
'resource': (str,), # noqa: E501
@@ -86,6 +93,8 @@ def discriminator():
8693
attribute_map = {
8794
'env': 'env', # noqa: E501
8895
'name': 'name', # noqa: E501
96+
'primary_tag': 'primary_tag', # noqa: E501
97+
'row_type': 'row_type', # noqa: E501
8998
'service': 'service', # noqa: E501
9099
'columns': 'columns', # noqa: E501
91100
'resource': 'resource', # noqa: E501
@@ -103,12 +112,14 @@ def discriminator():
103112
])
104113

105114
@convert_js_args_to_python_args
106-
def __init__(self, env, name, service, *args, **kwargs): # noqa: E501
107-
"""ApmResourcesQueryDefinition - a model defined in OpenAPI
115+
def __init__(self, env, name, primary_tag, row_type, service, *args, **kwargs): # noqa: E501
116+
"""ApmStatsQueryDefinition - a model defined in OpenAPI
108117
109118
Args:
110119
env (str): Environment name.
111120
name (str): Operation name associated with service.
121+
primary_tag (str): The organization&#39;s host group name and value.
122+
row_type (ApmStatsQueryRowType):
112123
service (str): Service name.
113124
114125
Keyword Args:
@@ -171,6 +182,8 @@ def __init__(self, env, name, service, *args, **kwargs): # noqa: E501
171182

172183
self.env = env
173184
self.name = name
185+
self.primary_tag = primary_tag
186+
self.row_type = row_type
174187
self.service = service
175188
for var_name, var_value in kwargs.items():
176189
if var_name not in self.attribute_map and \
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# coding: utf-8
2+
3+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
4+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
5+
# Copyright 2019-Present Datadog, Inc.
6+
7+
8+
import re # noqa: F401
9+
import sys # noqa: F401
10+
11+
import nulltype # noqa: F401
12+
13+
from datadog_api_client.v1.model_utils import ( # noqa: F401
14+
ApiTypeError,
15+
ModelComposed,
16+
ModelNormal,
17+
ModelSimple,
18+
cached_property,
19+
change_keys_js_to_python,
20+
convert_js_args_to_python_args,
21+
date,
22+
datetime,
23+
file_type,
24+
none_type,
25+
validate_get_composed_info,
26+
)
27+
28+
29+
class ApmStatsQueryRowType(ModelSimple):
30+
"""NOTE: This class is auto generated by OpenAPI Generator.
31+
Ref: https://openapi-generator.tech
32+
33+
Do not edit the class manually.
34+
35+
Attributes:
36+
allowed_values (dict): The key is the tuple path to the attribute
37+
and the for var_name this is (var_name,). The value is a dict
38+
with a capitalized key describing the allowed value and an allowed
39+
value. These dicts store the allowed enum values.
40+
validations (dict): The key is the tuple path to the attribute
41+
and the for var_name this is (var_name,). The value is a dict
42+
that stores validations for max_length, min_length, max_items,
43+
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
44+
inclusive_minimum, and regex.
45+
additional_properties_type (tuple): A tuple of classes accepted
46+
as additional properties values.
47+
"""
48+
49+
allowed_values = {
50+
('value',): {
51+
'SERVICE': "service",
52+
'RESOURCE': "resource",
53+
'SPAN': "span",
54+
},
55+
}
56+
57+
validations = {
58+
}
59+
60+
additional_properties_type = None
61+
62+
_nullable = False
63+
64+
@cached_property
65+
def openapi_types():
66+
"""
67+
This must be a method because a model may have properties that are
68+
of type self, this must run after the class is loaded
69+
70+
Returns
71+
openapi_types (dict): The key is attribute name
72+
and the value is attribute type.
73+
"""
74+
return {
75+
'value': (str,),
76+
}
77+
78+
@cached_property
79+
def discriminator():
80+
return None
81+
82+
83+
attribute_map = {}
84+
85+
_composed_schemas = None
86+
87+
required_properties = set([
88+
'_data_store',
89+
'_check_type',
90+
'_spec_property_naming',
91+
'_path_to_item',
92+
'_configuration',
93+
'_visited_composed_classes',
94+
])
95+
96+
@convert_js_args_to_python_args
97+
def __init__(self, value, *args, **kwargs):
98+
"""ApmStatsQueryRowType - a model defined in OpenAPI
99+
100+
Args:
101+
value (str): The level of detail for the request.., must be one of ["service", "resource", "span", ] # noqa: E501
102+
103+
Keyword Args:
104+
_check_type (bool): if True, values for parameters in openapi_types
105+
will be type checked and a TypeError will be
106+
raised if the wrong type is input.
107+
Defaults to True
108+
_path_to_item (tuple/list): This is a list of keys or values to
109+
drill down to the model in received_data
110+
when deserializing a response
111+
_spec_property_naming (bool): True if the variable names in the input data
112+
are serialized names, as specified in the OpenAPI document.
113+
False if the variable names in the input data
114+
are pythonic names, e.g. snake case (default)
115+
_configuration (Configuration): the instance to use when
116+
deserializing a file_type parameter.
117+
If passed, type conversion is attempted
118+
If omitted no type conversion is done.
119+
_visited_composed_classes (tuple): This stores a tuple of
120+
classes that we have traveled through so that
121+
if we see that class again we will not use its
122+
discriminator again.
123+
When traveling through a discriminator, the
124+
composed schema that is
125+
is traveled through is added to this set.
126+
For example if Animal has a discriminator
127+
petType and we pass in "Dog", and the class Dog
128+
allOf includes Animal, we move through Animal
129+
once using the discriminator, and pick Dog.
130+
Then in Dog, we will make an instance of the
131+
Animal class but this time we won't travel
132+
through its discriminator because we passed in
133+
_visited_composed_classes = (Animal,)
134+
"""
135+
136+
_check_type = kwargs.pop('_check_type', True)
137+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
138+
_path_to_item = kwargs.pop('_path_to_item', ())
139+
_configuration = kwargs.pop('_configuration', None)
140+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
141+
142+
if args:
143+
raise ApiTypeError(
144+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
145+
args,
146+
self.__class__.__name__,
147+
),
148+
path_to_item=_path_to_item,
149+
valid_classes=(self.__class__,),
150+
)
151+
152+
self._data_store = {}
153+
self._check_type = _check_type
154+
self._spec_property_naming = _spec_property_naming
155+
self._path_to_item = _path_to_item
156+
self._configuration = _configuration
157+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
158+
self.value = value
159+
if kwargs:
160+
raise ApiTypeError(
161+
"Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % (
162+
kwargs,
163+
self.__class__.__name__,
164+
),
165+
path_to_item=_path_to_item,
166+
valid_classes=(self.__class__,),
167+
)

src/datadog_api_client/v1/model/table_widget_request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
)
2727

2828
def lazy_import():
29-
from datadog_api_client.v1.model.apm_resources_query_definition import ApmResourcesQueryDefinition
29+
from datadog_api_client.v1.model.apm_stats_query_definition import ApmStatsQueryDefinition
3030
from datadog_api_client.v1.model.event_query_definition import EventQueryDefinition
3131
from datadog_api_client.v1.model.log_query_definition import LogQueryDefinition
3232
from datadog_api_client.v1.model.process_query_definition import ProcessQueryDefinition
3333
from datadog_api_client.v1.model.widget_aggregator import WidgetAggregator
3434
from datadog_api_client.v1.model.widget_conditional_format import WidgetConditionalFormat
3535
from datadog_api_client.v1.model.widget_sort import WidgetSort
36-
globals()['ApmResourcesQueryDefinition'] = ApmResourcesQueryDefinition
36+
globals()['ApmStatsQueryDefinition'] = ApmStatsQueryDefinition
3737
globals()['EventQueryDefinition'] = EventQueryDefinition
3838
globals()['LogQueryDefinition'] = LogQueryDefinition
3939
globals()['ProcessQueryDefinition'] = ProcessQueryDefinition
@@ -91,7 +91,7 @@ def openapi_types():
9191
'aggregator': (WidgetAggregator,), # noqa: E501
9292
'alias': (str,), # noqa: E501
9393
'apm_query': (LogQueryDefinition,), # noqa: E501
94-
'apm_resources_query': (ApmResourcesQueryDefinition,), # noqa: E501
94+
'apm_stats_query': (ApmStatsQueryDefinition,), # noqa: E501
9595
'conditional_formats': ([WidgetConditionalFormat],), # noqa: E501
9696
'event_query': (EventQueryDefinition,), # noqa: E501
9797
'limit': (int,), # noqa: E501
@@ -113,7 +113,7 @@ def discriminator():
113113
'aggregator': 'aggregator', # noqa: E501
114114
'alias': 'alias', # noqa: E501
115115
'apm_query': 'apm_query', # noqa: E501
116-
'apm_resources_query': 'apm_resources_query', # noqa: E501
116+
'apm_stats_query': 'apm_stats_query', # noqa: E501
117117
'conditional_formats': 'conditional_formats', # noqa: E501
118118
'event_query': 'event_query', # noqa: E501
119119
'limit': 'limit', # noqa: E501
@@ -175,7 +175,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
175175
aggregator (WidgetAggregator): [optional] # noqa: E501
176176
alias (str): The column name (defaults to the metric name).. [optional] # noqa: E501
177177
apm_query (LogQueryDefinition): [optional] # noqa: E501
178-
apm_resources_query (ApmResourcesQueryDefinition): [optional] # noqa: E501
178+
apm_stats_query (ApmStatsQueryDefinition): [optional] # noqa: E501
179179
conditional_formats ([WidgetConditionalFormat]): List of conditional formats.. [optional] # noqa: E501
180180
event_query (EventQueryDefinition): [optional] # noqa: E501
181181
limit (int): For metric queries, the number of lines to show in the table. Only one request should have this property.. [optional] # noqa: E501

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
from datadog_api_client.v1.model.api_key import ApiKey
3131
from datadog_api_client.v1.model.api_key_list_response import ApiKeyListResponse
3232
from datadog_api_client.v1.model.api_key_response import ApiKeyResponse
33-
from datadog_api_client.v1.model.apm_resources_query_definition import ApmResourcesQueryDefinition
33+
from datadog_api_client.v1.model.apm_stats_query_definition import ApmStatsQueryDefinition
34+
from datadog_api_client.v1.model.apm_stats_query_row_type import ApmStatsQueryRowType
3435
from datadog_api_client.v1.model.application_key import ApplicationKey
3536
from datadog_api_client.v1.model.application_key_list_response import ApplicationKeyListResponse
3637
from datadog_api_client.v1.model.application_key_response import ApplicationKeyResponse

0 commit comments

Comments
 (0)