Skip to content

Commit 0ce0d8c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add pageStart extension to case management pagination (#3786)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 93a3ce5 commit 0ce0d8c

File tree

6 files changed

+137
-3
lines changed

6 files changed

+137
-3
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75976,6 +75976,7 @@ paths:
7597675976
x-pagination:
7597775977
limitParam: page[size]
7597875978
pageParam: page[number]
75979+
pageStart: 1
7597975980
resultsPath: data
7598075981
post:
7598175982
description: Create a Case
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2026-03-25T10:29:24.893Z"
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"log": {
3+
"_recordingName": "Case Management/Search cases returns \"OK\" response with pagination",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "a97b8b378352cdc6fbd499ef00afc3f6",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 556,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [
28+
{
29+
"name": "page",
30+
"value": {
31+
"number": "1",
32+
"size": "2"
33+
}
34+
},
35+
{
36+
"name": "filter",
37+
"value": "status:closed"
38+
}
39+
],
40+
"url": "https://api.datadoghq.com/api/v2/cases?page%5Bsize%5D=2&page%5Bnumber%5D=1&filter=status%3Aclosed"
41+
},
42+
"response": {
43+
"bodySize": 3222,
44+
"content": {
45+
"mimeType": "application/vnd.api+json",
46+
"size": 3222,
47+
"text": "{\"data\":[{\"id\":\"cd4abeaa-0a5b-4b83-b99c-5b6d1f912938\",\"type\":\"case\",\"attributes\":{\"attributes\":{\"service\":[\"synthetics-browser\"]},\"closed_at\":\"2026-01-24T00:47:45.477244496Z\",\"comment_count\":0,\"created_at\":\"2025-11-12T00:42:59.178125Z\",\"created_by_author\":{\"type\":\"USER\",\"content\":{\"ID\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"active\":true}},\"creation_source\":\"ERROR_TRACKING\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[{\"type\":\"ERROR_TRACKING\",\"ref\":\"/error-tracking?issueId=a5bb2896-a4d0-11f0-bd76-da7ad0900002\",\"resource_id\":\"a5bb2896-a4d0-11f0-bd76-da7ad0900002\"}],\"internal_id\":\"cd4abeaa-0a5b-4b83-b99c-5b6d1f912938\",\"key\":\"ET-3\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2026-02-05T03:58:14.876711989Z\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"89979\",\"status\":\"CLOSED\",\"status_group\":\"SG_CLOSED\",\"status_name\":\"Closed\",\"title\":\"require-trusted-types-for: csp_violation: 'trusted-types-sink' blocked by 'require-trusted-types-for' directive\",\"type\":\"ERROR_TRACKING_ISSUE\",\"type_id\":\"00000000-0000-0000-0000-000000000005\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"384521ba-dc5f-481f-942d-15bd48428029\",\"type\":\"project\"}}}},{\"id\":\"7afc10c8-4096-4af1-9ccf-ec0df3a2f63b\",\"type\":\"case\",\"attributes\":{\"attributes\":{\"service\":[\"synthetics-browser\"]},\"comment_count\":0,\"created_at\":\"2025-09-02T13:56:48.031226Z\",\"created_by_author\":{\"type\":\"USER\",\"content\":{\"ID\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"frog\",\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"active\":true}},\"creation_source\":\"ERROR_TRACKING\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[{\"type\":\"ERROR_TRACKING\",\"ref\":\"/error-tracking?issueId=d3ab59c6-84ee-11f0-87bb-da7ad0900002\",\"resource_id\":\"d3ab59c6-84ee-11f0-87bb-da7ad0900002\"}],\"internal_id\":\"7afc10c8-4096-4af1-9ccf-ec0df3a2f63b\",\"key\":\"ET-2\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2026-03-25T09:56:47.052997427Z\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"79361\",\"status\":\"CLOSED\",\"status_group\":\"SG_CLOSED\",\"status_name\":\"Closed\",\"title\":\"Error: Expected unhandled error\",\"type\":\"ERROR_TRACKING_ISSUE\",\"type_id\":\"00000000-0000-0000-0000-000000000005\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"384521ba-dc5f-481f-942d-15bd48428029\",\"type\":\"project\"}}}}],\"meta\":{\"total_cases\":3,\"page\":{\"current\":1,\"size\":2,\"total\":2}},\"included\":[{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\",\"attributes\":{\"active\":false,\"email\":\"\",\"handle\":\"\",\"name\":\"\"}},{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}},{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"}}]}"
48+
},
49+
"cookies": [],
50+
"headers": [
51+
{
52+
"name": "content-type",
53+
"value": "application/vnd.api+json"
54+
}
55+
],
56+
"headersSize": 665,
57+
"httpVersion": "HTTP/1.1",
58+
"redirectURL": "",
59+
"status": 200,
60+
"statusText": "OK"
61+
},
62+
"startedDateTime": "2026-03-25T10:29:24.899Z",
63+
"time": 150
64+
},
65+
{
66+
"_id": "e440eea8a78521a716743ebcab9e6db0",
67+
"_order": 0,
68+
"cache": {},
69+
"request": {
70+
"bodySize": 0,
71+
"cookies": [],
72+
"headers": [
73+
{
74+
"_fromType": "array",
75+
"name": "accept",
76+
"value": "application/json"
77+
}
78+
],
79+
"headersSize": 556,
80+
"httpVersion": "HTTP/1.1",
81+
"method": "GET",
82+
"queryString": [
83+
{
84+
"name": "page",
85+
"value": {
86+
"number": "2",
87+
"size": "2"
88+
}
89+
},
90+
{
91+
"name": "filter",
92+
"value": "status:closed"
93+
}
94+
],
95+
"url": "https://api.datadoghq.com/api/v2/cases?page%5Bsize%5D=2&page%5Bnumber%5D=2&filter=status%3Aclosed"
96+
},
97+
"response": {
98+
"bodySize": 1640,
99+
"content": {
100+
"mimeType": "application/vnd.api+json",
101+
"size": 1640,
102+
"text": "{\"data\":[{\"id\":\"f1b32a47-621d-4c57-9642-045aeb83891e\",\"type\":\"case\",\"attributes\":{\"attributes\":{\"service\":[\"synthetics-browser\"]},\"closed_at\":\"2025-08-21T17:21:13.882830862Z\",\"comment_count\":0,\"created_at\":\"2025-08-21T17:20:22.807979Z\",\"created_by_author\":{\"type\":\"USER\",\"content\":{\"ID\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"frog\",\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"active\":true}},\"creation_source\":\"ERROR_TRACKING\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[{\"type\":\"ERROR_TRACKING\",\"ref\":\"/error-tracking?issueId=5f8ebd5c-6dd9-11f0-8a28-da7ad0900002\",\"resource_id\":\"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002\"}],\"internal_id\":\"f1b32a47-621d-4c57-9642-045aeb83891e\",\"key\":\"ET-1\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2025-08-21T17:21:13.882830862Z\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"77795\",\"status\":\"CLOSED\",\"status_group\":\"SG_CLOSED\",\"status_name\":\"Closed\",\"title\":\"Error: HTTP error\",\"type\":\"ERROR_TRACKING_ISSUE\",\"type_id\":\"00000000-0000-0000-0000-000000000005\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"384521ba-dc5f-481f-942d-15bd48428029\",\"type\":\"project\"}}}}],\"meta\":{\"total_cases\":3,\"page\":{\"current\":2,\"size\":1,\"total\":2}},\"included\":[{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"}},{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"user\",\"attributes\":{\"active\":false,\"email\":\"\",\"handle\":\"\",\"name\":\"\"}}]}"
103+
},
104+
"cookies": [],
105+
"headers": [
106+
{
107+
"name": "content-type",
108+
"value": "application/vnd.api+json"
109+
}
110+
],
111+
"headersSize": 665,
112+
"httpVersion": "HTTP/1.1",
113+
"redirectURL": "",
114+
"status": 200,
115+
"statusText": "OK"
116+
},
117+
"startedDateTime": "2026-03-25T10:29:25.055Z",
118+
"time": 131
119+
}
120+
],
121+
"pages": [],
122+
"version": "1.2"
123+
}
124+
}

examples/v2/case-management/SearchCases_3433960044.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ import { client, v2 } from "@datadog/datadog-api-client";
77
const configuration = client.createConfiguration();
88
const apiInstance = new v2.CaseManagementApi(configuration);
99

10+
const params: v2.CaseManagementApiSearchCasesRequest = {
11+
pageSize: 2,
12+
filter: "status:closed",
13+
};
14+
1015
(async () => {
1116
try {
12-
for await (const item of apiInstance.searchCasesWithPagination()) {
17+
for await (const item of apiInstance.searchCasesWithPagination(params)) {
1318
console.log(item);
1419
}
1520
} catch (error) {

features/v2/case_management.feature

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,14 @@ Feature: Case Management
508508
When the request is sent
509509
Then the response status is 200 OK
510510

511-
@generated @skip @team:DataDog/case-management @with-pagination
511+
@replay-only @skip-validation @team:DataDog/case-management @with-pagination
512512
Scenario: Search cases returns "OK" response with pagination
513513
Given new "SearchCases" request
514+
And request contains "page[size]" parameter with value 2
515+
And request contains "filter" parameter with value "status:closed"
514516
When the request with pagination is sent
515517
Then the response status is 200 OK
518+
And the response has 3 items
516519

517520
@team:DataDog/case-management
518521
Scenario: Unarchive case returns "Bad Request" response

packages/datadog-api-client-v2/apis/CaseManagementApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4585,7 +4585,7 @@ export class CaseManagementApi {
45854585
pageSize = param.pageSize;
45864586
}
45874587
param.pageSize = pageSize;
4588-
param.pageNumber = 0;
4588+
param.pageNumber = 1;
45894589
while (true) {
45904590
const requestContext = await this.requestFactory.searchCases(
45914591
param.pageSize,

0 commit comments

Comments
 (0)