Skip to content

Commit 25c8794

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Synthetics add pagination params to get all tests endpoint (#952)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 74b6fac commit 25c8794

File tree

6 files changed

+59
-10
lines changed

6 files changed

+59
-10
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.4",
7-
"regenerated": "2022-12-16 13:14:59.785376",
8-
"spec_repo_commit": "ea9a41e2"
7+
"regenerated": "2022-12-19 08:43:38.464773",
8+
"spec_repo_commit": "69a446d0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-12-16 13:14:59.798656",
13-
"spec_repo_commit": "ea9a41e2"
12+
"regenerated": "2022-12-19 08:43:38.476455",
13+
"spec_repo_commit": "69a446d0"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25965,6 +25965,18 @@ paths:
2596525965
get:
2596625966
description: Get the list of all Synthetic tests.
2596725967
operationId: ListTests
25968+
parameters:
25969+
- description: Used for pagination. The number of tests returned in the page.
25970+
in: query
25971+
name: page_size
25972+
schema:
25973+
type: string
25974+
- description: Used for pagination. Which page you want to retrieve. Starts
25975+
at zero.
25976+
in: query
25977+
name: page_number
25978+
schema:
25979+
type: string
2596825980
responses:
2596925981
'200':
2597025982
content:
@@ -25991,7 +26003,7 @@ paths:
2599126003
appKeyAuth: []
2599226004
- AuthZ:
2599326005
- synthetics_read
25994-
summary: Get the list of all tests
26006+
summary: Get the list of all Synthetic tests
2599526007
tags:
2599626008
- Synthetics
2599726009
/api/v1/synthetics/tests/api:

examples/v1/synthetics/ListTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Get the list of all tests returns "OK - Returns the list of all Synthetic tests." response
2+
* Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
33
*/
44

55
import { client, v1 } from "@datadog/datadog-api-client";

features/v1/synthetics.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,13 @@ Feature: Synthetics
506506
Then the response status is 200 OK
507507

508508
@generated @skip @team:DataDog/synthetics-app
509-
Scenario: Get the list of all tests returns "OK - Returns the list of all Synthetic tests." response
509+
Scenario: Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
510510
Given new "ListTests" request
511511
When the request is sent
512512
Then the response status is 200 OK - Returns the list of all Synthetic tests.
513513

514514
@generated @skip @team:DataDog/synthetics-app
515-
Scenario: Get the list of all tests returns "Synthetics is not activated for the user." response
515+
Scenario: Get the list of all Synthetic tests returns "Synthetics is not activated for the user." response
516516
Given new "ListTests" request
517517
When the request is sent
518518
Then the response status is 404 Synthetics is not activated for the user.

packages/datadog-api-client-v1/apis/SyntheticsApi.ts

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,11 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory {
840840
return requestContext;
841841
}
842842

843-
public async listTests(_options?: Configuration): Promise<RequestContext> {
843+
public async listTests(
844+
pageSize?: string,
845+
pageNumber?: string,
846+
_options?: Configuration
847+
): Promise<RequestContext> {
844848
const _config = _options || this.configuration;
845849

846850
// Path Params
@@ -854,6 +858,20 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory {
854858
requestContext.setHeaderParam("Accept", "application/json");
855859
requestContext.setHttpConfig(_config.httpConfig);
856860

861+
// Query Params
862+
if (pageSize !== undefined) {
863+
requestContext.setQueryParam(
864+
"page_size",
865+
ObjectSerializer.serialize(pageSize, "string", "")
866+
);
867+
}
868+
if (pageNumber !== undefined) {
869+
requestContext.setQueryParam(
870+
"page_number",
871+
ObjectSerializer.serialize(pageNumber, "string", "")
872+
);
873+
}
874+
857875
// Apply auth methods
858876
applySecurityAuthentication(_config, requestContext, [
859877
"AuthZ",
@@ -3008,6 +3026,19 @@ export interface SyntheticsApiGetTestRequest {
30083026
publicId: string;
30093027
}
30103028

3029+
export interface SyntheticsApiListTestsRequest {
3030+
/**
3031+
* Used for pagination. The number of tests returned in the page.
3032+
* @type string
3033+
*/
3034+
pageSize?: string;
3035+
/**
3036+
* Used for pagination. Which page you want to retrieve. Starts at zero.
3037+
* @type string
3038+
*/
3039+
pageNumber?: string;
3040+
}
3041+
30113042
export interface SyntheticsApiTriggerCITestsRequest {
30123043
/**
30133044
* Details of the test to trigger.
@@ -3528,9 +3559,14 @@ export class SyntheticsApi {
35283559
* @param param The request object
35293560
*/
35303561
public listTests(
3562+
param: SyntheticsApiListTestsRequest = {},
35313563
options?: Configuration
35323564
): Promise<SyntheticsListTestsResponse> {
3533-
const requestContextPromise = this.requestFactory.listTests(options);
3565+
const requestContextPromise = this.requestFactory.listTests(
3566+
param.pageSize,
3567+
param.pageNumber,
3568+
options
3569+
);
35343570
return requestContextPromise.then((requestContext) => {
35353571
return this.configuration.httpApi
35363572
.send(requestContext)

packages/datadog-api-client-v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export {
237237
SyntheticsApiGetPrivateLocationRequest,
238238
SyntheticsApiGetSyntheticsCIBatchRequest,
239239
SyntheticsApiGetTestRequest,
240+
SyntheticsApiListTestsRequest,
240241
SyntheticsApiTriggerCITestsRequest,
241242
SyntheticsApiTriggerTestsRequest,
242243
SyntheticsApiUpdateAPITestRequest,

0 commit comments

Comments
 (0)