Skip to content

Commit 4317b1b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4a60f0e of spec repo
1 parent 0270993 commit 4317b1b

File tree

13 files changed

+479
-0
lines changed

13 files changed

+479
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50937,6 +50937,49 @@ components:
5093750937
$ref: '#/components/schemas/ServiceDefinitionData'
5093850938
type: array
5093950939
type: object
50940+
ServiceList:
50941+
properties:
50942+
data:
50943+
$ref: '#/components/schemas/ServiceListData'
50944+
type: object
50945+
ServiceListData:
50946+
properties:
50947+
attributes:
50948+
$ref: '#/components/schemas/ServiceListDataAttributes'
50949+
id:
50950+
type: string
50951+
type:
50952+
$ref: '#/components/schemas/ServiceListDataType'
50953+
required:
50954+
- type
50955+
type: object
50956+
ServiceListDataAttributes:
50957+
properties:
50958+
metadata:
50959+
items:
50960+
$ref: '#/components/schemas/ServiceListDataAttributesMetadataItems'
50961+
type: array
50962+
services:
50963+
items:
50964+
type: string
50965+
type: array
50966+
type: object
50967+
ServiceListDataAttributesMetadataItems:
50968+
properties:
50969+
isTraced:
50970+
type: boolean
50971+
isUsm:
50972+
type: boolean
50973+
type: object
50974+
ServiceListDataType:
50975+
default: services_list
50976+
description: Services list resource type.
50977+
enum:
50978+
- services_list
50979+
example: services_list
50980+
type: string
50981+
x-enum-varnames:
50982+
- SERVICES_LIST
5094050983
ServiceNowBasicAuth:
5094150984
description: The definition of the `ServiceNowBasicAuth` object.
5094250985
properties:
@@ -61130,6 +61173,26 @@ paths:
6113061173
permissions:
6113161174
- apm_retention_filter_write
6113261175
- apm_pipelines_write
61176+
/api/v2/apm/services:
61177+
get:
61178+
operationId: GetServiceList
61179+
responses:
61180+
'200':
61181+
content:
61182+
application/json:
61183+
schema:
61184+
$ref: '#/components/schemas/ServiceList'
61185+
description: OK
61186+
'429':
61187+
$ref: '#/components/responses/TooManyRequestsResponse'
61188+
security:
61189+
- apiKeyAuth: []
61190+
appKeyAuth: []
61191+
- AuthZ:
61192+
- apm_read
61193+
summary: Get service list
61194+
tags:
61195+
- Apm
6113361196
/api/v2/app-builder/apps:
6113461197
delete:
6113561198
description: Delete multiple apps in a single request from a list of app IDs.
@@ -87764,6 +87827,8 @@ tags:
8776487827
offers also Sensitive Data Scanning capabilities on your storage.\nGo to https://www.datadoghq.com/blog/agentless-scanning/
8776587828
to learn more."
8776687829
name: Agentless Scanning
87830+
- description: Auto-generated tag Apm
87831+
name: Apm
8776787832
- description: Datadog App Builder provides a low-code solution to rapidly develop
8776887833
and integrate secure, customized applications into your monitoring stack that
8776987834
are built to accelerate remediation at scale. These API endpoints allow you to

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@endpoint(apm) @endpoint(apm-v2)
2+
Feature: Apm
3+
Auto-generated tag Apm
4+
5+
@generated @skip @team:DataDog/apm-aoe
6+
Scenario: Get service list returns "OK" response
7+
Given a valid "apiKeyAuth" key in the system
8+
And a valid "appKeyAuth" key in the system
9+
And an instance of "Apm" API
10+
And new "GetServiceList" request
11+
When the request is sent
12+
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
@@ -72,6 +72,8 @@ export {
7272
AgentlessScanningApi,
7373
} from "./apis/AgentlessScanningApi";
7474

75+
export { ApmApi } from "./apis/ApmApi";
76+
7577
export {
7678
AppBuilderApiCreateAppRequest,
7779
AppBuilderApiDeleteAppRequest,
@@ -4142,6 +4144,11 @@ export { ServiceDefinitionV2Repo } from "./models/ServiceDefinitionV2Repo";
41424144
export { ServiceDefinitionV2Slack } from "./models/ServiceDefinitionV2Slack";
41434145
export { ServiceDefinitionV2SlackType } from "./models/ServiceDefinitionV2SlackType";
41444146
export { ServiceDefinitionV2Version } from "./models/ServiceDefinitionV2Version";
4147+
export { ServiceList } from "./models/ServiceList";
4148+
export { ServiceListData } from "./models/ServiceListData";
4149+
export { ServiceListDataAttributes } from "./models/ServiceListDataAttributes";
4150+
export { ServiceListDataAttributesMetadataItems } from "./models/ServiceListDataAttributesMetadataItems";
4151+
export { ServiceListDataType } from "./models/ServiceListDataType";
41454152
export { ServiceNowBasicAuth } from "./models/ServiceNowBasicAuth";
41464153
export { ServiceNowBasicAuthType } from "./models/ServiceNowBasicAuthType";
41474154
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
@@ -2389,6 +2389,10 @@ import { ServiceDefinitionV2Opsgenie } from "./ServiceDefinitionV2Opsgenie";
23892389
import { ServiceDefinitionV2Repo } from "./ServiceDefinitionV2Repo";
23902390
import { ServiceDefinitionV2Slack } from "./ServiceDefinitionV2Slack";
23912391
import { ServiceDefinitionsListResponse } from "./ServiceDefinitionsListResponse";
2392+
import { ServiceList } from "./ServiceList";
2393+
import { ServiceListData } from "./ServiceListData";
2394+
import { ServiceListDataAttributes } from "./ServiceListDataAttributes";
2395+
import { ServiceListDataAttributesMetadataItems } from "./ServiceListDataAttributesMetadataItems";
23922396
import { ServiceNowBasicAuth } from "./ServiceNowBasicAuth";
23932397
import { ServiceNowBasicAuthUpdate } from "./ServiceNowBasicAuthUpdate";
23942398
import { ServiceNowIntegration } from "./ServiceNowIntegration";
@@ -4166,6 +4170,7 @@ const enumsMap: { [key: string]: any[] } = {
41664170
ServiceDefinitionV2OpsgenieRegion: ["US", "EU"],
41674171
ServiceDefinitionV2SlackType: ["slack"],
41684172
ServiceDefinitionV2Version: ["v2"],
4173+
ServiceListDataType: ["services_list"],
41694174
ServiceNowBasicAuthType: ["ServiceNowBasicAuth"],
41704175
ServiceNowIntegrationType: ["ServiceNow"],
41714176
ShiftDataRelationshipsUserDataType: ["users"],
@@ -7244,6 +7249,11 @@ const typeMap: { [index: string]: any } = {
72447249
ServiceDefinitionV2Repo: ServiceDefinitionV2Repo,
72457250
ServiceDefinitionV2Slack: ServiceDefinitionV2Slack,
72467251
ServiceDefinitionsListResponse: ServiceDefinitionsListResponse,
7252+
ServiceList: ServiceList,
7253+
ServiceListData: ServiceListData,
7254+
ServiceListDataAttributes: ServiceListDataAttributes,
7255+
ServiceListDataAttributesMetadataItems:
7256+
ServiceListDataAttributesMetadataItems,
72477257
ServiceNowBasicAuth: ServiceNowBasicAuth,
72487258
ServiceNowBasicAuthUpdate: ServiceNowBasicAuthUpdate,
72497259
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)