Skip to content

Commit 67dc404

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit af78fdc4 of spec repo (#848)
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 ec3150f commit 67dc404

File tree

11 files changed

+311
-4
lines changed

11 files changed

+311
-4
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.6.4",
7-
"regenerated": "2022-09-22 15:10:38.455972",
8-
"spec_repo_commit": "7f715655"
7+
"regenerated": "2022-09-26 07:51:10.791644",
8+
"spec_repo_commit": "af78fdc4"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-09-22 15:10:38.471408",
13-
"spec_repo_commit": "7f715655"
12+
"regenerated": "2022-09-26 07:51:10.803830",
13+
"spec_repo_commit": "af78fdc4"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12863,6 +12863,31 @@ paths:
1286312863
cursorPath: meta.page.after
1286412864
limitParam: body.page.limit
1286512865
resultsPath: data
12866+
/api/v2/security_monitoring/signals/{signal_id}:
12867+
get:
12868+
description: Get a signal's details.
12869+
operationId: GetSecurityMonitoringSignal
12870+
parameters:
12871+
- $ref: '#/components/parameters/SignalID'
12872+
responses:
12873+
'200':
12874+
content:
12875+
application/json:
12876+
schema:
12877+
$ref: '#/components/schemas/SecurityMonitoringSignal'
12878+
description: OK
12879+
'404':
12880+
$ref: '#/components/responses/NotFoundResponse'
12881+
'429':
12882+
$ref: '#/components/responses/TooManyRequestsResponse'
12883+
security:
12884+
- apiKeyAuth: []
12885+
appKeyAuth: []
12886+
- AuthZ:
12887+
- security_monitoring_rules_read
12888+
summary: Get a signal's details
12889+
tags:
12890+
- Security Monitoring
1286612891
/api/v2/security_monitoring/signals/{signal_id}/assignee:
1286712892
patch:
1286812893
description: Modify the triage assignee of a security signal.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-09-23T14:12:23.353Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/Get a signal's details returns \"Not Found\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "80586166ccca7aeabc4b8dc902a483fd",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 591,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [],
28+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/signals/AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptCL3QUEm3nt2"
29+
},
30+
"response": {
31+
"bodySize": 31,
32+
"content": {
33+
"mimeType": "application/json",
34+
"size": 31,
35+
"text": "{\"errors\":[\"Signal not found\"]}"
36+
},
37+
"cookies": [],
38+
"headers": [
39+
{
40+
"name": "content-type",
41+
"value": "application/json"
42+
}
43+
],
44+
"headersSize": 669,
45+
"httpVersion": "HTTP/1.1",
46+
"redirectURL": "",
47+
"status": 404,
48+
"statusText": "Not Found"
49+
},
50+
"startedDateTime": "2022-09-23T14:12:23.357Z",
51+
"time": 413
52+
}
53+
],
54+
"pages": [],
55+
"version": "1.2"
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-09-23T14:12:23.776Z"

cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/recording.har

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Get a signal's details 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.SecurityMonitoringApi(configuration);
9+
10+
const params: v2.SecurityMonitoringApiGetSecurityMonitoringSignalRequest = {
11+
signalId: "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE",
12+
};
13+
14+
apiInstance
15+
.getSecurityMonitoringSignal(params)
16+
.then((data: v2.SecurityMonitoringSignal) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));

features/v2/security_monitoring.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,20 @@ Feature: Security Monitoring
219219
When the request is sent
220220
Then the response status is 200 OK
221221

222+
@replay-only @team:DataDog/k9-cloud-security-platform
223+
Scenario: Get a signal's details returns "Not Found" response
224+
Given new "GetSecurityMonitoringSignal" request
225+
And request contains "signal_id" parameter with value "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptCL3QUEm3nt2"
226+
When the request is sent
227+
Then the response status is 404 Not Found
228+
229+
@replay-only @team:DataDog/k9-cloud-security-platform
230+
Scenario: Get a signal's details returns "OK" response
231+
Given new "GetSecurityMonitoringSignal" request
232+
And request contains "signal_id" parameter with value "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE"
233+
When the request is sent
234+
Then the response status is 200 OK
235+
222236
@team:DataDog/k9-cloud-security-platform
223237
Scenario: Get all security filters returns "OK" response
224238
Given new "ListSecurityFilters" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,12 @@
752752
"type": "safe"
753753
}
754754
},
755+
"GetSecurityMonitoringSignal": {
756+
"tag": "Security Monitoring",
757+
"undo": {
758+
"type": "safe"
759+
}
760+
},
755761
"EditSecurityMonitoringSignalAssignee": {
756762
"tag": "Security Monitoring",
757763
"undo": {

packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,44 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
462462
return requestContext;
463463
}
464464

465+
public async getSecurityMonitoringSignal(
466+
signalId: string,
467+
_options?: Configuration
468+
): Promise<RequestContext> {
469+
const _config = _options || this.configuration;
470+
471+
// verify required parameter 'signalId' is not null or undefined
472+
if (signalId === null || signalId === undefined) {
473+
throw new RequiredError(
474+
"Required parameter signalId was null or undefined when calling getSecurityMonitoringSignal."
475+
);
476+
}
477+
478+
// Path Params
479+
const localVarPath =
480+
"/api/v2/security_monitoring/signals/{signal_id}".replace(
481+
"{" + "signal_id" + "}",
482+
encodeURIComponent(String(signalId))
483+
);
484+
485+
// Make Request Context
486+
const requestContext = getServer(
487+
_config,
488+
"v2.SecurityMonitoringApi.getSecurityMonitoringSignal"
489+
).makeRequestContext(localVarPath, HttpMethod.GET);
490+
requestContext.setHeaderParam("Accept", "application/json");
491+
requestContext.setHttpConfig(_config.httpConfig);
492+
493+
// Apply auth methods
494+
applySecurityAuthentication(_config, requestContext, [
495+
"AuthZ",
496+
"apiKeyAuth",
497+
"appKeyAuth",
498+
]);
499+
500+
return requestContext;
501+
}
502+
465503
public async listSecurityFilters(
466504
_options?: Configuration
467505
): Promise<RequestContext> {
@@ -1307,6 +1345,63 @@ export class SecurityMonitoringApiResponseProcessor {
13071345
);
13081346
}
13091347

1348+
/**
1349+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
1350+
* to the expected objects
1351+
*
1352+
* @params response Response returned by the server for a request to getSecurityMonitoringSignal
1353+
* @throws ApiException if the response code was not in [200, 299]
1354+
*/
1355+
public async getSecurityMonitoringSignal(
1356+
response: ResponseContext
1357+
): Promise<SecurityMonitoringSignal> {
1358+
const contentType = ObjectSerializer.normalizeMediaType(
1359+
response.headers["content-type"]
1360+
);
1361+
if (response.httpStatusCode == 200) {
1362+
const body: SecurityMonitoringSignal = ObjectSerializer.deserialize(
1363+
ObjectSerializer.parse(await response.body.text(), contentType),
1364+
"SecurityMonitoringSignal"
1365+
) as SecurityMonitoringSignal;
1366+
return body;
1367+
}
1368+
if (response.httpStatusCode == 404 || response.httpStatusCode == 429) {
1369+
const bodyText = ObjectSerializer.parse(
1370+
await response.body.text(),
1371+
contentType
1372+
);
1373+
try {
1374+
const body: APIErrorResponse = ObjectSerializer.deserialize(
1375+
bodyText,
1376+
"APIErrorResponse"
1377+
) as APIErrorResponse;
1378+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
1379+
} catch (error) {
1380+
logger.info(`Got error deserializing error: ${error}`);
1381+
throw new ApiException<APIErrorResponse>(
1382+
response.httpStatusCode,
1383+
bodyText
1384+
);
1385+
}
1386+
}
1387+
1388+
// Work around for missing responses in specification, e.g. for petstore.yaml
1389+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1390+
const body: SecurityMonitoringSignal = ObjectSerializer.deserialize(
1391+
ObjectSerializer.parse(await response.body.text(), contentType),
1392+
"SecurityMonitoringSignal",
1393+
""
1394+
) as SecurityMonitoringSignal;
1395+
return body;
1396+
}
1397+
1398+
const body = (await response.body.text()) || "";
1399+
throw new ApiException<string>(
1400+
response.httpStatusCode,
1401+
'Unknown API Status Code!\nBody: "' + body + '"'
1402+
);
1403+
}
1404+
13101405
/**
13111406
* Unwraps the actual response sent by the server from the response context and deserializes the response content
13121407
* to the expected objects
@@ -1762,6 +1857,14 @@ export interface SecurityMonitoringApiGetSecurityMonitoringRuleRequest {
17621857
ruleId: string;
17631858
}
17641859

1860+
export interface SecurityMonitoringApiGetSecurityMonitoringSignalRequest {
1861+
/**
1862+
* The ID of the signal.
1863+
* @type string
1864+
*/
1865+
signalId: string;
1866+
}
1867+
17651868
export interface SecurityMonitoringApiListSecurityMonitoringRulesRequest {
17661869
/**
17671870
* Size for a given page.
@@ -2066,6 +2169,27 @@ export class SecurityMonitoringApi {
20662169
});
20672170
}
20682171

2172+
/**
2173+
* Get a signal's details.
2174+
* @param param The request object
2175+
*/
2176+
public getSecurityMonitoringSignal(
2177+
param: SecurityMonitoringApiGetSecurityMonitoringSignalRequest,
2178+
options?: Configuration
2179+
): Promise<SecurityMonitoringSignal> {
2180+
const requestContextPromise =
2181+
this.requestFactory.getSecurityMonitoringSignal(param.signalId, options);
2182+
return requestContextPromise.then((requestContext) => {
2183+
return this.configuration.httpApi
2184+
.send(requestContext)
2185+
.then((responseContext) => {
2186+
return this.responseProcessor.getSecurityMonitoringSignal(
2187+
responseContext
2188+
);
2189+
});
2190+
});
2191+
}
2192+
20692193
/**
20702194
* Get the list of configured security filters with their definitions.
20712195
* @param param The request object

0 commit comments

Comments
 (0)