From b1e58961f25be1644fd7950a1928e0562dcc00c5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 28 Nov 2025 09:25:01 +0000 Subject: [PATCH] Regenerate client from commit 02228bc of spec repo --- .generator/schemas/v2/openapi.yaml | 131 +++++++++++--- .../frozen.json | 1 + .../recording.har | 57 ++++++ .../frozen.json | 1 + .../recording.har | 147 +++++++++++++++ features/v2/security_monitoring.feature | 15 ++ features/v2/undo.json | 6 + .../src/support/scenarios_model_mapping.ts | 15 ++ .../src/v2/SecurityMonitoringApi.ts | 169 ++++++++++++++++++ services/security_monitoring/src/v2/index.ts | 10 +- .../GetSuppressionVersionHistoryData.ts | 63 +++++++ .../GetSuppressionVersionHistoryDataType.ts | 9 + .../GetSuppressionVersionHistoryResponse.ts | 46 +++++ .../src/v2/models/RuleVersions.ts | 6 +- .../v2/models/SuppressionVersionHistory.ts | 55 ++++++ .../src/v2/models/SuppressionVersions.ts | 55 ++++++ .../src/v2/models/TypingInfo.ts | 15 +- ...rsionUpdate.ts => VersionHistoryUpdate.ts} | 10 +- ...ateType.ts => VersionHistoryUpdateType.ts} | 2 +- 19 files changed, 773 insertions(+), 40 deletions(-) create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/recording.har create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/recording.har create mode 100644 services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryData.ts create mode 100644 services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryDataType.ts create mode 100644 services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryResponse.ts create mode 100644 services/security_monitoring/src/v2/models/SuppressionVersionHistory.ts create mode 100644 services/security_monitoring/src/v2/models/SuppressionVersions.ts rename services/security_monitoring/src/v2/models/{RuleVersionUpdate.ts => VersionHistoryUpdate.ts} (81%) rename services/security_monitoring/src/v2/models/{RuleVersionUpdateType.ts => VersionHistoryUpdateType.ts} (87%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496a..526df34c7132 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23526,6 +23526,30 @@ components: required: - data type: object + GetSuppressionVersionHistoryData: + description: Data for the suppression version history. + properties: + attributes: + $ref: '#/components/schemas/SuppressionVersionHistory' + id: + description: ID of the suppression. + type: string + type: + $ref: '#/components/schemas/GetSuppressionVersionHistoryDataType' + type: object + GetSuppressionVersionHistoryDataType: + description: Type of data. + enum: + - suppression_version_history + type: string + x-enum-varnames: + - SUPPRESSIONVERSIONHISTORY + GetSuppressionVersionHistoryResponse: + description: Response for getting the suppression version history. + properties: + data: + $ref: '#/components/schemas/GetSuppressionVersionHistoryData' + type: object GetTeamMembershipsSort: description: Specifies the order of returned team memberships enum: @@ -42745,38 +42769,13 @@ components: description: The `RuleVersionHistory` `data`. type: object type: object - RuleVersionUpdate: - description: A change in a rule version. - properties: - change: - description: The new value of the field. - example: cloud_provider:aws - type: string - field: - description: The field that was changed. - example: Tags - type: string - type: - $ref: '#/components/schemas/RuleVersionUpdateType' - type: object - RuleVersionUpdateType: - description: The type of change. - enum: - - create - - update - - delete - type: string - x-enum-varnames: - - CREATE - - UPDATE - - DELETE RuleVersions: description: A rule version with a list of updates. properties: changes: description: A list of changes. items: - $ref: '#/components/schemas/RuleVersionUpdate' + $ref: '#/components/schemas/VersionHistoryUpdate' type: array rule: $ref: '#/components/schemas/SecurityMonitoringRuleResponse' @@ -51322,6 +51321,32 @@ components: format: double type: number type: object + SuppressionVersionHistory: + description: Response object containing the version history of a suppression. + properties: + count: + description: The number of suppression versions. + format: int32 + maximum: 2147483647 + type: integer + data: + additionalProperties: + $ref: '#/components/schemas/SuppressionVersions' + description: A suppression version with a list of updates. + description: The version history of a suppression. + type: object + type: object + SuppressionVersions: + description: A suppression version with a list of updates. + properties: + changes: + description: A list of changes. + items: + $ref: '#/components/schemas/VersionHistoryUpdate' + type: array + suppression: + $ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes' + type: object TableResultV2: description: A reference table resource containing its full configuration and state. @@ -55372,6 +55397,31 @@ components: example: 1 format: int64 type: integer + VersionHistoryUpdate: + description: A change in a rule version. + properties: + change: + description: The new value of the field. + example: cloud_provider:aws + type: string + field: + description: The field that was changed. + example: Tags + type: string + type: + $ref: '#/components/schemas/VersionHistoryUpdateType' + type: object + VersionHistoryUpdateType: + description: The type of change. + enum: + - create + - update + - delete + type: string + x-enum-varnames: + - CREATE + - UPDATE + - DELETE VirusTotalAPIKey: description: The definition of the `VirusTotalAPIKey` object. properties: @@ -79065,6 +79115,35 @@ paths: summary: Update a suppression rule tags: - Security Monitoring + /api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history: + get: + description: Get a suppression's version history. + operationId: GetSuppressionVersionHistory + parameters: + - $ref: '#/components/parameters/SecurityMonitoringSuppressionID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetSuppressionVersionHistoryResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_suppressions_read + summary: Get a suppression's version history + tags: + - Security Monitoring /api/v2/security_monitoring/rules: get: description: List rules. diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/frozen.json new file mode 100644 index 000000000000..4d17203c8eaa --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/frozen.json @@ -0,0 +1 @@ +"2025-11-26T13:33:06.081Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/recording.har new file mode 100644 index 000000000000..1c238f8ebe00 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-Not-Found-response_2375635544/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Security Monitoring/Get a suppression's version history returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "067902bf242bca67ee75a242d0407d88", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 591, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/this-does-not-exist/version_history" + }, + "response": { + "bodySize": 75, + "content": { + "mimeType": "application/json", + "size": 75, + "text": "{\"errors\":[\"not_found(Suppression with ID this-does-not-exist not found)\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 653, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-26T13:33:06.084Z", + "time": 392 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/frozen.json new file mode 100644 index 000000000000..33af79624fd7 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/frozen.json @@ -0,0 +1 @@ +"2025-11-26T13:33:06.482Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/recording.har new file mode 100644 index 000000000000..3d85fb34d11f --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-suppression-s-version-history-returns-OK-response_2747033323/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Security Monitoring/Get a suppression's version history returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e4ecf284d916cf587572d0e822e67625", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 354, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"description\":\"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986\",\"enabled\":true,\"name\":\"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"technique:T1110-brute-force\",\"source:cloudtrail\"]},\"type\":\"suppressions\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions" + }, + "response": { + "bodySize": 597, + "content": { + "mimeType": "application/vnd.api+json", + "size": 597, + "text": "{\"data\":{\"id\":\"456-piv-74h\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1764163986851,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"},\"data_exclusion_query\":\"\",\"description\":\"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986\",\"editable\":true,\"enabled\":true,\"name\":\"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1764163986851,\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"},\"version\":1}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 662, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-26T13:33:06.484Z", + "time": 423 + }, + { + "_id": "14bae097aa0ac3473396bfa6a75aef1b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 583, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/456-piv-74h/version_history" + }, + "response": { + "bodySize": 685, + "content": { + "mimeType": "application/vnd.api+json", + "size": 685, + "text": "{\"data\":{\"id\":\"456-piv-74h\",\"type\":\"suppression_version_history\",\"attributes\":{\"count\":1,\"data\":{\"1\":{\"suppression\":{\"id\":\"456-piv-74h\",\"name\":\"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986\",\"enabled\":true,\"description\":\"Test-Get_a_suppression_s_version_history_returns_OK_response-1764163986\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"data_exclusion_query\":\"\",\"version\":1,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"},\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"},\"creation_date\":1764163986851,\"update_date\":1764163986851,\"editable\":true,\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"]},\"changes\":[]}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 662, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-26T13:33:06.913Z", + "time": 447 + }, + { + "_id": "3cca0e33ca7078cd461f84eae086ab5d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 564, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/456-piv-74h" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 601, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-26T13:33:07.363Z", + "time": 410 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 531c84c19c11..578e8d28e541 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -833,6 +833,21 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" has the same value as "suppression.data.attributes.rule_query" And the response "data.attributes.suppression_query" is equal to "env:test" + @team:DataDog/k9-cloud-security-platform + Scenario: Get a suppression's version history returns "Not Found" response + Given new "GetSuppressionVersionHistory" request + And request contains "suppression_id" parameter with value "this-does-not-exist" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-cloud-security-platform + Scenario: Get a suppression's version history returns "OK" response + Given new "GetSuppressionVersionHistory" request + And there is a valid "suppression" in the system + And request contains "suppression_id" parameter from "suppression.data.id" + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Get all security filters returns "OK" response Given new "ListSecurityFilters" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 3799e64e630d..67b48870c47c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3830,6 +3830,12 @@ "type": "idempotent" } }, + "GetSuppressionVersionHistory": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index a918b3e7a5c9..534739c661ec 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -4358,6 +4358,21 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "SecurityMonitoringSuppressionResponse", }, + "SecurityMonitoringApi.V2.GetSuppressionVersionHistory": { + suppressionId: { + type: "string", + format: "", + }, + pageSize: { + type: "number", + format: "int64", + }, + pageNumber: { + type: "number", + format: "int64", + }, + operationResponseType: "GetSuppressionVersionHistoryResponse", + }, "SecurityMonitoringApi.V2.ListSecurityMonitoringRules": { pageSize: { type: "number", diff --git a/services/security_monitoring/src/v2/SecurityMonitoringApi.ts b/services/security_monitoring/src/v2/SecurityMonitoringApi.ts index 5cf737ad0065..a52ceda01e82 100644 --- a/services/security_monitoring/src/v2/SecurityMonitoringApi.ts +++ b/services/security_monitoring/src/v2/SecurityMonitoringApi.ts @@ -43,6 +43,7 @@ import { GetMultipleRulesetsResponse } from "./models/GetMultipleRulesetsRespons import { GetResourceEvaluationFiltersResponse } from "./models/GetResourceEvaluationFiltersResponse"; import { GetRuleVersionHistoryResponse } from "./models/GetRuleVersionHistoryResponse"; import { GetSBOMResponse } from "./models/GetSBOMResponse"; +import { GetSuppressionVersionHistoryResponse } from "./models/GetSuppressionVersionHistoryResponse"; import { JobCreateResponse } from "./models/JobCreateResponse"; import { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; import { ListAssetsSBOMsResponse } from "./models/ListAssetsSBOMsResponse"; @@ -2078,6 +2079,70 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getSuppressionVersionHistory( + suppressionId: string, + pageSize?: number, + pageNumber?: number, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'suppressionId' is not null or undefined + if (suppressionId === null || suppressionId === undefined) { + throw new RequiredError("suppressionId", "getSuppressionVersionHistory"); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history".replace( + "{suppression_id}", + encodeURIComponent(String(suppressionId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SecurityMonitoringApi.v2.getSuppressionVersionHistory", + SecurityMonitoringApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + serialize(pageSize, TypingInfo, "number", "int64"), + "", + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + serialize(pageNumber, TypingInfo, "number", "int64"), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getThreatHuntingJob( jobId: string, _options?: Configuration, @@ -6624,6 +6689,66 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getSuppressionVersionHistory + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSuppressionVersionHistory( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GetSuppressionVersionHistoryResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GetSuppressionVersionHistoryResponse", + ) as GetSuppressionVersionHistoryResponse; + return body; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GetSuppressionVersionHistoryResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GetSuppressionVersionHistoryResponse", + "", + ) as GetSuppressionVersionHistoryResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -8900,6 +9025,24 @@ export interface SecurityMonitoringApiGetSuppressionsAffectingRuleRequest { ruleId: string; } +export interface SecurityMonitoringApiGetSuppressionVersionHistoryRequest { + /** + * The ID of the suppression rule + * @type string + */ + suppressionId: string; + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; +} + export interface SecurityMonitoringApiGetThreatHuntingJobRequest { /** * The ID of the job. @@ -10499,6 +10642,32 @@ export class SecurityMonitoringApi { }); } + /** + * Get a suppression's version history. + * @param param The request object + */ + public getSuppressionVersionHistory( + param: SecurityMonitoringApiGetSuppressionVersionHistoryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.getSuppressionVersionHistory( + param.suppressionId, + param.pageSize, + param.pageNumber, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getSuppressionVersionHistory( + responseContext, + ); + }); + }); + } + /** * Get a job's details. * @param param The request object diff --git a/services/security_monitoring/src/v2/index.ts b/services/security_monitoring/src/v2/index.ts index 02b7c5eb25c3..39f3bd2380ed 100644 --- a/services/security_monitoring/src/v2/index.ts +++ b/services/security_monitoring/src/v2/index.ts @@ -31,6 +31,7 @@ export { SecurityMonitoringApiGetSecurityMonitoringSignalRequest, SecurityMonitoringApiGetSecurityMonitoringSuppressionRequest, SecurityMonitoringApiGetSignalNotificationRuleRequest, + SecurityMonitoringApiGetSuppressionVersionHistoryRequest, SecurityMonitoringApiGetSuppressionsAffectingFutureRuleRequest, SecurityMonitoringApiGetSuppressionsAffectingRuleRequest, SecurityMonitoringApiGetThreatHuntingJobRequest, @@ -152,6 +153,9 @@ export { GetRuleVersionHistoryData } from "./models/GetRuleVersionHistoryData"; export { GetRuleVersionHistoryDataType } from "./models/GetRuleVersionHistoryDataType"; export { GetRuleVersionHistoryResponse } from "./models/GetRuleVersionHistoryResponse"; export { GetSBOMResponse } from "./models/GetSBOMResponse"; +export { GetSuppressionVersionHistoryData } from "./models/GetSuppressionVersionHistoryData"; +export { GetSuppressionVersionHistoryDataType } from "./models/GetSuppressionVersionHistoryDataType"; +export { GetSuppressionVersionHistoryResponse } from "./models/GetSuppressionVersionHistoryResponse"; export { JobCreateResponse } from "./models/JobCreateResponse"; export { JobCreateResponseData } from "./models/JobCreateResponseData"; export { JobDefinition } from "./models/JobDefinition"; @@ -187,8 +191,6 @@ export { RuleTypesItems } from "./models/RuleTypesItems"; export { RuleUser } from "./models/RuleUser"; export { RuleVersionHistory } from "./models/RuleVersionHistory"; export { RuleVersions } from "./models/RuleVersions"; -export { RuleVersionUpdate } from "./models/RuleVersionUpdate"; -export { RuleVersionUpdateType } from "./models/RuleVersionUpdateType"; export { RunThreatHuntingJobRequest } from "./models/RunThreatHuntingJobRequest"; export { RunThreatHuntingJobRequestAttributes } from "./models/RunThreatHuntingJobRequestAttributes"; export { RunThreatHuntingJobRequestData } from "./models/RunThreatHuntingJobRequestData"; @@ -336,6 +338,8 @@ export { SecurityMonitoringTriageUser } from "./models/SecurityMonitoringTriageU export { SecurityMonitoringUser } from "./models/SecurityMonitoringUser"; export { Selectors } from "./models/Selectors"; export { SpecVersion } from "./models/SpecVersion"; +export { SuppressionVersionHistory } from "./models/SuppressionVersionHistory"; +export { SuppressionVersions } from "./models/SuppressionVersions"; export { ThreatHuntingJobDataType } from "./models/ThreatHuntingJobDataType"; export { ThreatHuntingJobListMeta } from "./models/ThreatHuntingJobListMeta"; export { ThreatHuntingJobOptions } from "./models/ThreatHuntingJobOptions"; @@ -350,6 +354,8 @@ export { UpdateResourceEvaluationFiltersRequest } from "./models/UpdateResourceE export { UpdateResourceEvaluationFiltersRequestData } from "./models/UpdateResourceEvaluationFiltersRequestData"; export { UpdateResourceEvaluationFiltersResponse } from "./models/UpdateResourceEvaluationFiltersResponse"; export { UpdateResourceEvaluationFiltersResponseData } from "./models/UpdateResourceEvaluationFiltersResponseData"; +export { VersionHistoryUpdate } from "./models/VersionHistoryUpdate"; +export { VersionHistoryUpdateType } from "./models/VersionHistoryUpdateType"; export { VulnerabilitiesType } from "./models/VulnerabilitiesType"; export { Vulnerability } from "./models/Vulnerability"; export { VulnerabilityAdvisory } from "./models/VulnerabilityAdvisory"; diff --git a/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryData.ts b/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryData.ts new file mode 100644 index 000000000000..13ba417d6cbf --- /dev/null +++ b/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryData.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetSuppressionVersionHistoryDataType } from "./GetSuppressionVersionHistoryDataType"; +import { SuppressionVersionHistory } from "./SuppressionVersionHistory"; + +/** + * Data for the suppression version history. + */ +export class GetSuppressionVersionHistoryData { + /** + * Response object containing the version history of a suppression. + */ + "attributes"?: SuppressionVersionHistory; + /** + * ID of the suppression. + */ + "id"?: string; + /** + * Type of data. + */ + "type"?: GetSuppressionVersionHistoryDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SuppressionVersionHistory", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GetSuppressionVersionHistoryDataType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetSuppressionVersionHistoryData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryDataType.ts b/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryDataType.ts new file mode 100644 index 000000000000..48683eed7ccf --- /dev/null +++ b/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryDataType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of data. + */ +export type GetSuppressionVersionHistoryDataType = + | typeof SUPPRESSIONVERSIONHISTORY + | UnparsedObject; +export const SUPPRESSIONVERSIONHISTORY = "suppression_version_history"; diff --git a/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryResponse.ts b/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryResponse.ts new file mode 100644 index 000000000000..85c5247185ce --- /dev/null +++ b/services/security_monitoring/src/v2/models/GetSuppressionVersionHistoryResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetSuppressionVersionHistoryData } from "./GetSuppressionVersionHistoryData"; + +/** + * Response for getting the suppression version history. + */ +export class GetSuppressionVersionHistoryResponse { + /** + * Data for the suppression version history. + */ + "data"?: GetSuppressionVersionHistoryData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GetSuppressionVersionHistoryData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetSuppressionVersionHistoryResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/RuleVersions.ts b/services/security_monitoring/src/v2/models/RuleVersions.ts index fed972618f27..df48e930c195 100644 --- a/services/security_monitoring/src/v2/models/RuleVersions.ts +++ b/services/security_monitoring/src/v2/models/RuleVersions.ts @@ -1,7 +1,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; -import { RuleVersionUpdate } from "./RuleVersionUpdate"; import { SecurityMonitoringRuleResponse } from "./SecurityMonitoringRuleResponse"; +import { VersionHistoryUpdate } from "./VersionHistoryUpdate"; /** * A rule version with a list of updates. @@ -10,7 +10,7 @@ export class RuleVersions { /** * A list of changes. */ - "changes"?: Array; + "changes"?: Array; /** * Create a new rule. */ @@ -32,7 +32,7 @@ export class RuleVersions { static readonly attributeTypeMap: AttributeTypeMap = { changes: { baseName: "changes", - type: "Array", + type: "Array", }, rule: { baseName: "rule", diff --git a/services/security_monitoring/src/v2/models/SuppressionVersionHistory.ts b/services/security_monitoring/src/v2/models/SuppressionVersionHistory.ts new file mode 100644 index 000000000000..e4ecdf17c5fd --- /dev/null +++ b/services/security_monitoring/src/v2/models/SuppressionVersionHistory.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SuppressionVersions } from "./SuppressionVersions"; + +/** + * Response object containing the version history of a suppression. + */ +export class SuppressionVersionHistory { + /** + * The number of suppression versions. + */ + "count"?: number; + /** + * The version history of a suppression. + */ + "data"?: { [key: string]: SuppressionVersions }; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + count: { + baseName: "count", + type: "number", + format: "int32", + }, + data: { + baseName: "data", + type: "{ [key: string]: SuppressionVersions; }", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuppressionVersionHistory.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/SuppressionVersions.ts b/services/security_monitoring/src/v2/models/SuppressionVersions.ts new file mode 100644 index 000000000000..838c81d64c1b --- /dev/null +++ b/services/security_monitoring/src/v2/models/SuppressionVersions.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SecurityMonitoringSuppressionAttributes } from "./SecurityMonitoringSuppressionAttributes"; +import { VersionHistoryUpdate } from "./VersionHistoryUpdate"; + +/** + * A suppression version with a list of updates. + */ +export class SuppressionVersions { + /** + * A list of changes. + */ + "changes"?: Array; + /** + * The attributes of the suppression rule. + */ + "suppression"?: SecurityMonitoringSuppressionAttributes; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changes: { + baseName: "changes", + type: "Array", + }, + suppression: { + baseName: "suppression", + type: "SecurityMonitoringSuppressionAttributes", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuppressionVersions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/TypingInfo.ts b/services/security_monitoring/src/v2/models/TypingInfo.ts index 415024d2cbba..36059822454f 100644 --- a/services/security_monitoring/src/v2/models/TypingInfo.ts +++ b/services/security_monitoring/src/v2/models/TypingInfo.ts @@ -71,6 +71,8 @@ import { GetResourceEvaluationFiltersResponseData } from "./GetResourceEvaluatio import { GetRuleVersionHistoryData } from "./GetRuleVersionHistoryData"; import { GetRuleVersionHistoryResponse } from "./GetRuleVersionHistoryResponse"; import { GetSBOMResponse } from "./GetSBOMResponse"; +import { GetSuppressionVersionHistoryData } from "./GetSuppressionVersionHistoryData"; +import { GetSuppressionVersionHistoryResponse } from "./GetSuppressionVersionHistoryResponse"; import { JSONAPIErrorItem } from "./JSONAPIErrorItem"; import { JSONAPIErrorItemSource } from "./JSONAPIErrorItemSource"; import { JSONAPIErrorResponse } from "./JSONAPIErrorResponse"; @@ -101,7 +103,6 @@ import { ResourceFilterAttributes } from "./ResourceFilterAttributes"; import { ResponseMetaAttributes } from "./ResponseMetaAttributes"; import { RuleUser } from "./RuleUser"; import { RuleVersionHistory } from "./RuleVersionHistory"; -import { RuleVersionUpdate } from "./RuleVersionUpdate"; import { RuleVersions } from "./RuleVersions"; import { RunThreatHuntingJobRequest } from "./RunThreatHuntingJobRequest"; import { RunThreatHuntingJobRequestAttributes } from "./RunThreatHuntingJobRequestAttributes"; @@ -210,6 +211,8 @@ import { SecurityMonitoringThirdPartyRuleCaseCreate } from "./SecurityMonitoring import { SecurityMonitoringTriageUser } from "./SecurityMonitoringTriageUser"; import { SecurityMonitoringUser } from "./SecurityMonitoringUser"; import { Selectors } from "./Selectors"; +import { SuppressionVersionHistory } from "./SuppressionVersionHistory"; +import { SuppressionVersions } from "./SuppressionVersions"; import { ThreatHuntingJobListMeta } from "./ThreatHuntingJobListMeta"; import { ThreatHuntingJobOptions } from "./ThreatHuntingJobOptions"; import { ThreatHuntingJobQuery } from "./ThreatHuntingJobQuery"; @@ -222,6 +225,7 @@ import { UpdateResourceEvaluationFiltersRequest } from "./UpdateResourceEvaluati import { UpdateResourceEvaluationFiltersRequestData } from "./UpdateResourceEvaluationFiltersRequestData"; import { UpdateResourceEvaluationFiltersResponse } from "./UpdateResourceEvaluationFiltersResponse"; import { UpdateResourceEvaluationFiltersResponseData } from "./UpdateResourceEvaluationFiltersResponseData"; +import { VersionHistoryUpdate } from "./VersionHistoryUpdate"; import { Vulnerability } from "./Vulnerability"; import { VulnerabilityAdvisory } from "./VulnerabilityAdvisory"; import { VulnerabilityAttributes } from "./VulnerabilityAttributes"; @@ -270,6 +274,7 @@ export const TypingInfo: ModelTypingInfo = { ], GetMultipleRulesetsResponseDataType: ["get_multiple_rulesets_response"], GetRuleVersionHistoryDataType: ["GetRuleVersionHistoryResponse"], + GetSuppressionVersionHistoryDataType: ["suppression_version_history"], NotificationRulesType: ["notification_rules"], ResourceFilterRequestType: ["csm_resource_filter"], RuleSeverity: ["critical", "high", "medium", "low", "unknown", "info"], @@ -290,7 +295,6 @@ export const TypingInfo: ModelTypingInfo = { "host_vulnerability", "iac_misconfiguration", ], - RuleVersionUpdateType: ["create", "update", "delete"], RunThreatHuntingJobRequestDataType: ["historicalDetectionsJobCreate"], SBOMComponentLicenseType: [ "network_strong_copyleft", @@ -418,6 +422,7 @@ export const TypingInfo: ModelTypingInfo = { SpecVersion: ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5"], ThreatHuntingJobDataType: ["historicalDetectionsJob"], TriggerSource: ["security_findings", "security_signals"], + VersionHistoryUpdateType: ["create", "update", "delete"], VulnerabilitiesType: ["vulnerabilities"], VulnerabilityEcosystem: [ "PyPI", @@ -605,6 +610,8 @@ export const TypingInfo: ModelTypingInfo = { GetRuleVersionHistoryData: GetRuleVersionHistoryData, GetRuleVersionHistoryResponse: GetRuleVersionHistoryResponse, GetSBOMResponse: GetSBOMResponse, + GetSuppressionVersionHistoryData: GetSuppressionVersionHistoryData, + GetSuppressionVersionHistoryResponse: GetSuppressionVersionHistoryResponse, JSONAPIErrorItem: JSONAPIErrorItem, JSONAPIErrorItemSource: JSONAPIErrorItemSource, JSONAPIErrorResponse: JSONAPIErrorResponse, @@ -636,7 +643,6 @@ export const TypingInfo: ModelTypingInfo = { ResponseMetaAttributes: ResponseMetaAttributes, RuleUser: RuleUser, RuleVersionHistory: RuleVersionHistory, - RuleVersionUpdate: RuleVersionUpdate, RuleVersions: RuleVersions, RunThreatHuntingJobRequest: RunThreatHuntingJobRequest, RunThreatHuntingJobRequestAttributes: RunThreatHuntingJobRequestAttributes, @@ -793,6 +799,8 @@ export const TypingInfo: ModelTypingInfo = { SecurityMonitoringTriageUser: SecurityMonitoringTriageUser, SecurityMonitoringUser: SecurityMonitoringUser, Selectors: Selectors, + SuppressionVersionHistory: SuppressionVersionHistory, + SuppressionVersions: SuppressionVersions, ThreatHuntingJobListMeta: ThreatHuntingJobListMeta, ThreatHuntingJobOptions: ThreatHuntingJobOptions, ThreatHuntingJobQuery: ThreatHuntingJobQuery, @@ -809,6 +817,7 @@ export const TypingInfo: ModelTypingInfo = { UpdateResourceEvaluationFiltersResponse, UpdateResourceEvaluationFiltersResponseData: UpdateResourceEvaluationFiltersResponseData, + VersionHistoryUpdate: VersionHistoryUpdate, Vulnerability: Vulnerability, VulnerabilityAdvisory: VulnerabilityAdvisory, VulnerabilityAttributes: VulnerabilityAttributes, diff --git a/services/security_monitoring/src/v2/models/RuleVersionUpdate.ts b/services/security_monitoring/src/v2/models/VersionHistoryUpdate.ts similarity index 81% rename from services/security_monitoring/src/v2/models/RuleVersionUpdate.ts rename to services/security_monitoring/src/v2/models/VersionHistoryUpdate.ts index 6702dd230bf5..7b31f974ba51 100644 --- a/services/security_monitoring/src/v2/models/RuleVersionUpdate.ts +++ b/services/security_monitoring/src/v2/models/VersionHistoryUpdate.ts @@ -1,11 +1,11 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; -import { RuleVersionUpdateType } from "./RuleVersionUpdateType"; +import { VersionHistoryUpdateType } from "./VersionHistoryUpdateType"; /** * A change in a rule version. */ -export class RuleVersionUpdate { +export class VersionHistoryUpdate { /** * The new value of the field. */ @@ -17,7 +17,7 @@ export class RuleVersionUpdate { /** * The type of change. */ - "type"?: RuleVersionUpdateType; + "type"?: VersionHistoryUpdateType; /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -43,7 +43,7 @@ export class RuleVersionUpdate { }, type: { baseName: "type", - type: "RuleVersionUpdateType", + type: "VersionHistoryUpdateType", }, additionalProperties: { baseName: "additionalProperties", @@ -55,7 +55,7 @@ export class RuleVersionUpdate { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return RuleVersionUpdate.attributeTypeMap; + return VersionHistoryUpdate.attributeTypeMap; } public constructor() {} diff --git a/services/security_monitoring/src/v2/models/RuleVersionUpdateType.ts b/services/security_monitoring/src/v2/models/VersionHistoryUpdateType.ts similarity index 87% rename from services/security_monitoring/src/v2/models/RuleVersionUpdateType.ts rename to services/security_monitoring/src/v2/models/VersionHistoryUpdateType.ts index e3cc0aa5d7e5..52909875a899 100644 --- a/services/security_monitoring/src/v2/models/RuleVersionUpdateType.ts +++ b/services/security_monitoring/src/v2/models/VersionHistoryUpdateType.ts @@ -3,7 +3,7 @@ import { UnparsedObject } from "@datadog/datadog-api-client"; /** * The type of change. */ -export type RuleVersionUpdateType = +export type VersionHistoryUpdateType = | typeof CREATE | typeof UPDATE | typeof DELETE