Skip to content

Commit fa40d57

Browse files
Merge master into datadog-api-spec/test/bruce.tu/DBNBK-116-Extend-Widget.TIME-schema
2 parents 2a8c321 + 9221073 commit fa40d57

17 files changed

+42
-33
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.6",
7-
"regenerated": "2024-08-27 12:12:27.969266",
8-
"spec_repo_commit": "09daef2e"
7+
"regenerated": "2024-08-29 20:02:03.124770",
8+
"spec_repo_commit": "518ca9df"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-27 12:12:27.987178",
13-
"spec_repo_commit": "09daef2e"
12+
"regenerated": "2024-08-29 20:02:03.141872",
13+
"spec_repo_commit": "518ca9df"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6725,9 +6725,10 @@ components:
67256725
be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles)
67266726
and are located in the `data.id` field. Editing a monitor includes any
67276727
updates to the monitor configuration, monitor deletion, and muting of
6728-
the monitor for any amount of time. `restricted_roles` is the successor
6729-
of `locked`. For more information about `locked` and `restricted_roles`,
6730-
see the [monitor options docs](https://docs.datadoghq.com/monitors/guide/monitor_api_options/#permissions-options).
6728+
the monitor for any amount of time. You can use the [Restriction Policies
6729+
API](https://docs.datadoghq.com/api/latest/restriction-policies/) to manage
6730+
write authorization for individual monitors by teams and users, in addition
6731+
to roles.
67316732
items:
67326733
description: A role UUID.
67336734
type: string

.generator/src/generator/templates/model_utils.j2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,8 +1373,11 @@ def model_to_dict(model_instance, serialize=True):
13731373
result = {}
13741374

13751375
model_instances = [model_instance]
1376-
if model_instance._composed_schemas:
1377-
model_instances.extend(model_instance._composed_instances)
1376+
model = model_instance
1377+
while model._composed_schemas:
1378+
model_instances.extend(model._composed_instances)
1379+
model = model.get_oneof_instance()
1380+
13781381
seen_json_attribute_names = set()
13791382
used_fallback_python_attribute_names = set()
13801383
py_to_json_map = {}

examples/v2/service-level-objectives/CreateSLOReportJob.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Create a new SLO report returns "OK" response
33
"""
44

5+
from datetime import datetime
6+
from dateutil.relativedelta import relativedelta
57
from datadog_api_client import ApiClient, Configuration
68
from datadog_api_client.v2.api.service_level_objectives_api import ServiceLevelObjectivesApi
79
from datadog_api_client.v2.model.slo_report_create_request import SloReportCreateRequest
@@ -12,8 +14,8 @@
1214
body = SloReportCreateRequest(
1315
data=SloReportCreateRequestData(
1416
attributes=SloReportCreateRequestAttributes(
15-
from_ts=1690901870,
16-
to_ts=1706803070,
17+
from_ts=int((datetime.now() + relativedelta(days=-40)).timestamp()),
18+
to_ts=int(datetime.now().timestamp()),
1719
query='slo_type:metric "SLO Reporting Test"',
1820
interval=SLOReportInterval.MONTHLY,
1921
timezone="America/New_York",

src/datadog_api_client/model_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,8 +1387,11 @@ def model_to_dict(model_instance, serialize=True):
13871387
result = {}
13881388

13891389
model_instances = [model_instance]
1390-
if model_instance._composed_schemas:
1391-
model_instances.extend(model_instance._composed_instances)
1390+
model = model_instance
1391+
while model._composed_schemas:
1392+
model_instances.extend(model._composed_instances)
1393+
model = model.get_oneof_instance()
1394+
13921395
seen_json_attribute_names = set()
13931396
used_fallback_python_attribute_names = set()
13941397
py_to_json_map = {}

src/datadog_api_client/v1/model/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def __init__(
147147
:param query: The monitor query.
148148
:type query: str
149149
150-
:param restricted_roles: A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the `Roles API <https://docs.datadoghq.com/api/latest/roles/#list-roles>`_ and are located in the ``data.id`` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. ``restricted_roles`` is the successor of ``locked``. For more information about ``locked`` and ``restricted_roles`` , see the `monitor options docs <https://docs.datadoghq.com/monitors/guide/monitor_api_options/#permissions-options>`_.
150+
:param restricted_roles: A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the `Roles API <https://docs.datadoghq.com/api/latest/roles/#list-roles>`_ and are located in the ``data.id`` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the `Restriction Policies API <https://docs.datadoghq.com/api/latest/restriction-policies/>`_ to manage write authorization for individual monitors by teams and users, in addition to roles.
151151
:type restricted_roles: [str], none_type, optional
152152
153153
:param state: Wrapper object with the different monitor states.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-18T20:09:43.575Z
1+
2024-08-29T19:53:50.818Z

tests/v2/cassettes/test_scenarios/test_create_a_new_slo_report_returns_bad_request_response.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"from_ts":1690901870,"interval":"bad-interval","query":"slo_type:metric
4-
\"SLO Reporting Test\"","to_ts":1706803070}}}'
3+
body: '{"data":{"attributes":{"from_ts":1721505230,"interval":"bad-interval","query":"slo_type:metric
4+
\"SLO Reporting Test\"","to_ts":1724961230}}}'
55
headers:
66
accept:
77
- application/json
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-18T20:09:43.729Z
1+
2024-08-29T19:53:50.962Z

tests/v2/cassettes/test_scenarios/test_create_a_new_slo_report_returns_ok_response.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"from_ts":1690901870,"interval":"monthly","query":"slo_type:metric
4-
\"SLO Reporting Test\"","timezone":"America/New_York","to_ts":1706803070}}}'
3+
body: '{"data":{"attributes":{"from_ts":1721505230,"interval":"monthly","query":"slo_type:metric
4+
\"SLO Reporting Test\"","timezone":"America/New_York","to_ts":1724961230}}}'
55
headers:
66
accept:
77
- application/json
@@ -11,7 +11,7 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v2/slo/report
1212
response:
1313
body:
14-
string: '{"data":{"id":"98c67bea-fdbf-11ee-8a01-bfd37432018b","type":"report_id"}}'
14+
string: '{"data":{"id":"69cfaa02-6640-11ef-8501-33b2b403f044","type":"report_id"}}'
1515
headers:
1616
content-type:
1717
- application/vnd.api+json

0 commit comments

Comments
 (0)