Skip to content

Commit 6721ff9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 849304a of spec repo
1 parent 0a51179 commit 6721ff9

File tree

13 files changed

+481
-0
lines changed

13 files changed

+481
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51062,6 +51062,49 @@ components:
5106251062
$ref: '#/components/schemas/ServiceDefinitionData'
5106351063
type: array
5106451064
type: object
51065+
ServiceList:
51066+
properties:
51067+
data:
51068+
$ref: '#/components/schemas/ServiceListData'
51069+
type: object
51070+
ServiceListData:
51071+
properties:
51072+
attributes:
51073+
$ref: '#/components/schemas/ServiceListDataAttributes'
51074+
id:
51075+
type: string
51076+
type:
51077+
$ref: '#/components/schemas/ServiceListDataType'
51078+
required:
51079+
- type
51080+
type: object
51081+
ServiceListDataAttributes:
51082+
properties:
51083+
metadata:
51084+
items:
51085+
$ref: '#/components/schemas/ServiceListDataAttributesMetadataItems'
51086+
type: array
51087+
services:
51088+
items:
51089+
type: string
51090+
type: array
51091+
type: object
51092+
ServiceListDataAttributesMetadataItems:
51093+
properties:
51094+
isTraced:
51095+
type: boolean
51096+
isUsm:
51097+
type: boolean
51098+
type: object
51099+
ServiceListDataType:
51100+
default: services_list
51101+
description: Services list resource type.
51102+
enum:
51103+
- services_list
51104+
example: services_list
51105+
type: string
51106+
x-enum-varnames:
51107+
- SERVICES_LIST
5106551108
ServiceNowBasicAuth:
5106651109
description: The definition of the `ServiceNowBasicAuth` object.
5106751110
properties:
@@ -61255,6 +61298,26 @@ paths:
6125561298
permissions:
6125661299
- apm_retention_filter_write
6125761300
- apm_pipelines_write
61301+
/api/v2/apm/services:
61302+
get:
61303+
operationId: GetServiceList
61304+
responses:
61305+
'200':
61306+
content:
61307+
application/json:
61308+
schema:
61309+
$ref: '#/components/schemas/ServiceList'
61310+
description: OK
61311+
'429':
61312+
$ref: '#/components/responses/TooManyRequestsResponse'
61313+
security:
61314+
- apiKeyAuth: []
61315+
appKeyAuth: []
61316+
- AuthZ:
61317+
- apm_read
61318+
summary: Get service list
61319+
tags:
61320+
- APM
6125861321
/api/v2/app-builder/apps:
6125961322
delete:
6126061323
description: Delete multiple apps in a single request from a list of app IDs.
@@ -87993,6 +88056,9 @@ servers:
8799388056
tags:
8799488057
- description: Configure your API endpoints through the Datadog API.
8799588058
name: API Management
88059+
- description: Observe, troubleshoot, and improve cloud-scale applications with all
88060+
telemetry in context
88061+
name: APM
8799688062
- description: Manage configuration of [APM retention filters](https://app.datadoghq.com/apm/traces/retention-filters)
8799788063
for your organization. You need an API and application key with Admin rights to
8799888064
interact with this endpoint. See [retention filters](https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/#retention-filters)

examples/v2/apm/GetServiceList.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Get service list returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.APMApi(configuration);
9+
10+
apiInstance
11+
.getServiceList()
12+
.then((data: v2.ServiceList) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,9 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
30923092
},
30933093
"operationResponseType": "{}",
30943094
},
3095+
"v2.GetServiceList": {
3096+
"operationResponseType": "ServiceList",
3097+
},
30953098
"v2.ListApps": {
30963099
"limit": {
30973100
"type": "number",

features/v2/apm.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@endpoint(apm) @endpoint(apm-v2)
2+
Feature: APM
3+
Observe, troubleshoot, and improve cloud-scale applications with all
4+
telemetry in context
5+
6+
@generated @skip @team:DataDog/apm-aoe
7+
Scenario: Get service list returns "OK" response
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "APM" API
11+
And new "GetServiceList" request
12+
When the request is sent
13+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@
516516
"type": "idempotent"
517517
}
518518
},
519+
"GetServiceList": {
520+
"tag": "APM",
521+
"undo": {
522+
"type": "safe"
523+
}
524+
},
519525
"DeleteApps": {
520526
"tag": "App Builder",
521527
"undo": {
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi";
2+
import {
3+
Configuration,
4+
applySecurityAuthentication,
5+
} from "../../datadog-api-client-common/configuration";
6+
import {
7+
RequestContext,
8+
HttpMethod,
9+
ResponseContext,
10+
} from "../../datadog-api-client-common/http/http";
11+
12+
import { logger } from "../../../logger";
13+
import { ObjectSerializer } from "../models/ObjectSerializer";
14+
import { ApiException } from "../../datadog-api-client-common/exception";
15+
16+
import { APIErrorResponse } from "../models/APIErrorResponse";
17+
import { ServiceList } from "../models/ServiceList";
18+
19+
export class APMApiRequestFactory extends BaseAPIRequestFactory {
20+
public async getServiceList(
21+
_options?: Configuration
22+
): Promise<RequestContext> {
23+
const _config = _options || this.configuration;
24+
25+
// Path Params
26+
const localVarPath = "/api/v2/apm/services";
27+
28+
// Make Request Context
29+
const requestContext = _config
30+
.getServer("v2.APMApi.getServiceList")
31+
.makeRequestContext(localVarPath, HttpMethod.GET);
32+
requestContext.setHeaderParam("Accept", "application/json");
33+
requestContext.setHttpConfig(_config.httpConfig);
34+
35+
// Apply auth methods
36+
applySecurityAuthentication(_config, requestContext, [
37+
"apiKeyAuth",
38+
"appKeyAuth",
39+
"AuthZ",
40+
]);
41+
42+
return requestContext;
43+
}
44+
}
45+
46+
export class APMApiResponseProcessor {
47+
/**
48+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
49+
* to the expected objects
50+
*
51+
* @params response Response returned by the server for a request to getServiceList
52+
* @throws ApiException if the response code was not in [200, 299]
53+
*/
54+
public async getServiceList(response: ResponseContext): Promise<ServiceList> {
55+
const contentType = ObjectSerializer.normalizeMediaType(
56+
response.headers["content-type"]
57+
);
58+
if (response.httpStatusCode === 200) {
59+
const body: ServiceList = ObjectSerializer.deserialize(
60+
ObjectSerializer.parse(await response.body.text(), contentType),
61+
"ServiceList"
62+
) as ServiceList;
63+
return body;
64+
}
65+
if (response.httpStatusCode === 429) {
66+
const bodyText = ObjectSerializer.parse(
67+
await response.body.text(),
68+
contentType
69+
);
70+
let body: APIErrorResponse;
71+
try {
72+
body = ObjectSerializer.deserialize(
73+
bodyText,
74+
"APIErrorResponse"
75+
) as APIErrorResponse;
76+
} catch (error) {
77+
logger.debug(`Got error deserializing error: ${error}`);
78+
throw new ApiException<APIErrorResponse>(
79+
response.httpStatusCode,
80+
bodyText
81+
);
82+
}
83+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
84+
}
85+
86+
// Work around for missing responses in specification, e.g. for petstore.yaml
87+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
88+
const body: ServiceList = ObjectSerializer.deserialize(
89+
ObjectSerializer.parse(await response.body.text(), contentType),
90+
"ServiceList",
91+
""
92+
) as ServiceList;
93+
return body;
94+
}
95+
96+
const body = (await response.body.text()) || "";
97+
throw new ApiException<string>(
98+
response.httpStatusCode,
99+
'Unknown API Status Code!\nBody: "' + body + '"'
100+
);
101+
}
102+
}
103+
104+
export class APMApi {
105+
private requestFactory: APMApiRequestFactory;
106+
private responseProcessor: APMApiResponseProcessor;
107+
private configuration: Configuration;
108+
109+
public constructor(
110+
configuration: Configuration,
111+
requestFactory?: APMApiRequestFactory,
112+
responseProcessor?: APMApiResponseProcessor
113+
) {
114+
this.configuration = configuration;
115+
this.requestFactory =
116+
requestFactory || new APMApiRequestFactory(configuration);
117+
this.responseProcessor = responseProcessor || new APMApiResponseProcessor();
118+
}
119+
120+
/**
121+
* @param param The request object
122+
*/
123+
public getServiceList(options?: Configuration): Promise<ServiceList> {
124+
const requestContextPromise = this.requestFactory.getServiceList(options);
125+
return requestContextPromise.then((requestContext) => {
126+
return this.configuration.httpApi
127+
.send(requestContext)
128+
.then((responseContext) => {
129+
return this.responseProcessor.getServiceList(responseContext);
130+
});
131+
});
132+
}
133+
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export {
77
APIManagementApi,
88
} from "./apis/APIManagementApi";
99

10+
export { APMApi } from "./apis/APMApi";
11+
1012
export {
1113
APMRetentionFiltersApiCreateApmRetentionFilterRequest,
1214
APMRetentionFiltersApiDeleteApmRetentionFilterRequest,
@@ -4147,6 +4149,11 @@ export { ServiceDefinitionV2Repo } from "./models/ServiceDefinitionV2Repo";
41474149
export { ServiceDefinitionV2Slack } from "./models/ServiceDefinitionV2Slack";
41484150
export { ServiceDefinitionV2SlackType } from "./models/ServiceDefinitionV2SlackType";
41494151
export { ServiceDefinitionV2Version } from "./models/ServiceDefinitionV2Version";
4152+
export { ServiceList } from "./models/ServiceList";
4153+
export { ServiceListData } from "./models/ServiceListData";
4154+
export { ServiceListDataAttributes } from "./models/ServiceListDataAttributes";
4155+
export { ServiceListDataAttributesMetadataItems } from "./models/ServiceListDataAttributesMetadataItems";
4156+
export { ServiceListDataType } from "./models/ServiceListDataType";
41504157
export { ServiceNowBasicAuth } from "./models/ServiceNowBasicAuth";
41514158
export { ServiceNowBasicAuthType } from "./models/ServiceNowBasicAuthType";
41524159
export { ServiceNowBasicAuthUpdate } from "./models/ServiceNowBasicAuthUpdate";

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,6 +2392,10 @@ import { ServiceDefinitionV2Opsgenie } from "./ServiceDefinitionV2Opsgenie";
23922392
import { ServiceDefinitionV2Repo } from "./ServiceDefinitionV2Repo";
23932393
import { ServiceDefinitionV2Slack } from "./ServiceDefinitionV2Slack";
23942394
import { ServiceDefinitionsListResponse } from "./ServiceDefinitionsListResponse";
2395+
import { ServiceList } from "./ServiceList";
2396+
import { ServiceListData } from "./ServiceListData";
2397+
import { ServiceListDataAttributes } from "./ServiceListDataAttributes";
2398+
import { ServiceListDataAttributesMetadataItems } from "./ServiceListDataAttributesMetadataItems";
23952399
import { ServiceNowBasicAuth } from "./ServiceNowBasicAuth";
23962400
import { ServiceNowBasicAuthUpdate } from "./ServiceNowBasicAuthUpdate";
23972401
import { ServiceNowIntegration } from "./ServiceNowIntegration";
@@ -4170,6 +4174,7 @@ const enumsMap: { [key: string]: any[] } = {
41704174
ServiceDefinitionV2OpsgenieRegion: ["US", "EU"],
41714175
ServiceDefinitionV2SlackType: ["slack"],
41724176
ServiceDefinitionV2Version: ["v2"],
4177+
ServiceListDataType: ["services_list"],
41734178
ServiceNowBasicAuthType: ["ServiceNowBasicAuth"],
41744179
ServiceNowIntegrationType: ["ServiceNow"],
41754180
ShiftDataRelationshipsUserDataType: ["users"],
@@ -7252,6 +7257,11 @@ const typeMap: { [index: string]: any } = {
72527257
ServiceDefinitionV2Repo: ServiceDefinitionV2Repo,
72537258
ServiceDefinitionV2Slack: ServiceDefinitionV2Slack,
72547259
ServiceDefinitionsListResponse: ServiceDefinitionsListResponse,
7260+
ServiceList: ServiceList,
7261+
ServiceListData: ServiceListData,
7262+
ServiceListDataAttributes: ServiceListDataAttributes,
7263+
ServiceListDataAttributesMetadataItems:
7264+
ServiceListDataAttributesMetadataItems,
72557265
ServiceNowBasicAuth: ServiceNowBasicAuth,
72567266
ServiceNowBasicAuthUpdate: ServiceNowBasicAuthUpdate,
72577267
ServiceNowIntegration: ServiceNowIntegration,
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 { ServiceListData } from "./ServiceListData";
7+
8+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
9+
10+
export class ServiceList {
11+
"data"?: ServiceListData;
12+
13+
/**
14+
* A container for additional, undeclared properties.
15+
* This is a holder for any undeclared properties as specified with
16+
* the 'additionalProperties' keyword in the OAS document.
17+
*/
18+
"additionalProperties"?: { [key: string]: any };
19+
20+
/**
21+
* @ignore
22+
*/
23+
"_unparsed"?: boolean;
24+
25+
/**
26+
* @ignore
27+
*/
28+
static readonly attributeTypeMap: AttributeTypeMap = {
29+
data: {
30+
baseName: "data",
31+
type: "ServiceListData",
32+
},
33+
additionalProperties: {
34+
baseName: "additionalProperties",
35+
type: "{ [key: string]: any; }",
36+
},
37+
};
38+
39+
/**
40+
* @ignore
41+
*/
42+
static getAttributeTypeMap(): AttributeTypeMap {
43+
return ServiceList.attributeTypeMap;
44+
}
45+
46+
public constructor() {}
47+
}

0 commit comments

Comments
 (0)