Skip to content

Commit 7ae4bed

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fcc640d of spec repo (#248)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent b85c41b commit 7ae4bed

File tree

7 files changed

+118
-8
lines changed

7 files changed

+118
-8
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.4.1.dev11",
7-
"regenerated": "2021-08-13 15:37:00.039187",
8-
"spec_repo_commit": "64ee0b9"
7+
"regenerated": "2021-08-16 12:12:44.363721",
8+
"spec_repo_commit": "fcc640d"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev11",
12-
"regenerated": "2021-08-13 15:38:31.846707",
13-
"spec_repo_commit": "64ee0b9"
12+
"regenerated": "2021-08-16 12:14:15.689163",
13+
"spec_repo_commit": "fcc640d"
1414
}
1515
}
1616
}

docs/v1/SyntheticsApi.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ const apiInstance = new v1.SyntheticsApi(configuration);
4949
let params:v1.SyntheticsApiCreateGlobalVariableRequest = {
5050
// SyntheticsGlobalVariable | Details of the global variable to create.
5151
body: {
52+
attributes: {
53+
restrictedRoles: [
54+
"restrictedRoles_example",
55+
],
56+
},
5257
description: "Example description",
5358
name: "MY_VARIABLE",
5459
parseTestOptions: {
@@ -713,6 +718,11 @@ let params:v1.SyntheticsApiEditGlobalVariableRequest = {
713718
variableId: "variable_id_example",
714719
// SyntheticsGlobalVariable | Details of the global variable to update.
715720
body: {
721+
attributes: {
722+
restrictedRoles: [
723+
"restrictedRoles_example",
724+
],
725+
},
716726
description: "Example description",
717727
name: "MY_VARIABLE",
718728
parseTestOptions: {

features/v1/synthetics.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ Feature: Synthetics
5555
@generated @skip
5656
Scenario: Create a global variable returns "Invalid request" response
5757
Given new "CreateGlobalVariable" request
58-
And body with value {"description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
58+
And body with value {"attributes": {"restricted_roles": [null]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
5959
When the request is sent
6060
Then the response status is 400 Invalid request
6161

6262
@generated @skip
6363
Scenario: Create a global variable returns "OK" response
6464
Given new "CreateGlobalVariable" request
65-
And body with value {"description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
65+
And body with value {"attributes": {"restricted_roles": [null]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
6666
When the request is sent
6767
Then the response status is 200 OK
6868

@@ -191,15 +191,15 @@ Feature: Synthetics
191191
Scenario: Edit a global variable returns "Invalid request" response
192192
Given new "EditGlobalVariable" request
193193
And request contains "variable_id" parameter from "<PATH>"
194-
And body with value {"description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
194+
And body with value {"attributes": {"restricted_roles": [null]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
195195
When the request is sent
196196
Then the response status is 400 Invalid request
197197

198198
@generated @skip
199199
Scenario: Edit a global variable returns "OK" response
200200
Given new "EditGlobalVariable" request
201201
And request contains "variable_id" parameter from "<PATH>"
202-
And body with value {"description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
202+
And body with value {"attributes": {"restricted_roles": [null]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}}
203203
When the request is sent
204204
Then the response status is 200 OK
205205

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ models/SyntheticsErrorCode.ts
474474
models/SyntheticsGetAPITestLatestResultsResponse.ts
475475
models/SyntheticsGetBrowserTestLatestResultsResponse.ts
476476
models/SyntheticsGlobalVariable.ts
477+
models/SyntheticsGlobalVariableAttributes.ts
477478
models/SyntheticsGlobalVariableParseTestOptions.ts
478479
models/SyntheticsGlobalVariableParseTestOptionsType.ts
479480
models/SyntheticsGlobalVariableParserType.ts

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ import { SyntheticsDevice } from "./SyntheticsDevice";
308308
import { SyntheticsGetAPITestLatestResultsResponse } from "./SyntheticsGetAPITestLatestResultsResponse";
309309
import { SyntheticsGetBrowserTestLatestResultsResponse } from "./SyntheticsGetBrowserTestLatestResultsResponse";
310310
import { SyntheticsGlobalVariable } from "./SyntheticsGlobalVariable";
311+
import { SyntheticsGlobalVariableAttributes } from "./SyntheticsGlobalVariableAttributes";
311312
import { SyntheticsGlobalVariableParseTestOptions } from "./SyntheticsGlobalVariableParseTestOptions";
312313
import { SyntheticsGlobalVariableValue } from "./SyntheticsGlobalVariableValue";
313314
import { SyntheticsListGlobalVariablesResponse } from "./SyntheticsListGlobalVariablesResponse";
@@ -923,6 +924,7 @@ const typeMap: { [index: string]: any } = {
923924
SyntheticsGetAPITestLatestResultsResponse: SyntheticsGetAPITestLatestResultsResponse,
924925
SyntheticsGetBrowserTestLatestResultsResponse: SyntheticsGetBrowserTestLatestResultsResponse,
925926
SyntheticsGlobalVariable: SyntheticsGlobalVariable,
927+
SyntheticsGlobalVariableAttributes: SyntheticsGlobalVariableAttributes,
926928
SyntheticsGlobalVariableParseTestOptions: SyntheticsGlobalVariableParseTestOptions,
927929
SyntheticsGlobalVariableValue: SyntheticsGlobalVariableValue,
928930
SyntheticsListGlobalVariablesResponse: SyntheticsListGlobalVariablesResponse,

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Do not edit the class manually.
99
*/
1010

11+
import { SyntheticsGlobalVariableAttributes } from "./SyntheticsGlobalVariableAttributes";
1112
import { SyntheticsGlobalVariableParseTestOptions } from "./SyntheticsGlobalVariableParseTestOptions";
1213
import { SyntheticsGlobalVariableValue } from "./SyntheticsGlobalVariableValue";
1314
import { ObjectSerializer } from "./ObjectSerializer";
@@ -17,6 +18,7 @@ import { ObjectSerializer } from "./ObjectSerializer";
1718
*/
1819

1920
export class SyntheticsGlobalVariable {
21+
"attributes"?: SyntheticsGlobalVariableAttributes;
2022
/**
2123
* Description of the global variable.
2224
*/
@@ -47,6 +49,11 @@ export class SyntheticsGlobalVariable {
4749
static readonly attributeTypeMap: {
4850
[key: string]: { baseName: string; type: string; format: string };
4951
} = {
52+
attributes: {
53+
baseName: "attributes",
54+
type: "SyntheticsGlobalVariableAttributes",
55+
format: "",
56+
},
5057
description: {
5158
baseName: "description",
5259
type: "string",
@@ -91,6 +98,12 @@ export class SyntheticsGlobalVariable {
9198
static deserialize(data: { [key: string]: any }): SyntheticsGlobalVariable {
9299
const res = new SyntheticsGlobalVariable();
93100

101+
res.attributes = ObjectSerializer.deserialize(
102+
data.attributes,
103+
"SyntheticsGlobalVariableAttributes",
104+
""
105+
);
106+
94107
if (data.description === undefined) {
95108
throw new TypeError(
96109
"missing required attribute 'description' on 'SyntheticsGlobalVariable' object"
@@ -155,6 +168,12 @@ export class SyntheticsGlobalVariable {
155168
if (data?.unparsedObject !== undefined) {
156169
return data.unparsedObject;
157170
}
171+
res.attributes = ObjectSerializer.serialize(
172+
data.attributes,
173+
"SyntheticsGlobalVariableAttributes",
174+
""
175+
);
176+
158177
if (data.description === undefined) {
159178
throw new TypeError(
160179
"missing required attribute 'description' on 'SyntheticsGlobalVariable' object"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
* Attributes of the global variable.
15+
*/
16+
17+
export class SyntheticsGlobalVariableAttributes {
18+
/**
19+
* List of role identifiers that can be pulled from the Roles API.
20+
*/
21+
"restrictedRoles"?: Array<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+
restrictedRoles: {
31+
baseName: "restricted_roles",
32+
type: "Array<string>",
33+
format: "",
34+
},
35+
};
36+
37+
static getAttributeTypeMap() {
38+
return SyntheticsGlobalVariableAttributes.attributeTypeMap;
39+
}
40+
41+
static deserialize(data: {
42+
[key: string]: any;
43+
}): SyntheticsGlobalVariableAttributes {
44+
const res = new SyntheticsGlobalVariableAttributes();
45+
46+
res.restrictedRoles = ObjectSerializer.deserialize(
47+
data.restricted_roles,
48+
"Array<string>",
49+
""
50+
);
51+
52+
return res;
53+
}
54+
55+
static serialize(
56+
data: SyntheticsGlobalVariableAttributes
57+
): { [key: string]: any } {
58+
const attributeTypes = SyntheticsGlobalVariableAttributes.getAttributeTypeMap();
59+
const res: { [index: string]: any } = {};
60+
for (const [key, value] of Object.entries(data)) {
61+
if (!(key in attributeTypes)) {
62+
throw new TypeError(`${key} attribute not in schema`);
63+
}
64+
}
65+
if (data?.unparsedObject !== undefined) {
66+
return data.unparsedObject;
67+
}
68+
res.restricted_roles = ObjectSerializer.serialize(
69+
data.restrictedRoles,
70+
"Array<string>",
71+
""
72+
);
73+
74+
return res;
75+
}
76+
77+
public constructor() {}
78+
}

0 commit comments

Comments
 (0)