Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135317,6 +135317,10 @@ components:
properties:
attributes:
$ref: "#/components/schemas/TimeseriesResponseAttributes"
id:
description: The identifier of the timeseries response resource.
example: "0"
type: string
type:
$ref: "#/components/schemas/TimeseriesFormulaResponseType"
type: object
Expand Down Expand Up @@ -136175,24 +136179,29 @@ components:
properties:
family:
description: Unit family, allows for conversion between units of the same family, for scaling.
example: time
example: percentage
type: string
id:
description: The identifier of the unit.
example: 17
format: int64
type: integer
name:
description: Unit name
example: minute
description: Unit name.
example: percent
type: string
plural:
description: Plural form of the unit name.
example: minutes
example: percent
type: string
scale_factor:
description: Factor for scaling between units of the same family.
example: 60.0
example: 1.0
format: double
type: number
short_name:
description: Abbreviation of the unit.
example: min
example: "%"
type: string
type: object
UnitCostCreateRequest:
Expand Down
8 changes: 8 additions & 0 deletions src/datadog_api_client/v2/model/timeseries_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ def openapi_types(_):

return {
"attributes": (TimeseriesResponseAttributes,),
"id": (str,),
"type": (TimeseriesFormulaResponseType,),
}

attribute_map = {
"attributes": "attributes",
"id": "id",
"type": "type",
}

def __init__(
self_,
attributes: Union[TimeseriesResponseAttributes, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
type: Union[TimeseriesFormulaResponseType, UnsetType] = unset,
**kwargs,
):
Expand All @@ -46,11 +49,16 @@ def __init__(
:param attributes: The object describing a timeseries response.
:type attributes: TimeseriesResponseAttributes, optional

:param id: The identifier of the timeseries response resource.
:type id: str, optional

:param type: The type of the resource. The value should always be timeseries_response.
:type type: TimeseriesFormulaResponseType, optional
"""
if attributes is not unset:
kwargs["attributes"] = attributes
if id is not unset:
kwargs["id"] = id
if type is not unset:
kwargs["type"] = type
super().__init__(kwargs)
10 changes: 9 additions & 1 deletion src/datadog_api_client/v2/model/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Unit(ModelNormal):
def openapi_types(_):
return {
"family": (str,),
"id": (int,),
"name": (str,),
"plural": (str,),
"scale_factor": (float,),
Expand All @@ -28,6 +29,7 @@ def openapi_types(_):

attribute_map = {
"family": "family",
"id": "id",
"name": "name",
"plural": "plural",
"scale_factor": "scale_factor",
Expand All @@ -37,6 +39,7 @@ def openapi_types(_):
def __init__(
self_,
family: Union[str, UnsetType] = unset,
id: Union[int, UnsetType] = unset,
name: Union[str, UnsetType] = unset,
plural: Union[str, UnsetType] = unset,
scale_factor: Union[float, UnsetType] = unset,
Expand All @@ -49,7 +52,10 @@ def __init__(
:param family: Unit family, allows for conversion between units of the same family, for scaling.
:type family: str, optional

:param name: Unit name
:param id: The identifier of the unit.
:type id: int, optional

:param name: Unit name.
:type name: str, optional

:param plural: Plural form of the unit name.
Expand All @@ -63,6 +69,8 @@ def __init__(
"""
if family is not unset:
kwargs["family"] = family
if id is not unset:
kwargs["id"] = id
if name is not unset:
kwargs["name"] = name
if plural is not unset:
Expand Down
1 change: 1 addition & 0 deletions tests/v2/features/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ Feature: Metrics
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:datadog.estimated_usage.metrics.custom{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}}
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "0"
And the response "data.type" is equal to "timeseries_response"

@skip-validation @team:ddoghq/timeseries-query
Expand Down
Loading