From 5573c6f7ec8c1d025d514291a428a4c4a54b9257 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 21 Oct 2026 09:39:31 +0000 Subject: [PATCH] Regenerate client from commit 1e651d0 of spec repo --- .generator/schemas/v2/openapi.yaml | 37 ++++ .../CreateOnCallSchedule_2169247120.py | 92 ++++++++ ...schedule_create_request_data_attributes.py | 26 ++- .../v2/model/schedule_data_attributes.py | 16 ++ ...schedule_update_request_data_attributes.py | 26 ++- .../test-runner-data/manifest.json | 7 + ...all-schedule-returns-created-response.json | 71 +++++++ .../test-server-data/v2/on-call.json | 201 ++++++++++++++++++ tests/v2/features/on-call.feature | 16 +- 9 files changed, 485 insertions(+), 7 deletions(-) create mode 100644 examples/v2/on-call/CreateOnCallSchedule_2169247120.py create mode 100644 tests/generated-test/test-runner-data/v2/on-call/create-additive-on-call-schedule-returns-created-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a76195ae98..29872b8b53 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -109793,6 +109793,7 @@ components: example: data: attributes: + max_responders: 1 name: On-Call Schedule time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d @@ -109874,6 +109875,7 @@ components: start_day: monday start_time: "09:00:00" rotation_start: "2025-02-01T00:00:00Z" + max_responders: 1 name: On-Call Schedule time_zone: America/New_York relationships: @@ -109909,6 +109911,15 @@ components: items: $ref: "#/components/schemas/ScheduleCreateRequestDataAttributesLayersItems" type: array + max_responders: + description: |- + Maximum number of users who can be on call at the same time. + The value must be between 1 and the number of layers, and no greater than 10. + example: 1 + format: int64 + maximum: 10 + minimum: 1 + type: integer name: description: A human-readable name for the new schedule. example: Team A On-Call @@ -110002,6 +110013,15 @@ components: ScheduleDataAttributes: description: Provides core properties of a schedule object such as its name and time zone. properties: + max_responders: + description: |- + Maximum number of users who can be on call at the same time. + The value is between 1 and the number of layers, and no greater than 10. + example: 1 + format: int64 + maximum: 10 + minimum: 1 + type: integer name: description: A short name for the schedule. example: Primary On-Call @@ -110484,6 +110504,7 @@ components: start_day: monday start_time: "09:00:00" rotation_start: "2025-02-01T00:00:00Z" + max_responders: 1 name: On-Call Schedule Updated time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d @@ -110526,6 +110547,15 @@ components: items: $ref: "#/components/schemas/ScheduleUpdateRequestDataAttributesLayersItems" type: array + max_responders: + description: |- + Maximum number of users who can be on call at the same time. + The value must be between 1 and the number of layers, and no greater than 10. + example: 1 + format: int64 + maximum: 10 + minimum: 1 + type: integer name: description: A short name for the schedule. example: Primary On-Call @@ -110655,6 +110685,7 @@ components: example: data: - attributes: + max_responders: 1 name: Primary On-Call tags: [] time_zone: America/New_York @@ -205307,6 +205338,7 @@ paths: value: data: - attributes: + max_responders: 1 name: Primary On-Call tags: [] time_zone: America/New_York @@ -205385,6 +205417,7 @@ paths: start_day: monday start_time: 09:00:00 rotation_start: "2025-02-01T00:00:00Z" + max_responders: 1 name: On-Call Schedule time_zone: America/New_York relationships: @@ -205405,6 +205438,7 @@ paths: value: data: attributes: + max_responders: 1 name: On-Call Schedule time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d @@ -205499,6 +205533,7 @@ paths: value: data: attributes: + max_responders: 1 name: On-Call Schedule time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d @@ -205573,6 +205608,7 @@ paths: start_day: monday start_time: 09:00:00 rotation_start: "2025-02-01T00:00:00Z" + max_responders: 1 name: On-Call Schedule Updated time_zone: America/New_York id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d @@ -205594,6 +205630,7 @@ paths: value: data: attributes: + max_responders: 1 name: On-Call Schedule time_zone: America/New_York id: 00000000-0000-0000-0000-000000000001 diff --git a/examples/v2/on-call/CreateOnCallSchedule_2169247120.py b/examples/v2/on-call/CreateOnCallSchedule_2169247120.py new file mode 100644 index 0000000000..2a7b779974 --- /dev/null +++ b/examples/v2/on-call/CreateOnCallSchedule_2169247120.py @@ -0,0 +1,92 @@ +""" +Create additive On-Call schedule returns "Created" response +""" + +from datetime import datetime +from dateutil.relativedelta import relativedelta +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.on_call_api import OnCallApi +from datadog_api_client.v2.model.data_relationships_teams import DataRelationshipsTeams +from datadog_api_client.v2.model.data_relationships_teams_data_items import DataRelationshipsTeamsDataItems +from datadog_api_client.v2.model.data_relationships_teams_data_items_type import DataRelationshipsTeamsDataItemsType +from datadog_api_client.v2.model.layer_attributes_interval import LayerAttributesInterval +from datadog_api_client.v2.model.schedule_create_request import ScheduleCreateRequest +from datadog_api_client.v2.model.schedule_create_request_data import ScheduleCreateRequestData +from datadog_api_client.v2.model.schedule_create_request_data_attributes import ScheduleCreateRequestDataAttributes +from datadog_api_client.v2.model.schedule_create_request_data_attributes_layers_items import ( + ScheduleCreateRequestDataAttributesLayersItems, +) +from datadog_api_client.v2.model.schedule_create_request_data_relationships import ( + ScheduleCreateRequestDataRelationships, +) +from datadog_api_client.v2.model.schedule_create_request_data_type import ScheduleCreateRequestDataType +from datadog_api_client.v2.model.schedule_request_data_attributes_layers_items_members_items import ( + ScheduleRequestDataAttributesLayersItemsMembersItems, +) +from datadog_api_client.v2.model.schedule_request_data_attributes_layers_items_members_items_user import ( + ScheduleRequestDataAttributesLayersItemsMembersItemsUser, +) +from datadog_api_client.v2.model.time_restriction import TimeRestriction +from datadog_api_client.v2.model.weekday import Weekday + +# there is a valid "user" in the system +USER_DATA_ID = environ["USER_DATA_ID"] + +# there is a valid "dd_team" in the system +DD_TEAM_DATA_ID = environ["DD_TEAM_DATA_ID"] + +body = ScheduleCreateRequest( + data=ScheduleCreateRequestData( + attributes=ScheduleCreateRequestDataAttributes( + max_responders=1, + layers=[ + ScheduleCreateRequestDataAttributesLayersItems( + effective_date=(datetime.now() + relativedelta(days=-10)), + end_date=(datetime.now() + relativedelta(days=10)), + interval=LayerAttributesInterval( + days=1, + ), + members=[ + ScheduleRequestDataAttributesLayersItemsMembersItems( + user=ScheduleRequestDataAttributesLayersItemsMembersItemsUser( + id=USER_DATA_ID, + ), + ), + ], + name="Layer 1", + restrictions=[ + TimeRestriction( + end_day=Weekday.FRIDAY, + end_time="17:00:00", + start_day=Weekday.MONDAY, + start_time="09:00:00", + ), + ], + rotation_start=(datetime.now() + relativedelta(days=-5)), + ), + ], + name="Example-On-Call", + time_zone="America/New_York", + ), + relationships=ScheduleCreateRequestDataRelationships( + teams=DataRelationshipsTeams( + data=[ + DataRelationshipsTeamsDataItems( + id=DD_TEAM_DATA_ID, + type=DataRelationshipsTeamsDataItemsType.TEAMS, + ), + ], + ), + ), + type=ScheduleCreateRequestDataType.SCHEDULES, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = OnCallApi(api_client) + response = api_instance.create_on_call_schedule(body=body) + + print(response) diff --git a/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py b/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py index fcb67d1302..e5b00999a5 100644 --- a/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/schedule_create_request_data_attributes.py @@ -3,11 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -18,6 +20,13 @@ class ScheduleCreateRequestDataAttributes(ModelNormal): + validations = { + "max_responders": { + "inclusive_maximum": 10, + "inclusive_minimum": 1, + }, + } + @cached_property def openapi_types(_): from datadog_api_client.v2.model.schedule_create_request_data_attributes_layers_items import ( @@ -26,18 +35,25 @@ def openapi_types(_): return { "layers": ([ScheduleCreateRequestDataAttributesLayersItems],), + "max_responders": (int,), "name": (str,), "time_zone": (str,), } attribute_map = { "layers": "layers", + "max_responders": "max_responders", "name": "name", "time_zone": "time_zone", } def __init__( - self_, layers: List[ScheduleCreateRequestDataAttributesLayersItems], name: str, time_zone: str, **kwargs + self_, + layers: List[ScheduleCreateRequestDataAttributesLayersItems], + name: str, + time_zone: str, + max_responders: Union[int, UnsetType] = unset, + **kwargs, ): """ Describes the main attributes for creating a new schedule, including name, layers, and time zone. @@ -45,12 +61,18 @@ def __init__( :param layers: The layers of On-Call coverage that define rotation intervals and restrictions. :type layers: [ScheduleCreateRequestDataAttributesLayersItems] + :param max_responders: Maximum number of users who can be on call at the same time. + The value must be between 1 and the number of layers, and no greater than 10. + :type max_responders: int, optional + :param name: A human-readable name for the new schedule. :type name: str :param time_zone: The time zone in which the schedule is defined. :type time_zone: str """ + if max_responders is not unset: + kwargs["max_responders"] = max_responders super().__init__(kwargs) self_.layers = layers diff --git a/src/datadog_api_client/v2/model/schedule_data_attributes.py b/src/datadog_api_client/v2/model/schedule_data_attributes.py index 2824a83d79..3f8a8988d9 100644 --- a/src/datadog_api_client/v2/model/schedule_data_attributes.py +++ b/src/datadog_api_client/v2/model/schedule_data_attributes.py @@ -14,15 +14,24 @@ class ScheduleDataAttributes(ModelNormal): + validations = { + "max_responders": { + "inclusive_maximum": 10, + "inclusive_minimum": 1, + }, + } + @cached_property def openapi_types(_): return { + "max_responders": (int,), "name": (str,), "tags": ([str],), "time_zone": (str,), } attribute_map = { + "max_responders": "max_responders", "name": "name", "tags": "tags", "time_zone": "time_zone", @@ -30,6 +39,7 @@ def openapi_types(_): def __init__( self_, + max_responders: Union[int, UnsetType] = unset, name: Union[str, UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, time_zone: Union[str, UnsetType] = unset, @@ -38,6 +48,10 @@ def __init__( """ Provides core properties of a schedule object such as its name and time zone. + :param max_responders: Maximum number of users who can be on call at the same time. + The value is between 1 and the number of layers, and no greater than 10. + :type max_responders: int, optional + :param name: A short name for the schedule. :type name: str, optional @@ -47,6 +61,8 @@ def __init__( :param time_zone: The time zone in which this schedule operates. :type time_zone: str, optional """ + if max_responders is not unset: + kwargs["max_responders"] = max_responders if name is not unset: kwargs["name"] = name if tags is not unset: diff --git a/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py b/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py index 8ea5a4931a..f57fff8811 100644 --- a/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/schedule_update_request_data_attributes.py @@ -3,11 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -18,6 +20,13 @@ class ScheduleUpdateRequestDataAttributes(ModelNormal): + validations = { + "max_responders": { + "inclusive_maximum": 10, + "inclusive_minimum": 1, + }, + } + @cached_property def openapi_types(_): from datadog_api_client.v2.model.schedule_update_request_data_attributes_layers_items import ( @@ -26,18 +35,25 @@ def openapi_types(_): return { "layers": ([ScheduleUpdateRequestDataAttributesLayersItems],), + "max_responders": (int,), "name": (str,), "time_zone": (str,), } attribute_map = { "layers": "layers", + "max_responders": "max_responders", "name": "name", "time_zone": "time_zone", } def __init__( - self_, layers: List[ScheduleUpdateRequestDataAttributesLayersItems], name: str, time_zone: str, **kwargs + self_, + layers: List[ScheduleUpdateRequestDataAttributesLayersItems], + name: str, + time_zone: str, + max_responders: Union[int, UnsetType] = unset, + **kwargs, ): """ Defines the updatable attributes for a schedule, such as name, time zone, and layers. @@ -45,12 +61,18 @@ def __init__( :param layers: The updated list of layers (rotations) for this schedule. :type layers: [ScheduleUpdateRequestDataAttributesLayersItems] + :param max_responders: Maximum number of users who can be on call at the same time. + The value must be between 1 and the number of layers, and no greater than 10. + :type max_responders: int, optional + :param name: A short name for the schedule. :type name: str :param time_zone: The time zone used when interpreting rotation times. :type time_zone: str """ + if max_responders is not unset: + kwargs["max_responders"] = max_responders super().__init__(kwargs) self_.layers = layers diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index dce8e01f02..c2d1383b82 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -8883,6 +8883,13 @@ "scenario": "Create On-Call schedule returns \"Created\" response", "version": "v2" }, + { + "feature": "On-Call", + "feature_file": "../../v2/features/on-call.feature", + "file": "v2/on-call/create-additive-on-call-schedule-returns-created-response.json", + "scenario": "Create additive On-Call schedule returns \"Created\" response", + "version": "v2" + }, { "feature": "On-Call", "feature_file": "../../v2/features/on-call.feature", diff --git a/tests/generated-test/test-runner-data/v2/on-call/create-additive-on-call-schedule-returns-created-response.json b/tests/generated-test/test-runner-data/v2/on-call/create-additive-on-call-schedule-returns-created-response.json new file mode 100644 index 0000000000..d90f102ecb --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/on-call/create-additive-on-call-schedule-returns-created-response.json @@ -0,0 +1,71 @@ +{ + "api": "On-Call", + "expected_status": 201, + "feature": "On-Call", + "id": "v2/On-Call/Create additive On-Call schedule returns \"Created\" response", + "operation_id": "CreateOnCallSchedule", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ScheduleCreateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "layers": [ + { + "effective_date": "{{ timeISO('now - 10d') }}", + "end_date": "{{ timeISO('now + 10d') }}", + "interval": { + "days": 1 + }, + "members": [ + { + "user": { + "id": "{{user.data.id}}" + } + } + ], + "name": "Layer 1", + "restrictions": [ + { + "end_day": "friday", + "end_time": "17:00:00", + "start_day": "monday", + "start_time": "09:00:00" + } + ], + "rotation_start": "{{ timeISO('now - 5d') }}" + } + ], + "max_responders": 1, + "name": "{{ unique }}", + "time_zone": "America/New_York" + }, + "relationships": { + "teams": { + "data": [ + { + "id": "{{dd_team.data.id}}", + "type": "teams" + } + ] + } + }, + "type": "schedules" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/on-call/schedules" + }, + "scenario": "Create additive On-Call schedule returns \"Created\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-server-data/v2/on-call.json b/tests/generated-test/test-server-data/v2/on-call.json index 3d6f3e098d..436a2fde97 100644 --- a/tests/generated-test/test-server-data/v2/on-call.json +++ b/tests/generated-test/test-server-data/v2/on-call.json @@ -718,6 +718,207 @@ "scenario": "Create On-Call schedule returns \"Created\" response", "version": "v2" }, + { + "feature": "On-Call", + "frozen_at": "2026-10-20T11:32:04.097Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Create_additive_On_Call_schedule_returns_Created_response-1792495924@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"abeef14b-68fc-4ad6-9ddd-0812391aa040\",\"attributes\":{\"uuid\":\"abeef14b-68fc-4ad6-9ddd-0812391aa040\",\"name\":null,\"handle\":\"test-create_additive_on_call_schedule_returns_created_response-1792495924@datadoghq.com\",\"created_at\":\"2026-10-20T11:32:06.420588+00:00\",\"modified_at\":\"2026-10-20T11:32:06.420588+00:00\",\"email\":\"test-create_additive_on_call_schedule_returns_created_response-1792495924@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/213f27789bc8221573484f959f3135f7?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-ead75d58f5fb7c5c", + "name": "test-name-ead75d58f5fb7c5c" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"beb4aedb-ba05-488e-852c-dc2cf3591a9e\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T11:32:06.532436+00:00\",\"description\":null,\"handle\":\"test-handle-ead75d58f5fb7c5c\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T11:32:06.532437+00:00\",\"name\":\"test-name-ead75d58f5fb7c5c\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/beb4aedb-ba05-488e-852c-dc2cf3591a9e/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/beb4aedb-ba05-488e-852c-dc2cf3591a9e/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "layers": [ + { + "effective_date": "2026-10-10T11:32:04.097Z", + "end_date": "2026-10-30T11:32:04.097Z", + "interval": { + "days": 1 + }, + "members": [ + { + "user": { + "id": "abeef14b-68fc-4ad6-9ddd-0812391aa040" + } + } + ], + "name": "Layer 1", + "restrictions": [ + { + "end_day": "friday", + "end_time": "17:00:00", + "start_day": "monday", + "start_time": "09:00:00" + } + ], + "rotation_start": "2026-10-15T11:32:04.097Z" + } + ], + "max_responders": 1, + "name": "Test-Create_additive_On_Call_schedule_returns_Created_response-1792495924", + "time_zone": "America/New_York" + }, + "relationships": { + "teams": { + "data": [ + { + "id": "beb4aedb-ba05-488e-852c-dc2cf3591a9e", + "type": "teams" + } + ] + } + }, + "type": "schedules" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/on-call/schedules", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"b46d8df3-cda6-4342-9b74-f3788ff235de\",\"type\":\"schedules\",\"attributes\":{\"max_responders\":1,\"name\":\"Test-Create_additive_On_Call_schedule_returns_Created_response-1792495924\",\"tags\":[],\"time_zone\":\"America/New_York\"},\"relationships\":{\"layers\":{\"data\":[{\"id\":\"33ed2f85-3bdf-45ff-a886-2ad0429825ab\",\"type\":\"layers\"}]},\"teams\":{\"data\":[{\"id\":\"beb4aedb-ba05-488e-852c-dc2cf3591a9e\",\"type\":\"teams\"}]}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/on-call/schedules/b46d8df3-cda6-4342-9b74-f3788ff235de", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/beb4aedb-ba05-488e-852c-dc2cf3591a9e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/abeef14b-68fc-4ad6-9ddd-0812391aa040", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Create additive On-Call schedule returns \"Created\" response", + "version": "v2" + }, { "feature": "On-Call", "frozen_at": "2025-12-12T14:05:32.425Z", diff --git a/tests/v2/features/on-call.feature b/tests/v2/features/on-call.feature index 37d33074e5..0288aa15cf 100644 --- a/tests/v2/features/on-call.feature +++ b/tests/v2/features/on-call.feature @@ -56,7 +56,7 @@ Feature: On-Call @generated @skip @team:ddoghq/on-call Scenario: Create On-Call schedule returns "Bad Request" response Given new "CreateOnCallSchedule" request - And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"days": 1}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"days": 1}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "max_responders": 1, "name": "On-Call Schedule", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 400 Bad Request @@ -69,6 +69,16 @@ Feature: On-Call When the request is sent Then the response status is 201 Created + @team:ddoghq/on-call + Scenario: Create additive On-Call schedule returns "Created" response + Given new "CreateOnCallSchedule" request + And there is a valid "user" in the system + And there is a valid "dd_team" in the system + And body with value {"data": {"attributes": {"max_responders": 1, "layers": [{"effective_date": "{{ timeISO('now - 10d') }}", "end_date": "{{ timeISO('now + 10d') }}", "interval": {"days": 1}, "members": [{"user": {"id": "{{user.data.id}}"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "{{ timeISO('now - 5d') }}"}], "name": "{{ unique }}", "time_zone": "America/New_York"}, "relationships": {"teams": {"data": [{"id": "{{dd_team.data.id}}", "type": "teams"}]}}, "type": "schedules"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.max_responders" is equal to 1 + @generated @skip @team:ddoghq/on-call Scenario: Create an On-Call notification channel for a user returns "Bad Request" response Given new "CreateUserNotificationChannel" request @@ -572,7 +582,7 @@ Feature: On-Call Scenario: Update On-Call schedule returns "Bad Request" response Given new "UpdateOnCallSchedule" request And request contains "schedule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 3600}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 3600}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "max_responders": 1, "name": "On-Call Schedule Updated", "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 400 Bad Request @@ -580,7 +590,7 @@ Feature: On-Call Scenario: Update On-Call schedule returns "Not Found" response Given new "UpdateOnCallSchedule" request And request contains "schedule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 3600}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "name": "On-Call Schedule Updated", "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} + And body with value {"data": {"attributes": {"layers": [{"effective_date": "2025-02-03T05:00:00Z", "end_date": "2025-12-31T00:00:00Z", "interval": {"seconds": 3600}, "members": [{"user": {"id": "00000000-aba1-0000-0000-000000000000"}}], "name": "Layer 1", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}], "rotation_start": "2025-02-01T00:00:00Z"}], "max_responders": 1, "name": "On-Call Schedule Updated", "time_zone": "America/New_York"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"teams": {"data": [{"id": "00000000-da3a-0000-0000-000000000000", "type": "teams"}]}}, "type": "schedules"}} When the request is sent Then the response status is 404 Not Found