Skip to content

Commit ce7f0c7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
fix case search documentation (#1598)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 3eed2ea commit ce7f0c7

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-04-11 15:35:24.319441",
8-
"spec_repo_commit": "8ffb168c"
7+
"regenerated": "2024-04-15 13:33:00.832246",
8+
"spec_repo_commit": "5c7e123b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-11 15:35:24.337042",
13-
"spec_repo_commit": "8ffb168c"
12+
"regenerated": "2024-04-15 13:33:00.850485",
13+
"spec_repo_commit": "5c7e123b"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23926,7 +23926,7 @@ paths:
2392623926
operationId: SearchCases
2392723927
parameters:
2392823928
- $ref: '#/components/parameters/PageSize'
23929-
- $ref: '#/components/parameters/PageOffset'
23929+
- $ref: '#/components/parameters/PageNumber'
2393023930
- $ref: '#/components/parameters/CaseSortableFieldParameter'
2393123931
- description: Search query
2393223932
in: query
@@ -23969,7 +23969,7 @@ paths:
2396923969
- Case Management
2397023970
x-pagination:
2397123971
limitParam: page[size]
23972-
pageOffsetParam: page[offset]
23972+
pageParam: page[number]
2397323973
resultsPath: data
2397423974
post:
2397523975
description: Create a Case

features/support/scenarios_model_mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,7 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
26712671
"type": "number",
26722672
"format": "int64",
26732673
},
2674-
"pageOffset": {
2674+
"pageNumber": {
26752675
"type": "number",
26762676
"format": "int64",
26772677
},

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export class CaseManagementApiRequestFactory extends BaseAPIRequestFactory {
344344

345345
public async searchCases(
346346
pageSize?: number,
347-
pageOffset?: number,
347+
pageNumber?: number,
348348
sortField?: CaseSortableField,
349349
filter?: string,
350350
sortAsc?: boolean,
@@ -369,10 +369,10 @@ export class CaseManagementApiRequestFactory extends BaseAPIRequestFactory {
369369
ObjectSerializer.serialize(pageSize, "number", "int64")
370370
);
371371
}
372-
if (pageOffset !== undefined) {
372+
if (pageNumber !== undefined) {
373373
requestContext.setQueryParam(
374-
"page[offset]",
375-
ObjectSerializer.serialize(pageOffset, "number", "int64")
374+
"page[number]",
375+
ObjectSerializer.serialize(pageNumber, "number", "int64")
376376
);
377377
}
378378
if (sortField !== undefined) {
@@ -1490,10 +1490,10 @@ export interface CaseManagementApiSearchCasesRequest {
14901490
*/
14911491
pageSize?: number;
14921492
/**
1493-
* Specific offset to use as the beginning of the returned page.
1493+
* Specific page number to return.
14941494
* @type number
14951495
*/
1496-
pageOffset?: number;
1496+
pageNumber?: number;
14971497
/**
14981498
* Specify which field to sort
14991499
* @type CaseSortableField
@@ -1754,7 +1754,7 @@ export class CaseManagementApi {
17541754
): Promise<CasesResponse> {
17551755
const requestContextPromise = this.requestFactory.searchCases(
17561756
param.pageSize,
1757-
param.pageOffset,
1757+
param.pageNumber,
17581758
param.sortField,
17591759
param.filter,
17601760
param.sortAsc,
@@ -1781,10 +1781,11 @@ export class CaseManagementApi {
17811781
pageSize = param.pageSize;
17821782
}
17831783
param.pageSize = pageSize;
1784+
param.pageNumber = 0;
17841785
while (true) {
17851786
const requestContext = await this.requestFactory.searchCases(
17861787
param.pageSize,
1787-
param.pageOffset,
1788+
param.pageNumber,
17881789
param.sortField,
17891790
param.filter,
17901791
param.sortAsc,
@@ -1808,11 +1809,7 @@ export class CaseManagementApi {
18081809
if (results.length < pageSize) {
18091810
break;
18101811
}
1811-
if (param.pageOffset === undefined) {
1812-
param.pageOffset = pageSize;
1813-
} else {
1814-
param.pageOffset = param.pageOffset + pageSize;
1815-
}
1812+
param.pageNumber = param.pageNumber + 1;
18161813
}
18171814
}
18181815

0 commit comments

Comments
 (0)