Skip to content

Commit f1cf19a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 2a54e42 of spec repo (#156)
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 ebb474b commit f1cf19a

File tree

12 files changed

+258
-5
lines changed

12 files changed

+258
-5
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.dev8",
7-
"regenerated": "2021-05-27 15:02:53.179334",
8-
"spec_repo_commit": "5311d4c"
7+
"regenerated": "2021-05-28 09:09:44.724486",
8+
"spec_repo_commit": "2a54e42"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev8",
12-
"regenerated": "2021-05-27 15:03:39.382450",
13-
"spec_repo_commit": "5311d4c"
12+
"regenerated": "2021-05-28 09:10:29.513983",
13+
"spec_repo_commit": "2a54e42"
1414
}
1515
}
1616
}

docs/v1/SyntheticsApi.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Method | HTTP request | Description
2121
[**getGlobalVariable**](SyntheticsApi.md#getGlobalVariable) | **GET** /api/v1/synthetics/variables/{variable_id} | Get a global variable
2222
[**getPrivateLocation**](SyntheticsApi.md#getPrivateLocation) | **GET** /api/v1/synthetics/private-locations/{location_id} | Get a private location
2323
[**getTest**](SyntheticsApi.md#getTest) | **GET** /api/v1/synthetics/tests/{public_id} | Get a test configuration
24+
[**listGlobalVariables**](SyntheticsApi.md#listGlobalVariables) | **GET** /api/v1/synthetics/variables | Get all global variables
2425
[**listLocations**](SyntheticsApi.md#listLocations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private)
2526
[**listTests**](SyntheticsApi.md#listTests) | **GET** /api/v1/synthetics/tests | Get the list of all tests
2627
[**triggerCITests**](SyntheticsApi.md#triggerCITests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger tests from CI/CD pipelines
@@ -1292,6 +1293,55 @@ Name | Type | Description | Notes
12921293

12931294
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
12941295

1296+
## **listGlobalVariables**
1297+
> SyntheticsListGlobalVariablesResponse listGlobalVariables()
1298+
1299+
Get the list of all Synthetics global variables.
1300+
1301+
### Example
1302+
1303+
1304+
```typescript
1305+
import { v1 } from 'datadog-api-client';
1306+
import * as fs from 'fs';
1307+
1308+
const configuration = v1.createConfiguration();
1309+
const apiInstance = new v1.SyntheticsApi(configuration);
1310+
1311+
let body:any = {};
1312+
1313+
apiInstance.listGlobalVariables(body).then((data:any) => {
1314+
console.log('API called successfully. Returned data: ' + data);
1315+
}).catch((error:any) => console.error(error));
1316+
```
1317+
1318+
1319+
### Parameters
1320+
This endpoint does not need any parameter.
1321+
1322+
1323+
### Return type
1324+
1325+
**SyntheticsListGlobalVariablesResponse**
1326+
1327+
### Authorization
1328+
1329+
[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)
1330+
1331+
### HTTP request headers
1332+
1333+
- **Content-Type**: Not defined
1334+
- **Accept**: application/json
1335+
1336+
1337+
### HTTP response details
1338+
| Status code | Description | Response headers |
1339+
|-------------|-------------|------------------|
1340+
**200** | OK | - |
1341+
**403** | Forbidden | - |
1342+
1343+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1344+
12951345
## **listLocations**
12961346
> SyntheticsLocations listLocations()
12971347

features/v1/synthetics.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ Feature: Synthetics
314314
When the request is sent
315315
Then the response status is 200 OK
316316

317+
@generated @skip
318+
Scenario: Get all global variables returns "OK" response
319+
Given new "ListGlobalVariables" request
320+
When the request is sent
321+
Then the response status is 200 OK
322+
317323
@generated @skip
318324
Scenario: Get all locations (public and private) returns "OK" response
319325
Given new "ListLocations" request

features/v1/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,12 @@
979979
"type": "idempotent"
980980
}
981981
},
982+
"ListGlobalVariables": {
983+
"tag": "Synthetics",
984+
"undo": {
985+
"type": "safe"
986+
}
987+
},
982988
"CreateGlobalVariable": {
983989
"tag": "Synthetics",
984990
"undo": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ models/SyntheticsGlobalVariableParseTestOptions.ts
460460
models/SyntheticsGlobalVariableParseTestOptionsType.ts
461461
models/SyntheticsGlobalVariableParserType.ts
462462
models/SyntheticsGlobalVariableValue.ts
463+
models/SyntheticsListGlobalVariablesResponse.ts
463464
models/SyntheticsListTestsResponse.ts
464465
models/SyntheticsLocation.ts
465466
models/SyntheticsLocations.ts

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

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { SyntheticsDeleteTestsResponse } from '../models/SyntheticsDeleteTestsRe
1818
import { SyntheticsGetAPITestLatestResultsResponse } from '../models/SyntheticsGetAPITestLatestResultsResponse';
1919
import { SyntheticsGetBrowserTestLatestResultsResponse } from '../models/SyntheticsGetBrowserTestLatestResultsResponse';
2020
import { SyntheticsGlobalVariable } from '../models/SyntheticsGlobalVariable';
21+
import { SyntheticsListGlobalVariablesResponse } from '../models/SyntheticsListGlobalVariablesResponse';
2122
import { SyntheticsListTestsResponse } from '../models/SyntheticsListTestsResponse';
2223
import { SyntheticsLocations } from '../models/SyntheticsLocations';
2324
import { SyntheticsPrivateLocation } from '../models/SyntheticsPrivateLocation';
@@ -915,6 +916,44 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory {
915916
return requestContext;
916917
}
917918

919+
/**
920+
* Get the list of all Synthetics global variables.
921+
* Get all global variables
922+
*/
923+
public async listGlobalVariables(options?: Configuration): Promise<RequestContext> {
924+
let config = options || this.configuration;
925+
926+
// Path Params
927+
const localVarPath = '/api/v1/synthetics/variables';
928+
929+
// Make Request Context
930+
const requestContext = getServer(config, 'SyntheticsApi.listGlobalVariables').makeRequestContext(localVarPath, HttpMethod.GET);
931+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
932+
requestContext.setHttpConfig(config.httpConfig);
933+
934+
// Query Params
935+
936+
// Header Params
937+
938+
// Form Params
939+
940+
941+
// Body Params
942+
943+
let authMethod = null;
944+
// Apply auth methods
945+
authMethod = config.authMethods["apiKeyAuth"]
946+
if (authMethod) {
947+
await authMethod.applySecurityAuthentication(requestContext);
948+
}
949+
authMethod = config.authMethods["appKeyAuth"]
950+
if (authMethod) {
951+
await authMethod.applySecurityAuthentication(requestContext);
952+
}
953+
954+
return requestContext;
955+
}
956+
918957
/**
919958
* Get the list of public and private locations available for Synthetic tests. No arguments required.
920959
* Get all locations (public and private)
@@ -2051,6 +2090,43 @@ export class SyntheticsApiResponseProcessor {
20512090
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
20522091
}
20532092

2093+
/**
2094+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
2095+
* to the expected objects
2096+
*
2097+
* @params response Response returned by the server for a request to listGlobalVariables
2098+
* @throws ApiException if the response code was not in [200, 299]
2099+
*/
2100+
public async listGlobalVariables(response: ResponseContext): Promise<SyntheticsListGlobalVariablesResponse > {
2101+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2102+
if (isCodeInRange("200", response.httpStatusCode)) {
2103+
const body: SyntheticsListGlobalVariablesResponse = ObjectSerializer.deserialize(
2104+
ObjectSerializer.parse(await response.body.text(), contentType),
2105+
"SyntheticsListGlobalVariablesResponse", ""
2106+
) as SyntheticsListGlobalVariablesResponse;
2107+
return body;
2108+
}
2109+
if (isCodeInRange("403", response.httpStatusCode)) {
2110+
const body: APIErrorResponse = ObjectSerializer.deserialize(
2111+
ObjectSerializer.parse(await response.body.text(), contentType),
2112+
"APIErrorResponse", ""
2113+
) as APIErrorResponse;
2114+
throw new ApiException<APIErrorResponse>(403, body);
2115+
}
2116+
2117+
// Work around for missing responses in specification, e.g. for petstore.yaml
2118+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2119+
const body: SyntheticsListGlobalVariablesResponse = ObjectSerializer.deserialize(
2120+
ObjectSerializer.parse(await response.body.text(), contentType),
2121+
"SyntheticsListGlobalVariablesResponse", ""
2122+
) as SyntheticsListGlobalVariablesResponse;
2123+
return body;
2124+
}
2125+
2126+
let body = response.body || "";
2127+
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
2128+
}
2129+
20542130
/**
20552131
* Unwraps the actual response sent by the server from the response context and deserializes the response content
20562132
* to the expected objects

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

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ import { SyntheticsGlobalVariableParseTestOptions } from './SyntheticsGlobalVari
392392
import { SyntheticsGlobalVariableParseTestOptionsType } from './SyntheticsGlobalVariableParseTestOptionsType';
393393
import { SyntheticsGlobalVariableParserType } from './SyntheticsGlobalVariableParserType';
394394
import { SyntheticsGlobalVariableValue } from './SyntheticsGlobalVariableValue';
395+
import { SyntheticsListGlobalVariablesResponse } from './SyntheticsListGlobalVariablesResponse';
395396
import { SyntheticsListTestsResponse } from './SyntheticsListTestsResponse';
396397
import { SyntheticsLocation } from './SyntheticsLocation';
397398
import { SyntheticsLocations } from './SyntheticsLocations';
@@ -1036,6 +1037,7 @@ let typeMap: {[index: string]: any} = {
10361037
"SyntheticsGlobalVariable": SyntheticsGlobalVariable,
10371038
"SyntheticsGlobalVariableParseTestOptions": SyntheticsGlobalVariableParseTestOptions,
10381039
"SyntheticsGlobalVariableValue": SyntheticsGlobalVariableValue,
1040+
"SyntheticsListGlobalVariablesResponse": SyntheticsListGlobalVariablesResponse,
10391041
"SyntheticsListTestsResponse": SyntheticsListTestsResponse,
10401042
"SyntheticsLocation": SyntheticsLocation,
10411043
"SyntheticsLocations": SyntheticsLocations,
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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 { SyntheticsGlobalVariable } from './SyntheticsGlobalVariable';
12+
import { HttpFile } from '../http/http';
13+
import { ObjectSerializer } from './ObjectSerializer';
14+
15+
/**
16+
* Object containing an array of Synthetic global variables.
17+
*/
18+
19+
export class SyntheticsListGlobalVariablesResponse {
20+
/**
21+
* Array of Synthetic global variables.
22+
*/
23+
'variables'?: Array<SyntheticsGlobalVariable>;
24+
25+
static readonly discriminator: string | undefined = undefined;
26+
27+
static readonly attributeTypeMap: {[key: string]: {baseName: string, type: string, format: string}} = {
28+
"variables": {
29+
"baseName": "variables",
30+
"type": "Array<SyntheticsGlobalVariable>",
31+
"format": ""
32+
} };
33+
34+
static getAttributeTypeMap() {
35+
return SyntheticsListGlobalVariablesResponse.attributeTypeMap;
36+
}
37+
38+
static deserialize(data: {[key: string]: any}): SyntheticsListGlobalVariablesResponse {
39+
let res = new SyntheticsListGlobalVariablesResponse();
40+
41+
res.variables = ObjectSerializer.deserialize(data.variables, "Array<SyntheticsGlobalVariable>", "")
42+
43+
44+
return res;
45+
}
46+
47+
static serialize(data: SyntheticsListGlobalVariablesResponse): {[key: string]: any} {
48+
let attributeTypes = SyntheticsListGlobalVariablesResponse.getAttributeTypeMap();
49+
let res: {[index: string]: any} = {};
50+
for (let [key, value] of Object.entries(data)) {
51+
if (!(key in attributeTypes)) {
52+
throw new TypeError(`${key} attribute not in schema`);
53+
}
54+
}
55+
res.variables = ObjectSerializer.serialize(data.variables, "Array<SyntheticsGlobalVariable>", "")
56+
57+
return res
58+
}
59+
60+
public constructor() {
61+
}
62+
}
63+
64+
65+

packages/datadog-api-client-v1/types/ObjectParamAPI.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ import { SyntheticsGlobalVariableParseTestOptions } from '../models/SyntheticsGl
396396
import { SyntheticsGlobalVariableParseTestOptionsType } from '../models/SyntheticsGlobalVariableParseTestOptionsType';
397397
import { SyntheticsGlobalVariableParserType } from '../models/SyntheticsGlobalVariableParserType';
398398
import { SyntheticsGlobalVariableValue } from '../models/SyntheticsGlobalVariableValue';
399+
import { SyntheticsListGlobalVariablesResponse } from '../models/SyntheticsListGlobalVariablesResponse';
399400
import { SyntheticsListTestsResponse } from '../models/SyntheticsListTestsResponse';
400401
import { SyntheticsLocation } from '../models/SyntheticsLocation';
401402
import { SyntheticsLocations } from '../models/SyntheticsLocations';
@@ -3729,6 +3730,9 @@ export interface SyntheticsApiGetTestRequest {
37293730
publicId: string
37303731
}
37313732

3733+
export interface SyntheticsApiListGlobalVariablesRequest {
3734+
}
3735+
37323736
export interface SyntheticsApiListLocationsRequest {
37333737
}
37343738

@@ -3964,6 +3968,15 @@ export class ObjectSyntheticsApi {
39643968
return this.api.getTest(param.publicId, options).toPromise();
39653969
}
39663970

3971+
/**
3972+
* Get the list of all Synthetics global variables.
3973+
* Get all global variables
3974+
* @param param the request object
3975+
*/
3976+
public listGlobalVariables(param: SyntheticsApiListGlobalVariablesRequest, options?: Configuration): Promise<SyntheticsListGlobalVariablesResponse> {
3977+
return this.api.listGlobalVariables( options).toPromise();
3978+
}
3979+
39673980
/**
39683981
* Get the list of public and private locations available for Synthetic tests. No arguments required.
39693982
* Get all locations (public and private)

0 commit comments

Comments
 (0)