From f7607dc89ed0cb2c76dc7c2b28749eeb78a4a302 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 27 Jan 2026 16:47:52 +0000 Subject: [PATCH] Regenerate client from commit d98173c of spec repo --- .generator/schemas/v2/openapi.yaml | 202 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 35 +++ .../v2/case-management/ListCaseWatchers.py | 16 ++ examples/v2/case-management/UnwatchCase.py | 15 ++ examples/v2/case-management/WatchCase.py | 15 ++ src/datadog_api_client/configuration.py | 3 + .../v2/api/case_management_api.py | 143 +++++++++++++ src/datadog_api_client/v2/model/watcher.py | 54 +++++ .../v2/model/watcher_relationships.py | 40 ++++ .../v2/model/watcher_resource_type.py | 35 +++ .../v2/model/watcher_user_relationship.py | 40 ++++ .../v2/model/watchers_response.py | 40 ++++ src/datadog_api_client/v2/models/__init__.py | 10 + tests/v2/features/case_management.feature | 78 +++++++ tests/v2/features/undo.json | 20 ++ 15 files changed, 746 insertions(+) create mode 100644 examples/v2/case-management/ListCaseWatchers.py create mode 100644 examples/v2/case-management/UnwatchCase.py create mode 100644 examples/v2/case-management/WatchCase.py create mode 100644 src/datadog_api_client/v2/model/watcher.py create mode 100644 src/datadog_api_client/v2/model/watcher_relationships.py create mode 100644 src/datadog_api_client/v2/model/watcher_resource_type.py create mode 100644 src/datadog_api_client/v2/model/watcher_user_relationship.py create mode 100644 src/datadog_api_client/v2/model/watchers_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ca425e6bd9..685088a65d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1125,6 +1125,14 @@ components: schema: example: 00000000-0000-9999-0000-000000000000 type: string + UserUUIDPathParameter: + description: User UUID + example: 8146583c-0b5f-11ec-abf8-da7ad0900001 + in: path + name: user_id + required: true + schema: + type: string WorkflowId: description: The ID of the workflow. in: path @@ -64692,6 +64700,57 @@ components: - X_CONTENT_TYPE_HEADER_MISSING - X_PATH_INJECTION - XSS + Watcher: + description: Case watcher + properties: + id: + description: User UUID of the watcher + example: 8146583c-0b5f-11ec-abf8-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/WatcherRelationships' + type: + $ref: '#/components/schemas/WatcherResourceType' + required: + - id + - type + - relationships + type: object + WatcherRelationships: + description: Watcher relationships + properties: + user: + $ref: '#/components/schemas/WatcherUserRelationship' + required: + - user + type: object + WatcherResourceType: + description: Watcher resource type + enum: + - watcher + example: watcher + type: string + x-enum-varnames: + - WATCHER + WatcherUserRelationship: + description: Relationship to user + properties: + data: + $ref: '#/components/schemas/UserRelationshipData' + required: + - data + type: object + WatchersResponse: + description: Response with case watchers + properties: + data: + description: Array of watchers + items: + $ref: '#/components/schemas/Watcher' + type: array + required: + - data + type: object Weekday: description: A day of the week. enum: @@ -70202,6 +70261,149 @@ paths: summary: Unassign case tags: - Case Management + /api/v2/cases/{case_id}/watchers: + get: + description: Get all users watching a case + operationId: ListCaseWatchers + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WatchersResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get case watchers + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cases/{case_id}/watchers/{user_id}: + delete: + description: Remove a user from the watchers list for a case + operationId: UnwatchCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + - $ref: '#/components/parameters/UserUUIDPathParameter' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Remove user as watcher + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Add a user as a watcher for a case + operationId: WatchCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + - $ref: '#/components/parameters/UserUUIDPathParameter' + responses: + '201': + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Add user as watcher + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/catalog/entity: get: description: Get a list of entities from Software Catalog. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 41d22bb2b4..8c845e2010 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -28536,6 +28536,41 @@ datadog\_api\_client.v2.model.vulnerability\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.watcher module +-------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.watcher + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.watcher\_relationships module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.watcher_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.watcher\_resource\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.watcher_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.watcher\_user\_relationship module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.watcher_user_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.watchers\_response module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.watchers_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.weekday module -------------------------------------------- diff --git a/examples/v2/case-management/ListCaseWatchers.py b/examples/v2/case-management/ListCaseWatchers.py new file mode 100644 index 0000000000..c55df9e86f --- /dev/null +++ b/examples/v2/case-management/ListCaseWatchers.py @@ -0,0 +1,16 @@ +""" +Get case watchers returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi + +configuration = Configuration() +configuration.unstable_operations["list_case_watchers"] = True +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + response = api_instance.list_case_watchers( + case_id="case_id", + ) + + print(response) diff --git a/examples/v2/case-management/UnwatchCase.py b/examples/v2/case-management/UnwatchCase.py new file mode 100644 index 0000000000..062623648e --- /dev/null +++ b/examples/v2/case-management/UnwatchCase.py @@ -0,0 +1,15 @@ +""" +Remove user as watcher returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi + +configuration = Configuration() +configuration.unstable_operations["unwatch_case"] = True +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + api_instance.unwatch_case( + case_id="case_id", + user_id="user_id", + ) diff --git a/examples/v2/case-management/WatchCase.py b/examples/v2/case-management/WatchCase.py new file mode 100644 index 0000000000..86408694ec --- /dev/null +++ b/examples/v2/case-management/WatchCase.py @@ -0,0 +1,15 @@ +""" +Add user as watcher returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi + +configuration = Configuration() +configuration.unstable_operations["watch_case"] = True +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + api_instance.watch_case( + case_id="case_id", + user_id="user_id", + ) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index cf63f54a1c..e2f7105ae2 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -266,6 +266,9 @@ def __init__( "v2.get_open_api": False, "v2.list_apis": False, "v2.update_open_api": False, + "v2.list_case_watchers": False, + "v2.unwatch_case": False, + "v2.watch_case": False, "v2.cancel_threat_hunting_job": False, "v2.convert_job_result_to_signal": False, "v2.delete_threat_hunting_job": False, diff --git a/src/datadog_api_client/v2/api/case_management_api.py b/src/datadog_api_client/v2/api/case_management_api.py index bb4974cfe6..4eea5bc532 100644 --- a/src/datadog_api_client/v2/api/case_management_api.py +++ b/src/datadog_api_client/v2/api/case_management_api.py @@ -32,6 +32,7 @@ from datadog_api_client.v2.model.case_update_priority_request import CaseUpdatePriorityRequest from datadog_api_client.v2.model.case_update_status_request import CaseUpdateStatusRequest from datadog_api_client.v2.model.case_update_title_request import CaseUpdateTitleRequest +from datadog_api_client.v2.model.watchers_response import WatchersResponse class CaseManagementApi: @@ -305,6 +306,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_case_watchers_endpoint = _Endpoint( + settings={ + "response_type": (WatchersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/watchers", + "operation_id": "list_case_watchers", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._search_cases_endpoint = _Endpoint( settings={ "response_type": (CasesResponse,), @@ -399,6 +423,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._unwatch_case_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/watchers/{user_id}", + "operation_id": "unwatch_case", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._update_attributes_endpoint = _Endpoint( settings={ "response_type": (CaseResponse,), @@ -561,6 +614,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._watch_case_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/watchers/{user_id}", + "operation_id": "watch_case", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + def archive_case( self, case_id: str, @@ -768,6 +850,23 @@ def get_projects( kwargs: Dict[str, Any] = {} return self._get_projects_endpoint.call_with_http_info(**kwargs) + def list_case_watchers( + self, + case_id: str, + ) -> WatchersResponse: + """Get case watchers. + + Get all users watching a case + + :param case_id: Case's UUID or key + :type case_id: str + :rtype: WatchersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + return self._list_case_watchers_endpoint.call_with_http_info(**kwargs) + def search_cases( self, *, @@ -910,6 +1009,28 @@ def unassign_case( return self._unassign_case_endpoint.call_with_http_info(**kwargs) + def unwatch_case( + self, + case_id: str, + user_id: str, + ) -> None: + """Remove user as watcher. + + Remove a user from the watchers list for a case + + :param case_id: Case's UUID or key + :type case_id: str + :param user_id: User UUID + :type user_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["user_id"] = user_id + + return self._unwatch_case_endpoint.call_with_http_info(**kwargs) + def update_attributes( self, case_id: str, @@ -1046,3 +1167,25 @@ def update_status( kwargs["body"] = body return self._update_status_endpoint.call_with_http_info(**kwargs) + + def watch_case( + self, + case_id: str, + user_id: str, + ) -> None: + """Add user as watcher. + + Add a user as a watcher for a case + + :param case_id: Case's UUID or key + :type case_id: str + :param user_id: User UUID + :type user_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["user_id"] = user_id + + return self._watch_case_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/watcher.py b/src/datadog_api_client/v2/model/watcher.py new file mode 100644 index 0000000000..3a8a5bcadd --- /dev/null +++ b/src/datadog_api_client/v2/model/watcher.py @@ -0,0 +1,54 @@ +# 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.watcher_relationships import WatcherRelationships + from datadog_api_client.v2.model.watcher_resource_type import WatcherResourceType + + +class Watcher(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.watcher_relationships import WatcherRelationships + from datadog_api_client.v2.model.watcher_resource_type import WatcherResourceType + + return { + "id": (str,), + "relationships": (WatcherRelationships,), + "type": (WatcherResourceType,), + } + + attribute_map = { + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__(self_, id: str, relationships: WatcherRelationships, type: WatcherResourceType, **kwargs): + """ + Case watcher + + :param id: User UUID of the watcher + :type id: str + + :param relationships: Watcher relationships + :type relationships: WatcherRelationships + + :param type: Watcher resource type + :type type: WatcherResourceType + """ + super().__init__(kwargs) + + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/watcher_relationships.py b/src/datadog_api_client/v2/model/watcher_relationships.py new file mode 100644 index 0000000000..02ba2a7c35 --- /dev/null +++ b/src/datadog_api_client/v2/model/watcher_relationships.py @@ -0,0 +1,40 @@ +# 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.watcher_user_relationship import WatcherUserRelationship + + +class WatcherRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.watcher_user_relationship import WatcherUserRelationship + + return { + "user": (WatcherUserRelationship,), + } + + attribute_map = { + "user": "user", + } + + def __init__(self_, user: WatcherUserRelationship, **kwargs): + """ + Watcher relationships + + :param user: Relationship to user + :type user: WatcherUserRelationship + """ + super().__init__(kwargs) + + self_.user = user diff --git a/src/datadog_api_client/v2/model/watcher_resource_type.py b/src/datadog_api_client/v2/model/watcher_resource_type.py new file mode 100644 index 0000000000..f6d2cb3a7b --- /dev/null +++ b/src/datadog_api_client/v2/model/watcher_resource_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 WatcherResourceType(ModelSimple): + """ + Watcher resource type + + :param value: If omitted defaults to "watcher". Must be one of ["watcher"]. + :type value: str + """ + + allowed_values = { + "watcher", + } + WATCHER: ClassVar["WatcherResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WatcherResourceType.WATCHER = WatcherResourceType("watcher") diff --git a/src/datadog_api_client/v2/model/watcher_user_relationship.py b/src/datadog_api_client/v2/model/watcher_user_relationship.py new file mode 100644 index 0000000000..d9aa772d91 --- /dev/null +++ b/src/datadog_api_client/v2/model/watcher_user_relationship.py @@ -0,0 +1,40 @@ +# 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.user_relationship_data import UserRelationshipData + + +class WatcherUserRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData + + return { + "data": (UserRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UserRelationshipData, **kwargs): + """ + Relationship to user + + :param data: Relationship to user object. + :type data: UserRelationshipData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/watchers_response.py b/src/datadog_api_client/v2/model/watchers_response.py new file mode 100644 index 0000000000..9fadea479b --- /dev/null +++ b/src/datadog_api_client/v2/model/watchers_response.py @@ -0,0 +1,40 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.watcher import Watcher + + +class WatchersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.watcher import Watcher + + return { + "data": ([Watcher],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[Watcher], **kwargs): + """ + Response with case watchers + + :param data: Array of watchers + :type data: [Watcher] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 010c5fb61c..fbd2e91395 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -5749,6 +5749,11 @@ from datadog_api_client.v2.model.vulnerability_status import VulnerabilityStatus from datadog_api_client.v2.model.vulnerability_tool import VulnerabilityTool from datadog_api_client.v2.model.vulnerability_type import VulnerabilityType +from datadog_api_client.v2.model.watcher import Watcher +from datadog_api_client.v2.model.watcher_relationships import WatcherRelationships +from datadog_api_client.v2.model.watcher_resource_type import WatcherResourceType +from datadog_api_client.v2.model.watcher_user_relationship import WatcherUserRelationship +from datadog_api_client.v2.model.watchers_response import WatchersResponse from datadog_api_client.v2.model.weekday import Weekday from datadog_api_client.v2.model.widget_live_span import WidgetLiveSpan from datadog_api_client.v2.model.workflow_data import WorkflowData @@ -9870,6 +9875,11 @@ "VulnerabilityStatus", "VulnerabilityTool", "VulnerabilityType", + "Watcher", + "WatcherRelationships", + "WatcherResourceType", + "WatcherUserRelationship", + "WatchersResponse", "Weekday", "WidgetLiveSpan", "WorkflowData", diff --git a/tests/v2/features/case_management.feature b/tests/v2/features/case_management.feature index 2f23915567..4f3de0519b 100644 --- a/tests/v2/features/case_management.feature +++ b/tests/v2/features/case_management.feature @@ -10,6 +10,33 @@ Feature: Case Management And a valid "appKeyAuth" key in the system And an instance of "CaseManagement" API + @generated @skip @team:DataDog/case-management + Scenario: Add user as watcher returns "Bad Request" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Add user as watcher returns "Created" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Add user as watcher returns "Not Found" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/case-management Scenario: Archive case returns "Bad Request" response Given new "ArchiveCase" request @@ -203,6 +230,30 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Get case watchers returns "Bad Request" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get case watchers returns "Not Found" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get case watchers returns "OK" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Get the details of a case returns "Bad Request" response Given new "GetCase" request @@ -261,6 +312,33 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Remove user as watcher returns "Bad Request" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Remove user as watcher returns "No Content" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Remove user as watcher returns "Not Found" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Search cases returns "Bad Request" response Given new "SearchCases" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 5a347bddf1..6e3e67d08e 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -819,6 +819,26 @@ "type": "idempotent" } }, + "ListCaseWatchers": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UnwatchCase": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "WatchCase": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "ListCatalogEntity": { "tag": "Software Catalog", "undo": {