Skip to content

Commit 68d9858

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 56d3544 of spec repo (#260)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent da7f071 commit 68d9858

9 files changed

+275
-9
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.4.1.dev2",
7-
"regenerated": "2021-02-03 08:38:50.447684",
8-
"spec_repo_commit": "f02c467"
7+
"regenerated": "2021-02-03 19:01:18.281323",
8+
"spec_repo_commit": "56d3544"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev2",
12-
"regenerated": "2021-02-03 08:39:28.168476",
13-
"spec_repo_commit": "f02c467"
12+
"regenerated": "2021-02-03 19:01:53.983548",
13+
"spec_repo_commit": "56d3544"
1414
}
1515
}
1616
}

docs/v1/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ Class | Method | HTTP request | Description
514514
- [SLOHistoryMetrics](SLOHistoryMetrics.md)
515515
- [SLOHistoryMetricsSeries](SLOHistoryMetricsSeries.md)
516516
- [SLOHistoryMetricsSeriesMetadata](SLOHistoryMetricsSeriesMetadata.md)
517+
- [SLOHistoryMetricsSeriesMetadataUnit](SLOHistoryMetricsSeriesMetadataUnit.md)
517518
- [SLOHistoryResponse](SLOHistoryResponse.md)
518519
- [SLOHistoryResponseData](SLOHistoryResponseData.md)
519520
- [SLOHistoryResponseError](SLOHistoryResponseError.md)

docs/v1/SLOHistoryMetricsSeriesMetadata.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**metric** | **str** | Query metric used. | [optional]
1010
**query_index** | **int** | Query index from original combined query. | [optional]
1111
**scope** | **str** | Query scope. | [optional]
12-
**unit** | **str** | Query units (if available). | [optional]
12+
**unit** | [**SLOHistoryMetricsSeriesMetadataUnit**](SLOHistoryMetricsSeriesMetadataUnit.md) | | [optional]
1313

1414
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)
1515

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SLOHistoryMetricsSeriesMetadataUnit
2+
3+
An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null.
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null. |
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+

src/datadog_api_client/v1/model/slo_history_metrics_series_metadata.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
)
2525

2626

27+
def lazy_import():
28+
from datadog_api_client.v1.model.slo_history_metrics_series_metadata_unit import SLOHistoryMetricsSeriesMetadataUnit
29+
30+
globals()["SLOHistoryMetricsSeriesMetadataUnit"] = SLOHistoryMetricsSeriesMetadataUnit
31+
32+
2733
class SLOHistoryMetricsSeriesMetadata(ModelNormal):
2834
"""NOTE: This class is auto generated by OpenAPI Generator.
2935
Ref: https://openapi-generator.tech
@@ -66,13 +72,14 @@ def openapi_types():
6672
openapi_types (dict): The key is attribute name
6773
and the value is attribute type.
6874
"""
75+
lazy_import()
6976
return {
7077
"aggr": (str,), # noqa: E501
7178
"expression": (str,), # noqa: E501
7279
"metric": (str,), # noqa: E501
7380
"query_index": (int,), # noqa: E501
7481
"scope": (str,), # noqa: E501
75-
"unit": (str,), # noqa: E501
82+
"unit": (SLOHistoryMetricsSeriesMetadataUnit,), # noqa: E501
7683
}
7784

7885
@cached_property
@@ -141,7 +148,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
141148
metric (str): Query metric used.. [optional] # noqa: E501
142149
query_index (int): Query index from original combined query.. [optional] # noqa: E501
143150
scope (str): Query scope.. [optional] # noqa: E501
144-
unit (str): Query units (if available).. [optional] # noqa: E501
151+
unit (SLOHistoryMetricsSeriesMetadataUnit): [optional] # noqa: E501
145152
"""
146153

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

src/datadog_api_client/v1/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@
255255
from datadog_api_client.v1.model.slo_history_metrics import SLOHistoryMetrics
256256
from datadog_api_client.v1.model.slo_history_metrics_series import SLOHistoryMetricsSeries
257257
from datadog_api_client.v1.model.slo_history_metrics_series_metadata import SLOHistoryMetricsSeriesMetadata
258+
from datadog_api_client.v1.model.slo_history_metrics_series_metadata_unit import SLOHistoryMetricsSeriesMetadataUnit
258259
from datadog_api_client.v1.model.slo_history_response import SLOHistoryResponse
259260
from datadog_api_client.v1.model.slo_history_response_data import SLOHistoryResponseData
260261
from datadog_api_client.v1.model.slo_history_response_error import SLOHistoryResponseError

src/datadog_api_client/v1/openapi.yaml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5190,8 +5190,7 @@ components:
51905190
description: Query scope.
51915191
type: string
51925192
unit:
5193-
description: Query units (if available).
5194-
type: string
5193+
$ref: '#/components/schemas/SLOHistoryMetricsSeriesMetadataUnit'
51955194
type: object
51965195
sum:
51975196
description: Total sum of the query.
@@ -5212,6 +5211,44 @@ components:
52125211
- values
52135212
- metadata
52145213
type: object
5214+
SLOHistoryMetricsSeriesMetadataUnit:
5215+
description: 'An array of metric units that contains up to two unit objects.
5216+
5217+
For example, bytes represents one unit object and bytes per second represents
5218+
two unit objects.
5219+
5220+
If a metric query only has one unit object, the second array element is null.'
5221+
example: '[{"family":"bytes","scale_factor":1.0,"name":"byte","short_name":"B","plural":"bytes","id":2},null]'
5222+
items:
5223+
description: An Object of metric units.
5224+
properties:
5225+
family:
5226+
description: The family of metric unit, for example `bytes` is the family
5227+
for `kibibyte`, `byte`, and `bit` units.
5228+
type: string
5229+
id:
5230+
description: The ID of the metric unit.
5231+
format: int64
5232+
type: integer
5233+
name:
5234+
description: The unit of the metric, for instance `byte`.
5235+
type: string
5236+
plural:
5237+
description: The plural Unit of metric, for instance `bytes`.
5238+
nullable: true
5239+
type: string
5240+
scale_factor:
5241+
description: The scale factor of metric unit, for instance `1.0`.
5242+
format: double
5243+
type: number
5244+
short_name:
5245+
description: A shorter and abbreviated version of the metric unit, for
5246+
instance `B`.
5247+
nullable: true
5248+
type: string
5249+
type: object
5250+
nullable: true
5251+
type: array
52155252
SLOHistoryResponse:
52165253
description: A service level objective history response.
52175254
properties:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
5+
6+
import sys
7+
import unittest
8+
9+
import datadog_api_client.v1
10+
from datadog_api_client.v1.model.slo_history_metrics_series_metadata_unit import SLOHistoryMetricsSeriesMetadataUnit
11+
12+
13+
class TestSLOHistoryMetricsSeriesMetadataUnit(unittest.TestCase):
14+
"""SLOHistoryMetricsSeriesMetadataUnit unit test stubs"""
15+
16+
def setUp(self):
17+
pass
18+
19+
def tearDown(self):
20+
pass
21+
22+
def testSLOHistoryMetricsSeriesMetadataUnit(self):
23+
"""Test SLOHistoryMetricsSeriesMetadataUnit"""
24+
# FIXME: construct object with mandatory attributes with example values
25+
# model = SLOHistoryMetricsSeriesMetadataUnit() # noqa: E501
26+
pass
27+
28+
29+
if __name__ == "__main__":
30+
unittest.main()

0 commit comments

Comments
 (0)