Skip to content

Commit 7cd853b

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

8 files changed

Lines changed: 209 additions & 17 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:

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
21682168
type: "string",
21692169
format: "",
21702170
},
2171-
operationResponseType: "SyntheticsTestDetails",
2171+
operationResponseType: "SyntheticsTestDetailsWithoutSteps",
21722172
},
21732173
"SyntheticsApi.V1.PatchTest": {
21742174
publicId: {

services/synthetics/src/v1/SyntheticsApi.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { SyntheticsPatchTestBody } from "./models/SyntheticsPatchTestBody";
4444
import { SyntheticsPrivateLocation } from "./models/SyntheticsPrivateLocation";
4545
import { SyntheticsPrivateLocationCreationResponse } from "./models/SyntheticsPrivateLocationCreationResponse";
4646
import { SyntheticsTestDetails } from "./models/SyntheticsTestDetails";
47+
import { SyntheticsTestDetailsWithoutSteps } from "./models/SyntheticsTestDetailsWithoutSteps";
4748
import { SyntheticsTestUptime } from "./models/SyntheticsTestUptime";
4849
import { SyntheticsTriggerBody } from "./models/SyntheticsTriggerBody";
4950
import { SyntheticsTriggerCITestsResponse } from "./models/SyntheticsTriggerCITestsResponse";
@@ -3073,14 +3074,14 @@ export class SyntheticsApiResponseProcessor {
30733074
*/
30743075
public async getTest(
30753076
response: ResponseContext,
3076-
): Promise<SyntheticsTestDetails> {
3077+
): Promise<SyntheticsTestDetailsWithoutSteps> {
30773078
const contentType = normalizeMediaType(response.headers["content-type"]);
30783079
if (response.httpStatusCode === 200) {
3079-
const body: SyntheticsTestDetails = deserialize(
3080+
const body: SyntheticsTestDetailsWithoutSteps = deserialize(
30803081
parse(await response.body.text(), contentType),
30813082
TypingInfo,
3082-
"SyntheticsTestDetails",
3083-
) as SyntheticsTestDetails;
3083+
"SyntheticsTestDetailsWithoutSteps",
3084+
) as SyntheticsTestDetailsWithoutSteps;
30843085
return body;
30853086
}
30863087
if (
@@ -3108,12 +3109,12 @@ export class SyntheticsApiResponseProcessor {
31083109

31093110
// Work around for missing responses in specification, e.g. for petstore.yaml
31103111
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3111-
const body: SyntheticsTestDetails = deserialize(
3112+
const body: SyntheticsTestDetailsWithoutSteps = deserialize(
31123113
parse(await response.body.text(), contentType),
31133114
TypingInfo,
3114-
"SyntheticsTestDetails",
3115+
"SyntheticsTestDetailsWithoutSteps",
31153116
"",
3116-
) as SyntheticsTestDetails;
3117+
) as SyntheticsTestDetailsWithoutSteps;
31173118
return body;
31183119
}
31193120

@@ -4670,7 +4671,7 @@ export class SyntheticsApi {
46704671
public getTest(
46714672
param: SyntheticsApiGetTestRequest,
46724673
options?: Configuration,
4673-
): Promise<SyntheticsTestDetails> {
4674+
): Promise<SyntheticsTestDetailsWithoutSteps> {
46744675
const requestContextPromise = this.requestFactory.getTest(
46754676
param.publicId,
46764677
options,
@@ -4746,7 +4747,7 @@ export class SyntheticsApi {
47464747
public async *listTestsWithPagination(
47474748
param: SyntheticsApiListTestsRequest = {},
47484749
options?: Configuration,
4749-
): AsyncGenerator<SyntheticsTestDetails> {
4750+
): AsyncGenerator<SyntheticsTestDetailsWithoutSteps> {
47504751
let pageSize = 100;
47514752
if (param.pageSize !== undefined) {
47524753
pageSize = param.pageSize;

services/synthetics/src/v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export { SyntheticsTestConfig } from "./models/SyntheticsTestConfig";
181181
export { SyntheticsTestDetails } from "./models/SyntheticsTestDetails";
182182
export { SyntheticsTestDetailsSubType } from "./models/SyntheticsTestDetailsSubType";
183183
export { SyntheticsTestDetailsType } from "./models/SyntheticsTestDetailsType";
184+
export { SyntheticsTestDetailsWithoutSteps } from "./models/SyntheticsTestDetailsWithoutSteps";
184185
export { SyntheticsTestExecutionRule } from "./models/SyntheticsTestExecutionRule";
185186
export { SyntheticsTestMonitorStatus } from "./models/SyntheticsTestMonitorStatus";
186187
export { SyntheticsTestOptions } from "./models/SyntheticsTestOptions";

services/synthetics/src/v1/models/SyntheticsListTestsResponse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AttributeTypeMap } from "@datadog/datadog-api-client";
22

3-
import { SyntheticsTestDetails } from "./SyntheticsTestDetails";
3+
import { SyntheticsTestDetailsWithoutSteps } from "./SyntheticsTestDetailsWithoutSteps";
44

55
/**
66
* Object containing an array of Synthetic tests configuration.
@@ -9,7 +9,7 @@ export class SyntheticsListTestsResponse {
99
/**
1010
* Array of Synthetic tests configuration.
1111
*/
12-
"tests"?: Array<SyntheticsTestDetails>;
12+
"tests"?: Array<SyntheticsTestDetailsWithoutSteps>;
1313
/**
1414
* A container for additional, undeclared properties.
1515
* This is a holder for any undeclared properties as specified with
@@ -27,7 +27,7 @@ export class SyntheticsListTestsResponse {
2727
static readonly attributeTypeMap: AttributeTypeMap = {
2828
tests: {
2929
baseName: "tests",
30-
type: "Array<SyntheticsTestDetails>",
30+
type: "Array<SyntheticsTestDetailsWithoutSteps>",
3131
},
3232
additionalProperties: {
3333
baseName: "additionalProperties",

services/synthetics/src/v1/models/SyntheticsTestDetails.ts

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

services/synthetics/src/v1/models/TypingInfo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ import { SyntheticsStepDetailWarning } from "./SyntheticsStepDetailWarning";
100100
import { SyntheticsTestCiOptions } from "./SyntheticsTestCiOptions";
101101
import { SyntheticsTestConfig } from "./SyntheticsTestConfig";
102102
import { SyntheticsTestDetails } from "./SyntheticsTestDetails";
103+
import { SyntheticsTestDetailsWithoutSteps } from "./SyntheticsTestDetailsWithoutSteps";
103104
import { SyntheticsTestOptions } from "./SyntheticsTestOptions";
104105
import { SyntheticsTestOptionsMonitorOptions } from "./SyntheticsTestOptionsMonitorOptions";
105106
import { SyntheticsTestOptionsRetry } from "./SyntheticsTestOptionsRetry";
@@ -538,6 +539,7 @@ export const TypingInfo: ModelTypingInfo = {
538539
SyntheticsTestCiOptions: SyntheticsTestCiOptions,
539540
SyntheticsTestConfig: SyntheticsTestConfig,
540541
SyntheticsTestDetails: SyntheticsTestDetails,
542+
SyntheticsTestDetailsWithoutSteps: SyntheticsTestDetailsWithoutSteps,
541543
SyntheticsTestOptions: SyntheticsTestOptions,
542544
SyntheticsTestOptionsMonitorOptions: SyntheticsTestOptionsMonitorOptions,
543545
SyntheticsTestOptionsRetry: SyntheticsTestOptionsRetry,

0 commit comments

Comments
 (0)