Skip to content

Commit fdecc53

Browse files
api-clients-generation-pipeline[bot]jirikuncarci.datadog-api-spec
authored
Update Synthetics CI test metadata (#311)
* Delete SyntheticsCITestMetadataCi.ts * Regenerate client from commit 5a8a968 of spec repo Co-authored-by: Jiri Kuncar <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent fbeaae2 commit fdecc53

File tree

11 files changed

+209
-32
lines changed

11 files changed

+209
-32
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.5.1.dev2",
7-
"regenerated": "2021-11-02 14:05:28.344809",
8-
"spec_repo_commit": "ca6b2d8"
7+
"regenerated": "2021-11-03 12:23:56.257041",
8+
"spec_repo_commit": "5a8a968"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2021-11-02 14:05:28.371028",
13-
"spec_repo_commit": "ca6b2d8"
12+
"regenerated": "2021-11-03 12:23:56.280638",
13+
"spec_repo_commit": "5a8a968"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9846,22 +9846,34 @@ components:
98469846
description: Description of the CI provider.
98479847
properties:
98489848
pipeline:
9849-
description: Name of the pipeline.
9850-
type: string
9849+
$ref: '#/components/schemas/SyntheticsCIBatchMetadataPipeline'
98519850
provider:
9852-
description: Name of the CI provider.
9853-
type: string
9851+
$ref: '#/components/schemas/SyntheticsCIBatchMetadataProvider'
98549852
type: object
98559853
SyntheticsCIBatchMetadataGit:
98569854
description: Git information.
98579855
properties:
98589856
branch:
98599857
description: The branch name.
98609858
type: string
9861-
commit_sha:
9859+
commitSha:
98629860
description: The commit SHA.
98639861
type: string
98649862
type: object
9863+
SyntheticsCIBatchMetadataPipeline:
9864+
description: Description of the CI pipeline.
9865+
properties:
9866+
url:
9867+
description: URL of the pipeline.
9868+
type: string
9869+
type: object
9870+
SyntheticsCIBatchMetadataProvider:
9871+
description: Description of the CI provider.
9872+
properties:
9873+
name:
9874+
description: Name of the CI provider.
9875+
type: string
9876+
type: object
98659877
SyntheticsCITest:
98669878
description: Test configuration for Synthetics CI
98679879
properties:
@@ -10659,7 +10671,8 @@ components:
1065910671
properties:
1066010672
assertions:
1066110673
default: []
10662-
description: Array of assertions used for the test.
10674+
description: Array of assertions used for the test. Required for single
10675+
API tests.
1066310676
example: []
1066410677
items:
1066510678
$ref: '#/components/schemas/SyntheticsAssertion'

docs/v1/SyntheticsApi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,8 +1592,12 @@ let params: v1.SyntheticsApiTriggerCITestsRequest = {
15921592
locations: ["locations_example"],
15931593
metadata: {
15941594
ci: {
1595-
pipeline: "pipeline_example",
1596-
provider: "provider_example",
1595+
pipeline: {
1596+
url: "url_example",
1597+
},
1598+
provider: {
1599+
name: "name_example",
1600+
},
15971601
},
15981602
git: {
15991603
branch: "branch_example",

features/v1/synthetics.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,13 @@ Feature: Synthetics
442442
@generated @skip
443443
Scenario: Trigger tests from CI/CD pipelines returns "JSON format is wrong" response
444444
Given new "TriggerCITests" request
445-
And body with value {"tests": [{"allowInsecureCertificates": null, "basicAuth": {"password": "", "username": ""}, "body": null, "bodyType": null, "cookies": null, "deviceIds": ["laptop_large"], "followRedirects": null, "headers": null, "locations": [null], "metadata": {"ci": {"pipeline": null, "provider": null}, "git": {"branch": null, "commit_sha": null}}, "public_id": "aaa-aaa-aaa", "retry": {"count": null, "interval": null}, "startUrl": null, "variables": null}]}
445+
And body with value {"tests": [{"allowInsecureCertificates": null, "basicAuth": {"password": "", "username": ""}, "body": null, "bodyType": null, "cookies": null, "deviceIds": ["laptop_large"], "followRedirects": null, "headers": null, "locations": [null], "metadata": {"ci": {"pipeline": {"url": null}, "provider": {"name": null}}, "git": {"branch": null, "commitSha": null}}, "public_id": "aaa-aaa-aaa", "retry": {"count": null, "interval": null}, "startUrl": null, "variables": null}]}
446446
When the request is sent
447447
Then the response status is 400 JSON format is wrong
448448

449449
@generated @skip
450450
Scenario: Trigger tests from CI/CD pipelines returns "OK" response
451451
Given new "TriggerCITests" request
452-
And body with value {"tests": [{"allowInsecureCertificates": null, "basicAuth": {"password": "", "username": ""}, "body": null, "bodyType": null, "cookies": null, "deviceIds": ["laptop_large"], "followRedirects": null, "headers": null, "locations": [null], "metadata": {"ci": {"pipeline": null, "provider": null}, "git": {"branch": null, "commit_sha": null}}, "public_id": "aaa-aaa-aaa", "retry": {"count": null, "interval": null}, "startUrl": null, "variables": null}]}
452+
And body with value {"tests": [{"allowInsecureCertificates": null, "basicAuth": {"password": "", "username": ""}, "body": null, "bodyType": null, "cookies": null, "deviceIds": ["laptop_large"], "followRedirects": null, "headers": null, "locations": [null], "metadata": {"ci": {"pipeline": {"url": null}, "provider": {"name": null}}, "git": {"branch": null, "commitSha": null}}, "public_id": "aaa-aaa-aaa", "retry": {"count": null, "interval": null}, "startUrl": null, "variables": null}]}
453453
When the request is sent
454454
Then the response status is 200 OK

packages/datadog-api-client-v1/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ models/SyntheticsBrowserVariableType.ts
483483
models/SyntheticsCIBatchMetadata.ts
484484
models/SyntheticsCIBatchMetadataCI.ts
485485
models/SyntheticsCIBatchMetadataGit.ts
486+
models/SyntheticsCIBatchMetadataPipeline.ts
487+
models/SyntheticsCIBatchMetadataProvider.ts
486488
models/SyntheticsCITest.ts
487489
models/SyntheticsCITestBody.ts
488490
models/SyntheticsCheckType.ts

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ import { SyntheticsBrowserVariable } from "./SyntheticsBrowserVariable";
310310
import { SyntheticsCIBatchMetadata } from "./SyntheticsCIBatchMetadata";
311311
import { SyntheticsCIBatchMetadataCI } from "./SyntheticsCIBatchMetadataCI";
312312
import { SyntheticsCIBatchMetadataGit } from "./SyntheticsCIBatchMetadataGit";
313+
import { SyntheticsCIBatchMetadataPipeline } from "./SyntheticsCIBatchMetadataPipeline";
314+
import { SyntheticsCIBatchMetadataProvider } from "./SyntheticsCIBatchMetadataProvider";
313315
import { SyntheticsCITest } from "./SyntheticsCITest";
314316
import { SyntheticsCITestBody } from "./SyntheticsCITestBody";
315317
import { SyntheticsConfigVariable } from "./SyntheticsConfigVariable";
@@ -969,6 +971,8 @@ const typeMap: { [index: string]: any } = {
969971
SyntheticsCIBatchMetadata: SyntheticsCIBatchMetadata,
970972
SyntheticsCIBatchMetadataCI: SyntheticsCIBatchMetadataCI,
971973
SyntheticsCIBatchMetadataGit: SyntheticsCIBatchMetadataGit,
974+
SyntheticsCIBatchMetadataPipeline: SyntheticsCIBatchMetadataPipeline,
975+
SyntheticsCIBatchMetadataProvider: SyntheticsCIBatchMetadataProvider,
972976
SyntheticsCITest: SyntheticsCITest,
973977
SyntheticsCITestBody: SyntheticsCITestBody,
974978
SyntheticsConfigVariable: SyntheticsConfigVariable,

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

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@
88
* Do not edit the class manually.
99
*/
1010

11+
import { SyntheticsCIBatchMetadataPipeline } from "./SyntheticsCIBatchMetadataPipeline";
12+
import { SyntheticsCIBatchMetadataProvider } from "./SyntheticsCIBatchMetadataProvider";
1113
import { ObjectSerializer } from "./ObjectSerializer";
1214

1315
/**
1416
* Description of the CI provider.
1517
*/
1618

1719
export class SyntheticsCIBatchMetadataCI {
18-
/**
19-
* Name of the pipeline.
20-
*/
21-
"pipeline"?: string;
22-
/**
23-
* Name of the CI provider.
24-
*/
25-
"provider"?: string;
20+
"pipeline"?: SyntheticsCIBatchMetadataPipeline;
21+
"provider"?: SyntheticsCIBatchMetadataProvider;
2622

2723
"unparsedObject"?: any;
2824

@@ -33,12 +29,12 @@ export class SyntheticsCIBatchMetadataCI {
3329
} = {
3430
pipeline: {
3531
baseName: "pipeline",
36-
type: "string",
32+
type: "SyntheticsCIBatchMetadataPipeline",
3733
format: "",
3834
},
3935
provider: {
4036
baseName: "provider",
41-
type: "string",
37+
type: "SyntheticsCIBatchMetadataProvider",
4238
format: "",
4339
},
4440
};
@@ -52,9 +48,17 @@ export class SyntheticsCIBatchMetadataCI {
5248
}): SyntheticsCIBatchMetadataCI {
5349
const res = new SyntheticsCIBatchMetadataCI();
5450

55-
res.pipeline = ObjectSerializer.deserialize(data.pipeline, "string", "");
51+
res.pipeline = ObjectSerializer.deserialize(
52+
data.pipeline,
53+
"SyntheticsCIBatchMetadataPipeline",
54+
""
55+
);
5656

57-
res.provider = ObjectSerializer.deserialize(data.provider, "string", "");
57+
res.provider = ObjectSerializer.deserialize(
58+
data.provider,
59+
"SyntheticsCIBatchMetadataProvider",
60+
""
61+
);
5862

5963
return res;
6064
}
@@ -70,9 +74,17 @@ export class SyntheticsCIBatchMetadataCI {
7074
if (data?.unparsedObject !== undefined) {
7175
return data.unparsedObject;
7276
}
73-
res.pipeline = ObjectSerializer.serialize(data.pipeline, "string", "");
77+
res.pipeline = ObjectSerializer.serialize(
78+
data.pipeline,
79+
"SyntheticsCIBatchMetadataPipeline",
80+
""
81+
);
7482

75-
res.provider = ObjectSerializer.serialize(data.provider, "string", "");
83+
res.provider = ObjectSerializer.serialize(
84+
data.provider,
85+
"SyntheticsCIBatchMetadataProvider",
86+
""
87+
);
7688

7789
return res;
7890
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class SyntheticsCIBatchMetadataGit {
3737
format: "",
3838
},
3939
commitSha: {
40-
baseName: "commit_sha",
40+
baseName: "commitSha",
4141
type: "string",
4242
format: "",
4343
},
@@ -54,7 +54,7 @@ export class SyntheticsCIBatchMetadataGit {
5454

5555
res.branch = ObjectSerializer.deserialize(data.branch, "string", "");
5656

57-
res.commitSha = ObjectSerializer.deserialize(data.commit_sha, "string", "");
57+
res.commitSha = ObjectSerializer.deserialize(data.commitSha, "string", "");
5858

5959
return res;
6060
}
@@ -72,7 +72,7 @@ export class SyntheticsCIBatchMetadataGit {
7272
}
7373
res.branch = ObjectSerializer.serialize(data.branch, "string", "");
7474

75-
res.commit_sha = ObjectSerializer.serialize(data.commitSha, "string", "");
75+
res.commitSha = ObjectSerializer.serialize(data.commitSha, "string", "");
7676

7777
return res;
7878
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
import { ObjectSerializer } from "./ObjectSerializer";
12+
13+
/**
14+
* Description of the CI pipeline.
15+
*/
16+
17+
export class SyntheticsCIBatchMetadataPipeline {
18+
/**
19+
* URL of the pipeline.
20+
*/
21+
"url"?: string;
22+
23+
"unparsedObject"?: any;
24+
25+
static readonly discriminator: string | undefined = undefined;
26+
27+
static readonly attributeTypeMap: {
28+
[key: string]: { baseName: string; type: string; format: string };
29+
} = {
30+
url: {
31+
baseName: "url",
32+
type: "string",
33+
format: "",
34+
},
35+
};
36+
37+
static getAttributeTypeMap() {
38+
return SyntheticsCIBatchMetadataPipeline.attributeTypeMap;
39+
}
40+
41+
static deserialize(data: {
42+
[key: string]: any;
43+
}): SyntheticsCIBatchMetadataPipeline {
44+
const res = new SyntheticsCIBatchMetadataPipeline();
45+
46+
res.url = ObjectSerializer.deserialize(data.url, "string", "");
47+
48+
return res;
49+
}
50+
51+
static serialize(data: SyntheticsCIBatchMetadataPipeline): {
52+
[key: string]: any;
53+
} {
54+
const attributeTypes =
55+
SyntheticsCIBatchMetadataPipeline.getAttributeTypeMap();
56+
const res: { [index: string]: any } = {};
57+
for (const [key, value] of Object.entries(data)) {
58+
if (!(key in attributeTypes)) {
59+
throw new TypeError(`${key} attribute not in schema`);
60+
}
61+
}
62+
if (data?.unparsedObject !== undefined) {
63+
return data.unparsedObject;
64+
}
65+
res.url = ObjectSerializer.serialize(data.url, "string", "");
66+
67+
return res;
68+
}
69+
70+
public constructor() {}
71+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
import { ObjectSerializer } from "./ObjectSerializer";
12+
13+
/**
14+
* Description of the CI provider.
15+
*/
16+
17+
export class SyntheticsCIBatchMetadataProvider {
18+
/**
19+
* Name of the CI provider.
20+
*/
21+
"name"?: string;
22+
23+
"unparsedObject"?: any;
24+
25+
static readonly discriminator: string | undefined = undefined;
26+
27+
static readonly attributeTypeMap: {
28+
[key: string]: { baseName: string; type: string; format: string };
29+
} = {
30+
name: {
31+
baseName: "name",
32+
type: "string",
33+
format: "",
34+
},
35+
};
36+
37+
static getAttributeTypeMap() {
38+
return SyntheticsCIBatchMetadataProvider.attributeTypeMap;
39+
}
40+
41+
static deserialize(data: {
42+
[key: string]: any;
43+
}): SyntheticsCIBatchMetadataProvider {
44+
const res = new SyntheticsCIBatchMetadataProvider();
45+
46+
res.name = ObjectSerializer.deserialize(data.name, "string", "");
47+
48+
return res;
49+
}
50+
51+
static serialize(data: SyntheticsCIBatchMetadataProvider): {
52+
[key: string]: any;
53+
} {
54+
const attributeTypes =
55+
SyntheticsCIBatchMetadataProvider.getAttributeTypeMap();
56+
const res: { [index: string]: any } = {};
57+
for (const [key, value] of Object.entries(data)) {
58+
if (!(key in attributeTypes)) {
59+
throw new TypeError(`${key} attribute not in schema`);
60+
}
61+
}
62+
if (data?.unparsedObject !== undefined) {
63+
return data.unparsedObject;
64+
}
65+
res.name = ObjectSerializer.serialize(data.name, "string", "");
66+
67+
return res;
68+
}
69+
70+
public constructor() {}
71+
}

0 commit comments

Comments
 (0)