Skip to content

Commit b0d7032

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove steps from certain expected synthetics api response (#3215)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 2061a52 commit b0d7032

9 files changed

Lines changed: 222 additions & 21 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16582,7 +16582,7 @@ components:
1658216582
tests:
1658316583
description: Array of Synthetic tests configuration.
1658416584
items:
16585-
$ref: '#/components/schemas/SyntheticsTestDetails'
16585+
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
1658616586
type: array
1658716587
type: object
1658816588
SyntheticsLocalVariableParsingOptionsType:
@@ -17613,7 +17613,7 @@ components:
1761317613
status:
1761417614
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
1761517615
steps:
17616-
description: For browser test, the steps of the test.
17616+
description: The steps of the test if they exist.
1761717617
items:
1761817618
$ref: '#/components/schemas/SyntheticsStep'
1761917619
type: array
@@ -17665,6 +17665,52 @@ components:
1766517665
- API
1766617666
- BROWSER
1766717667
- MOBILE
17668+
SyntheticsTestDetailsWithoutSteps:
17669+
description: Object containing details about your Synthetic test, without test
17670+
steps.
17671+
properties:
17672+
config:
17673+
$ref: '#/components/schemas/SyntheticsTestConfig'
17674+
creator:
17675+
$ref: '#/components/schemas/Creator'
17676+
locations:
17677+
description: Array of locations used to run the test.
17678+
example:
17679+
- aws:eu-west-3
17680+
items:
17681+
description: A location from which the test was run.
17682+
type: string
17683+
type: array
17684+
message:
17685+
description: Notification message associated with the test.
17686+
type: string
17687+
monitor_id:
17688+
description: The associated monitor ID.
17689+
format: int64
17690+
readOnly: true
17691+
type: integer
17692+
name:
17693+
description: Name of the test.
17694+
type: string
17695+
options:
17696+
$ref: '#/components/schemas/SyntheticsTestOptions'
17697+
public_id:
17698+
description: The test public ID.
17699+
readOnly: true
17700+
type: string
17701+
status:
17702+
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
17703+
subtype:
17704+
$ref: '#/components/schemas/SyntheticsTestDetailsSubType'
17705+
tags:
17706+
description: Array of tags attached to the test.
17707+
items:
17708+
description: A tag attached to the test.
17709+
type: string
17710+
type: array
17711+
type:
17712+
$ref: '#/components/schemas/SyntheticsTestDetailsType'
17713+
type: object
1766817714
SyntheticsTestExecutionRule:
1766917715
description: Execution rule for a Synthetic test.
1767017716
enum:
@@ -35257,7 +35303,7 @@ paths:
3525735303
content:
3525835304
application/json:
3525935305
schema:
35260-
$ref: '#/components/schemas/SyntheticsTestDetails'
35306+
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
3526135307
description: OK
3526235308
'403':
3526335309
content:

examples/v1/synthetics/GetTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const params: v1.SyntheticsApiGetTestRequest = {
1313

1414
apiInstance
1515
.getTest(params)
16-
.then((data: v1.SyntheticsTestDetails) => {
16+
.then((data: v1.SyntheticsTestDetailsWithoutSteps) => {
1717
console.log(
1818
"API called successfully. Returned data: " + JSON.stringify(data)
1919
);

features/support/scenarios_model_mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
21582158
"type": "string",
21592159
"format": "",
21602160
},
2161-
"operationResponseType": "SyntheticsTestDetails",
2161+
"operationResponseType": "SyntheticsTestDetailsWithoutSteps",
21622162
},
21632163
"v1.PatchTest": {
21642164
"publicId": {

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { SyntheticsPatchTestBody } from "../models/SyntheticsPatchTestBody";
3838
import { SyntheticsPrivateLocation } from "../models/SyntheticsPrivateLocation";
3939
import { SyntheticsPrivateLocationCreationResponse } from "../models/SyntheticsPrivateLocationCreationResponse";
4040
import { SyntheticsTestDetails } from "../models/SyntheticsTestDetails";
41+
import { SyntheticsTestDetailsWithoutSteps } from "../models/SyntheticsTestDetailsWithoutSteps";
4142
import { SyntheticsTestUptime } from "../models/SyntheticsTestUptime";
4243
import { SyntheticsTriggerBody } from "../models/SyntheticsTriggerBody";
4344
import { SyntheticsTriggerCITestsResponse } from "../models/SyntheticsTriggerCITestsResponse";
@@ -2774,15 +2775,16 @@ export class SyntheticsApiResponseProcessor {
27742775
*/
27752776
public async getTest(
27762777
response: ResponseContext
2777-
): Promise<SyntheticsTestDetails> {
2778+
): Promise<SyntheticsTestDetailsWithoutSteps> {
27782779
const contentType = ObjectSerializer.normalizeMediaType(
27792780
response.headers["content-type"]
27802781
);
27812782
if (response.httpStatusCode === 200) {
2782-
const body: SyntheticsTestDetails = ObjectSerializer.deserialize(
2783-
ObjectSerializer.parse(await response.body.text(), contentType),
2784-
"SyntheticsTestDetails"
2785-
) as SyntheticsTestDetails;
2783+
const body: SyntheticsTestDetailsWithoutSteps =
2784+
ObjectSerializer.deserialize(
2785+
ObjectSerializer.parse(await response.body.text(), contentType),
2786+
"SyntheticsTestDetailsWithoutSteps"
2787+
) as SyntheticsTestDetailsWithoutSteps;
27862788
return body;
27872789
}
27882790
if (
@@ -2812,11 +2814,12 @@ export class SyntheticsApiResponseProcessor {
28122814

28132815
// Work around for missing responses in specification, e.g. for petstore.yaml
28142816
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2815-
const body: SyntheticsTestDetails = ObjectSerializer.deserialize(
2816-
ObjectSerializer.parse(await response.body.text(), contentType),
2817-
"SyntheticsTestDetails",
2818-
""
2819-
) as SyntheticsTestDetails;
2817+
const body: SyntheticsTestDetailsWithoutSteps =
2818+
ObjectSerializer.deserialize(
2819+
ObjectSerializer.parse(await response.body.text(), contentType),
2820+
"SyntheticsTestDetailsWithoutSteps",
2821+
""
2822+
) as SyntheticsTestDetailsWithoutSteps;
28202823
return body;
28212824
}
28222825

@@ -4401,7 +4404,7 @@ export class SyntheticsApi {
44014404
public getTest(
44024405
param: SyntheticsApiGetTestRequest,
44034406
options?: Configuration
4404-
): Promise<SyntheticsTestDetails> {
4407+
): Promise<SyntheticsTestDetailsWithoutSteps> {
44054408
const requestContextPromise = this.requestFactory.getTest(
44064409
param.publicId,
44074410
options
@@ -4477,7 +4480,7 @@ export class SyntheticsApi {
44774480
public async *listTestsWithPagination(
44784481
param: SyntheticsApiListTestsRequest = {},
44794482
options?: Configuration
4480-
): AsyncGenerator<SyntheticsTestDetails> {
4483+
): AsyncGenerator<SyntheticsTestDetailsWithoutSteps> {
44814484
let pageSize = 100;
44824485
if (param.pageSize !== undefined) {
44834486
pageSize = param.pageSize;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ export { SyntheticsTestConfig } from "./models/SyntheticsTestConfig";
10491049
export { SyntheticsTestDetails } from "./models/SyntheticsTestDetails";
10501050
export { SyntheticsTestDetailsSubType } from "./models/SyntheticsTestDetailsSubType";
10511051
export { SyntheticsTestDetailsType } from "./models/SyntheticsTestDetailsType";
1052+
export { SyntheticsTestDetailsWithoutSteps } from "./models/SyntheticsTestDetailsWithoutSteps";
10521053
export { SyntheticsTestExecutionRule } from "./models/SyntheticsTestExecutionRule";
10531054
export { SyntheticsTestMonitorStatus } from "./models/SyntheticsTestMonitorStatus";
10541055
export { SyntheticsTestOptions } from "./models/SyntheticsTestOptions";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ import { SyntheticsStepDetailWarning } from "./SyntheticsStepDetailWarning";
501501
import { SyntheticsTestCiOptions } from "./SyntheticsTestCiOptions";
502502
import { SyntheticsTestConfig } from "./SyntheticsTestConfig";
503503
import { SyntheticsTestDetails } from "./SyntheticsTestDetails";
504+
import { SyntheticsTestDetailsWithoutSteps } from "./SyntheticsTestDetailsWithoutSteps";
504505
import { SyntheticsTestOptions } from "./SyntheticsTestOptions";
505506
import { SyntheticsTestOptionsMonitorOptions } from "./SyntheticsTestOptionsMonitorOptions";
506507
import { SyntheticsTestOptionsRetry } from "./SyntheticsTestOptionsRetry";
@@ -2281,6 +2282,7 @@ const typeMap: { [index: string]: any } = {
22812282
SyntheticsTestCiOptions: SyntheticsTestCiOptions,
22822283
SyntheticsTestConfig: SyntheticsTestConfig,
22832284
SyntheticsTestDetails: SyntheticsTestDetails,
2285+
SyntheticsTestDetailsWithoutSteps: SyntheticsTestDetailsWithoutSteps,
22842286
SyntheticsTestOptions: SyntheticsTestOptions,
22852287
SyntheticsTestOptionsMonitorOptions: SyntheticsTestOptionsMonitorOptions,
22862288
SyntheticsTestOptionsRetry: SyntheticsTestOptionsRetry,

packages/datadog-api-client-v1/models/SyntheticsListTestsResponse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* This product includes software developed at Datadog (https://www.datadoghq.com/).
44
* Copyright 2020-Present Datadog, Inc.
55
*/
6-
import { SyntheticsTestDetails } from "./SyntheticsTestDetails";
6+
import { SyntheticsTestDetailsWithoutSteps } from "./SyntheticsTestDetailsWithoutSteps";
77

88
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
99

@@ -14,7 +14,7 @@ export class SyntheticsListTestsResponse {
1414
/**
1515
* Array of Synthetic tests configuration.
1616
*/
17-
"tests"?: Array<SyntheticsTestDetails>;
17+
"tests"?: Array<SyntheticsTestDetailsWithoutSteps>;
1818

1919
/**
2020
* A container for additional, undeclared properties.
@@ -34,7 +34,7 @@ export class SyntheticsListTestsResponse {
3434
static readonly attributeTypeMap: AttributeTypeMap = {
3535
tests: {
3636
baseName: "tests",
37-
type: "Array<SyntheticsTestDetails>",
37+
type: "Array<SyntheticsTestDetailsWithoutSteps>",
3838
},
3939
additionalProperties: {
4040
baseName: "additionalProperties",

packages/datadog-api-client-v1/models/SyntheticsTestDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class SyntheticsTestDetails {
5555
*/
5656
"status"?: SyntheticsTestPauseStatus;
5757
/**
58-
* For browser test, the steps of the test.
58+
* The steps of the test if they exist.
5959
*/
6060
"steps"?: Array<SyntheticsStep>;
6161
/**
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
import { Creator } from "./Creator";
7+
import { SyntheticsTestConfig } from "./SyntheticsTestConfig";
8+
import { SyntheticsTestDetailsSubType } from "./SyntheticsTestDetailsSubType";
9+
import { SyntheticsTestDetailsType } from "./SyntheticsTestDetailsType";
10+
import { SyntheticsTestOptions } from "./SyntheticsTestOptions";
11+
import { SyntheticsTestPauseStatus } from "./SyntheticsTestPauseStatus";
12+
13+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
14+
15+
/**
16+
* Object containing details about your Synthetic test, without test steps.
17+
*/
18+
export class SyntheticsTestDetailsWithoutSteps {
19+
/**
20+
* Configuration object for a Synthetic test.
21+
*/
22+
"config"?: SyntheticsTestConfig;
23+
/**
24+
* Object describing the creator of the shared element.
25+
*/
26+
"creator"?: Creator;
27+
/**
28+
* Array of locations used to run the test.
29+
*/
30+
"locations"?: Array<string>;
31+
/**
32+
* Notification message associated with the test.
33+
*/
34+
"message"?: string;
35+
/**
36+
* The associated monitor ID.
37+
*/
38+
"monitorId"?: number;
39+
/**
40+
* Name of the test.
41+
*/
42+
"name"?: string;
43+
/**
44+
* Object describing the extra options for a Synthetic test.
45+
*/
46+
"options"?: SyntheticsTestOptions;
47+
/**
48+
* The test public ID.
49+
*/
50+
"publicId"?: string;
51+
/**
52+
* Define whether you want to start (`live`) or pause (`paused`) a
53+
* Synthetic test.
54+
*/
55+
"status"?: SyntheticsTestPauseStatus;
56+
/**
57+
* The subtype of the Synthetic API test, `http`, `ssl`, `tcp`,
58+
* `dns`, `icmp`, `udp`, `websocket`, `grpc` or `multi`.
59+
*/
60+
"subtype"?: SyntheticsTestDetailsSubType;
61+
/**
62+
* Array of tags attached to the test.
63+
*/
64+
"tags"?: Array<string>;
65+
/**
66+
* Type of the Synthetic test, either `api` or `browser`.
67+
*/
68+
"type"?: SyntheticsTestDetailsType;
69+
70+
/**
71+
* A container for additional, undeclared properties.
72+
* This is a holder for any undeclared properties as specified with
73+
* the 'additionalProperties' keyword in the OAS document.
74+
*/
75+
"additionalProperties"?: { [key: string]: any };
76+
77+
/**
78+
* @ignore
79+
*/
80+
"_unparsed"?: boolean;
81+
82+
/**
83+
* @ignore
84+
*/
85+
static readonly attributeTypeMap: AttributeTypeMap = {
86+
config: {
87+
baseName: "config",
88+
type: "SyntheticsTestConfig",
89+
},
90+
creator: {
91+
baseName: "creator",
92+
type: "Creator",
93+
},
94+
locations: {
95+
baseName: "locations",
96+
type: "Array<string>",
97+
},
98+
message: {
99+
baseName: "message",
100+
type: "string",
101+
},
102+
monitorId: {
103+
baseName: "monitor_id",
104+
type: "number",
105+
format: "int64",
106+
},
107+
name: {
108+
baseName: "name",
109+
type: "string",
110+
},
111+
options: {
112+
baseName: "options",
113+
type: "SyntheticsTestOptions",
114+
},
115+
publicId: {
116+
baseName: "public_id",
117+
type: "string",
118+
},
119+
status: {
120+
baseName: "status",
121+
type: "SyntheticsTestPauseStatus",
122+
},
123+
subtype: {
124+
baseName: "subtype",
125+
type: "SyntheticsTestDetailsSubType",
126+
},
127+
tags: {
128+
baseName: "tags",
129+
type: "Array<string>",
130+
},
131+
type: {
132+
baseName: "type",
133+
type: "SyntheticsTestDetailsType",
134+
},
135+
additionalProperties: {
136+
baseName: "additionalProperties",
137+
type: "{ [key: string]: any; }",
138+
},
139+
};
140+
141+
/**
142+
* @ignore
143+
*/
144+
static getAttributeTypeMap(): AttributeTypeMap {
145+
return SyntheticsTestDetailsWithoutSteps.attributeTypeMap;
146+
}
147+
148+
public constructor() {}
149+
}

0 commit comments

Comments
 (0)