From eb030d278b4dd5b64a0f6323265343036451490d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 12 Nov 2026 10:20:20 +0000 Subject: [PATCH] Regenerate client from commit e06620f of spec repo --- .generator/schemas/v2/openapi.yaml | 116 ++++++++++++++++++ .../v2/on-call/CreateOnCallPageComment.py | 30 +++++ src/datadog_api_client/v2/api/on_call_api.py | 48 ++++++++ .../create_on_call_page_comment_request.py | 42 +++++++ ...on_call_page_comment_request_attributes.py | 51 ++++++++ ...reate_on_call_page_comment_request_data.py | 69 +++++++++++ .../v2/model/on_call_page_comment_type.py | 35 ++++++ src/datadog_api_client/v2/models/__init__.py | 10 ++ .../test-runner-data/manifest.json | 21 ++++ ...-comment-returns-bad-request-response.json | 50 ++++++++ ...e-comment-returns-no-content-response.json | 51 ++++++++ ...ge-comment-returns-not-found-response.json | 50 ++++++++ .../test-server-data/v2/on-call.json | 113 +++++++++++++++++ tests/v2/features/on-call.feature | 24 ++++ tests/v2/features/undo.json | 6 + 15 files changed, 716 insertions(+) create mode 100644 examples/v2/on-call/CreateOnCallPageComment.py create mode 100644 src/datadog_api_client/v2/model/create_on_call_page_comment_request.py create mode 100644 src/datadog_api_client/v2/model/create_on_call_page_comment_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/create_on_call_page_comment_request_data.py create mode 100644 src/datadog_api_client/v2/model/on_call_page_comment_type.py create mode 100644 tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-bad-request-response.json create mode 100644 tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-no-content-response.json create mode 100644 tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-not-found-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c5df769feb..60f554c050 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -32004,6 +32004,53 @@ components: required: - type type: object + CreateOnCallPageCommentRequest: + description: Request to create a comment on an On-Call Page. + properties: + data: + $ref: "#/components/schemas/CreateOnCallPageCommentRequestData" + required: + - data + type: object + CreateOnCallPageCommentRequestAttributes: + description: Attributes for creating a comment on an On-Call Page. + properties: + body: + description: The content of the comment. + example: Investigating the database latency. + maxLength: 20000 + minLength: 1 + type: string + mentioned_user_ids: + description: The IDs of the users mentioned in the comment. + example: + - 00000000-0000-0000-0000-000000000001 + items: + description: The ID of a mentioned user. + format: uuid + type: string + type: array + required: + - body + type: object + CreateOnCallPageCommentRequestData: + description: Data for creating a comment on an On-Call Page. + properties: + attributes: + $ref: "#/components/schemas/CreateOnCallPageCommentRequestAttributes" + id: + description: |- + A client-generated UUID that makes the request idempotent: retrying with the same ID + does not create a duplicate comment. If omitted or not a valid UUID, a random one is generated. + example: 3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b + format: uuid + type: string + type: + $ref: "#/components/schemas/OnCallPageCommentType" + required: + - type + - attributes + type: object CreateOpenAPIResponse: description: Response for `CreateOpenAPI` operation. properties: @@ -100070,6 +100117,15 @@ components: - id - type type: object + OnCallPageCommentType: + default: comments + description: "Indicates that the resource is of type `comments`." + enum: + - comments + example: comments + type: string + x-enum-varnames: + - COMMENTS OnCallPageData: description: An On-Call Page. properties: @@ -221129,6 +221185,66 @@ paths: summary: Acknowledge On-Call Page tags: - On-Call Paging + /api/v2/on-call/pages/{page_id}/comment: + post: + description: Add a comment to the timeline of an On-Call Page. + operationId: CreateOnCallPageComment + parameters: + - description: The ID of the Page, or its key. + in: path + name: page_id + required: true + schema: + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + body: Investigating the database latency. + mentioned_user_ids: + - 00000000-0000-0000-0000-000000000001 + id: 3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b + type: comments + schema: + $ref: "#/components/schemas/CreateOnCallPageCommentRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create On-Call Page Comment + tags: + - On-Call + "x-permission": + operator: AND + permissions: + - on_call_respond /api/v2/on-call/pages/{page_id}/escalate: post: description: |- diff --git a/examples/v2/on-call/CreateOnCallPageComment.py b/examples/v2/on-call/CreateOnCallPageComment.py new file mode 100644 index 0000000000..c88e2ba99c --- /dev/null +++ b/examples/v2/on-call/CreateOnCallPageComment.py @@ -0,0 +1,30 @@ +""" +Create On-Call Page Comment returns "No Content" response +""" + +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.create_on_call_page_comment_request import CreateOnCallPageCommentRequest +from datadog_api_client.v2.model.create_on_call_page_comment_request_attributes import ( + CreateOnCallPageCommentRequestAttributes, +) +from datadog_api_client.v2.model.create_on_call_page_comment_request_data import CreateOnCallPageCommentRequestData +from datadog_api_client.v2.model.on_call_page_comment_type import OnCallPageCommentType +from uuid import UUID + +body = CreateOnCallPageCommentRequest( + data=CreateOnCallPageCommentRequestData( + attributes=CreateOnCallPageCommentRequestAttributes( + body="Comment from the API client integration tests.", + ), + id=UUID("3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b"), + type=OnCallPageCommentType.COMMENTS, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = OnCallApi(api_client) + api_instance.create_on_call_page_comment(page_id="f63eb677-07ce-46ab-b2e0-80ca1ffe91bf", body=body) diff --git a/src/datadog_api_client/v2/api/on_call_api.py b/src/datadog_api_client/v2/api/on_call_api.py index 8fdcf85a1c..8f4595f30d 100644 --- a/src/datadog_api_client/v2/api/on_call_api.py +++ b/src/datadog_api_client/v2/api/on_call_api.py @@ -25,6 +25,7 @@ from datadog_api_client.v2.model.on_call_pages_sort import OnCallPagesSort from datadog_api_client.v2.model.on_call_page_data import OnCallPageData from datadog_api_client.v2.model.on_call_page_response import OnCallPageResponse +from datadog_api_client.v2.model.create_on_call_page_comment_request import CreateOnCallPageCommentRequest from datadog_api_client.v2.model.schedules import Schedules from datadog_api_client.v2.model.schedule_list_item import ScheduleListItem from datadog_api_client.v2.model.schedule import Schedule @@ -84,6 +85,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_on_call_page_comment_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/on-call/pages/{page_id}/comment", + "operation_id": "create_on_call_page_comment", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "page_id": { + "required": True, + "openapi_types": (str,), + "attribute": "page_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CreateOnCallPageCommentRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_on_call_schedule_endpoint = _Endpoint( settings={ "response_type": (Schedule,), @@ -996,6 +1023,27 @@ def create_on_call_escalation_policy( return self._create_on_call_escalation_policy_endpoint.call_with_http_info(**kwargs) + def create_on_call_page_comment( + self, + page_id: str, + body: CreateOnCallPageCommentRequest, + ) -> None: + """Create On-Call Page Comment. + + Add a comment to the timeline of an On-Call Page. + + :param page_id: The ID of the Page, or its key. + :type page_id: str + :type body: CreateOnCallPageCommentRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["page_id"] = page_id + + kwargs["body"] = body + + return self._create_on_call_page_comment_endpoint.call_with_http_info(**kwargs) + def create_on_call_schedule( self, body: ScheduleCreateRequest, diff --git a/src/datadog_api_client/v2/model/create_on_call_page_comment_request.py b/src/datadog_api_client/v2/model/create_on_call_page_comment_request.py new file mode 100644 index 0000000000..72669f67b0 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_on_call_page_comment_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_on_call_page_comment_request_data import CreateOnCallPageCommentRequestData + + +class CreateOnCallPageCommentRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_on_call_page_comment_request_data import ( + CreateOnCallPageCommentRequestData, + ) + + return { + "data": (CreateOnCallPageCommentRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CreateOnCallPageCommentRequestData, **kwargs): + """ + Request to create a comment on an On-Call Page. + + :param data: Data for creating a comment on an On-Call Page. + :type data: CreateOnCallPageCommentRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_on_call_page_comment_request_attributes.py b/src/datadog_api_client/v2/model/create_on_call_page_comment_request_attributes.py new file mode 100644 index 0000000000..d5acd88f9c --- /dev/null +++ b/src/datadog_api_client/v2/model/create_on_call_page_comment_request_attributes.py @@ -0,0 +1,51 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +class CreateOnCallPageCommentRequestAttributes(ModelNormal): + validations = { + "body": { + "max_length": 20000, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "body": (str,), + "mentioned_user_ids": ([UUID],), + } + + attribute_map = { + "body": "body", + "mentioned_user_ids": "mentioned_user_ids", + } + + def __init__(self_, body: str, mentioned_user_ids: Union[List[UUID], UnsetType] = unset, **kwargs): + """ + Attributes for creating a comment on an On-Call Page. + + :param body: The content of the comment. + :type body: str + + :param mentioned_user_ids: The IDs of the users mentioned in the comment. + :type mentioned_user_ids: [UUID], optional + """ + if mentioned_user_ids is not unset: + kwargs["mentioned_user_ids"] = mentioned_user_ids + super().__init__(kwargs) + + self_.body = body diff --git a/src/datadog_api_client/v2/model/create_on_call_page_comment_request_data.py b/src/datadog_api_client/v2/model/create_on_call_page_comment_request_data.py new file mode 100644 index 0000000000..b6333b9d5e --- /dev/null +++ b/src/datadog_api_client/v2/model/create_on_call_page_comment_request_data.py @@ -0,0 +1,69 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_on_call_page_comment_request_attributes import ( + CreateOnCallPageCommentRequestAttributes, + ) + from datadog_api_client.v2.model.on_call_page_comment_type import OnCallPageCommentType + + +class CreateOnCallPageCommentRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_on_call_page_comment_request_attributes import ( + CreateOnCallPageCommentRequestAttributes, + ) + from datadog_api_client.v2.model.on_call_page_comment_type import OnCallPageCommentType + + return { + "attributes": (CreateOnCallPageCommentRequestAttributes,), + "id": (UUID,), + "type": (OnCallPageCommentType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: CreateOnCallPageCommentRequestAttributes, + type: OnCallPageCommentType, + id: Union[UUID, UnsetType] = unset, + **kwargs, + ): + """ + Data for creating a comment on an On-Call Page. + + :param attributes: Attributes for creating a comment on an On-Call Page. + :type attributes: CreateOnCallPageCommentRequestAttributes + + :param id: A client-generated UUID that makes the request idempotent: retrying with the same ID + does not create a duplicate comment. If omitted or not a valid UUID, a random one is generated. + :type id: UUID, optional + + :param type: Indicates that the resource is of type ``comments``. + :type type: OnCallPageCommentType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/on_call_page_comment_type.py b/src/datadog_api_client/v2/model/on_call_page_comment_type.py new file mode 100644 index 0000000000..348cf2c897 --- /dev/null +++ b/src/datadog_api_client/v2/model/on_call_page_comment_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OnCallPageCommentType(ModelSimple): + """ + Indicates that the resource is of type `comments`. + + :param value: If omitted defaults to "comments". Must be one of ["comments"]. + :type value: str + """ + + allowed_values = { + "comments", + } + COMMENTS: ClassVar["OnCallPageCommentType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OnCallPageCommentType.COMMENTS = OnCallPageCommentType("comments") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 5730fdc6bc..5138ab1722 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2293,6 +2293,11 @@ from datadog_api_client.v2.model.create_on_call_notification_rule_request_data import ( CreateOnCallNotificationRuleRequestData, ) +from datadog_api_client.v2.model.create_on_call_page_comment_request import CreateOnCallPageCommentRequest +from datadog_api_client.v2.model.create_on_call_page_comment_request_attributes import ( + CreateOnCallPageCommentRequestAttributes, +) +from datadog_api_client.v2.model.create_on_call_page_comment_request_data import CreateOnCallPageCommentRequestData from datadog_api_client.v2.model.create_open_api_response import CreateOpenAPIResponse from datadog_api_client.v2.model.create_open_api_response_attributes import CreateOpenAPIResponseAttributes from datadog_api_client.v2.model.create_open_api_response_data import CreateOpenAPIResponseData @@ -8596,6 +8601,7 @@ from datadog_api_client.v2.model.on_call_notification_rules_included import OnCallNotificationRulesIncluded from datadog_api_client.v2.model.on_call_page_author_relationship import OnCallPageAuthorRelationship from datadog_api_client.v2.model.on_call_page_author_relationship_data import OnCallPageAuthorRelationshipData +from datadog_api_client.v2.model.on_call_page_comment_type import OnCallPageCommentType from datadog_api_client.v2.model.on_call_page_data import OnCallPageData from datadog_api_client.v2.model.on_call_page_data_attributes import OnCallPageDataAttributes from datadog_api_client.v2.model.on_call_page_data_relationships import OnCallPageDataRelationships @@ -15689,6 +15695,9 @@ "CreateNotificationRuleParametersDataAttributes", "CreateOnCallNotificationRuleRequest", "CreateOnCallNotificationRuleRequestData", + "CreateOnCallPageCommentRequest", + "CreateOnCallPageCommentRequestAttributes", + "CreateOnCallPageCommentRequestData", "CreateOpenAPIResponse", "CreateOpenAPIResponseAttributes", "CreateOpenAPIResponseData", @@ -19652,6 +19661,7 @@ "OnCallNotificationRulesIncluded", "OnCallPageAuthorRelationship", "OnCallPageAuthorRelationshipData", + "OnCallPageCommentType", "OnCallPageData", "OnCallPageDataAttributes", "OnCallPageDataRelationships", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index ec62496d58..8f9ae9ad17 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -9373,6 +9373,27 @@ "scenario": "Update Okta account returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "feature_file": "../../v2/features/on-call.feature", + "file": "v2/on-call/create-on-call-page-comment-returns-bad-request-response.json", + "scenario": "Create On-Call Page Comment returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "On-Call", + "feature_file": "../../v2/features/on-call.feature", + "file": "v2/on-call/create-on-call-page-comment-returns-no-content-response.json", + "scenario": "Create On-Call Page Comment returns \"No Content\" response", + "version": "v2" + }, + { + "feature": "On-Call", + "feature_file": "../../v2/features/on-call.feature", + "file": "v2/on-call/create-on-call-page-comment-returns-not-found-response.json", + "scenario": "Create On-Call Page Comment returns \"Not Found\" 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-on-call-page-comment-returns-bad-request-response.json b/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-bad-request-response.json new file mode 100644 index 0000000000..6acd242f2f --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-bad-request-response.json @@ -0,0 +1,50 @@ +{ + "api": "On-Call", + "expected_status": 400, + "feature": "On-Call", + "id": "v2/On-Call/Create On-Call Page Comment returns \"Bad Request\" response", + "operation_id": "CreateOnCallPageComment", + "request": { + "body": { + "schema": { + "format": null, + "ref": "CreateOnCallPageCommentRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "body": "Comment from the API client integration tests." + }, + "type": "comment" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "page_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "00000000-0000-0000-0000-000000000000" + }, + "style": null + } + ], + "path": "/api/v2/on-call/pages/{page_id}/comment" + }, + "scenario": "Create On-Call Page Comment returns \"Bad Request\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-no-content-response.json b/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-no-content-response.json new file mode 100644 index 0000000000..487a05abfd --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-no-content-response.json @@ -0,0 +1,51 @@ +{ + "api": "On-Call", + "expected_status": 204, + "feature": "On-Call", + "id": "v2/On-Call/Create On-Call Page Comment returns \"No Content\" response", + "operation_id": "CreateOnCallPageComment", + "request": { + "body": { + "schema": { + "format": null, + "ref": "CreateOnCallPageCommentRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "body": "Comment from the API client integration tests." + }, + "id": "3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b", + "type": "comments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "page_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "f63eb677-07ce-46ab-b2e0-80ca1ffe91bf" + }, + "style": null + } + ], + "path": "/api/v2/on-call/pages/{page_id}/comment" + }, + "scenario": "Create On-Call Page Comment returns \"No Content\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-not-found-response.json b/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-not-found-response.json new file mode 100644 index 0000000000..73a9b59264 --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/on-call/create-on-call-page-comment-returns-not-found-response.json @@ -0,0 +1,50 @@ +{ + "api": "On-Call", + "expected_status": 404, + "feature": "On-Call", + "id": "v2/On-Call/Create On-Call Page Comment returns \"Not Found\" response", + "operation_id": "CreateOnCallPageComment", + "request": { + "body": { + "schema": { + "format": null, + "ref": "CreateOnCallPageCommentRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "body": "Comment from the API client integration tests." + }, + "type": "comments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "page_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "00000000-0000-0000-0000-000000000000" + }, + "style": null + } + ], + "path": "/api/v2/on-call/pages/{page_id}/comment" + }, + "scenario": "Create On-Call Page Comment returns \"Not Found\" 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 9325418b61..a826e3ccbb 100644 --- a/tests/generated-test/test-server-data/v2/on-call.json +++ b/tests/generated-test/test-server-data/v2/on-call.json @@ -1,6 +1,119 @@ { "feature": "On-Call", "recordings": [ + { + "feature": "On-Call", + "frozen_at": "2026-11-12T09:46:05.223Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "body": "Comment from the API client integration tests." + }, + "type": "comment" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/on-call/pages/00000000-0000-0000-0000-000000000000/comment", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"comment\\\" expected one of \\\"comments\\\"\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Create On-Call Page Comment returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "On-Call", + "frozen_at": "2026-11-12T09:23:49.315Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "body": "Comment from the API client integration tests." + }, + "id": "3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b", + "type": "comments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/on-call/pages/f63eb677-07ce-46ab-b2e0-80ca1ffe91bf/comment", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Create On-Call Page Comment returns \"No Content\" response", + "version": "v2" + }, + { + "feature": "On-Call", + "frozen_at": "2026-11-12T09:46:05.659Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "body": "Comment from the API client integration tests." + }, + "type": "comments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/on-call/pages/00000000-0000-0000-0000-000000000000/comment", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Create On-Call Page Comment returns \"Not Found\" response", + "version": "v2" + }, { "feature": "On-Call", "frozen_at": "2025-11-28T12:58:56.434Z", diff --git a/tests/v2/features/on-call.feature b/tests/v2/features/on-call.feature index 01cc83122e..747f892ee3 100644 --- a/tests/v2/features/on-call.feature +++ b/tests/v2/features/on-call.feature @@ -9,6 +9,30 @@ Feature: On-Call And a valid "appKeyAuth" key in the system And an instance of "On-Call" API + @team:ddoghq/on-call + Scenario: Create On-Call Page Comment returns "Bad Request" response + Given new "CreateOnCallPageComment" request + And request contains "page_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"body": "Comment from the API client integration tests."}, "type": "comment"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/on-call + Scenario: Create On-Call Page Comment returns "No Content" response + Given new "CreateOnCallPageComment" request + And request contains "page_id" parameter with value "f63eb677-07ce-46ab-b2e0-80ca1ffe91bf" + And body with value {"data": {"attributes": {"body": "Comment from the API client integration tests."}, "id": "3c5f5b5e-3a3e-4f8c-9b1d-2f6a7e8d9c0b", "type": "comments"}} + When the request is sent + Then the response status is 204 No Content + + @team:ddoghq/on-call + Scenario: Create On-Call Page Comment returns "Not Found" response + Given new "CreateOnCallPageComment" request + And request contains "page_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"body": "Comment from the API client integration tests."}, "type": "comments"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/on-call Scenario: Create On-Call escalation policy returns "Bad Request" response Given new "CreateOnCallEscalationPolicy" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 993492a315..e2322f3e34 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6868,6 +6868,12 @@ "type": "unsafe" } }, + "CreateOnCallPageComment": { + "tag": "On-Call", + "undo": { + "type": "idempotent" + } + }, "EscalateOnCallPage": { "tag": "On-Call Paging", "undo": {