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/examples/v2/security-monitoring/GetSuppressionVersionHistory.ts b/examples/v2/security-monitoring/GetSuppressionVersionHistory.ts new file mode 100644 index 000000000000..36f2bff4fd2f --- /dev/null +++ b/examples/v2/security-monitoring/GetSuppressionVersionHistory.ts @@ -0,0 +1,24 @@ +/** + * Get a suppression's version history returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "suppression" in the system +const SUPPRESSION_DATA_ID = process.env.SUPPRESSION_DATA_ID as string; + +const params: v2.SecurityMonitoringApiGetSuppressionVersionHistoryRequest = { + suppressionId: SUPPRESSION_DATA_ID, +}; + +apiInstance + .getSuppressionVersionHistory(params) + .then((data: v2.GetSuppressionVersionHistoryResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 7bfe6adf50be..c3980ac852b3 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -4348,6 +4348,21 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "SecurityMonitoringSuppressionResponse", }, + "v2.GetSuppressionVersionHistory": { + "suppressionId": { + "type": "string", + "format": "", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "GetSuppressionVersionHistoryResponse", + }, "v2.ListSecurityMonitoringRules": { "pageSize": { "type": "number", 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/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts index 162e70bb483e..3b914089309a 100644 --- a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts @@ -37,6 +37,7 @@ import { GetMultipleRulesetsResponse } from "../models/GetMultipleRulesetsRespon 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"; @@ -1688,6 +1689,59 @@ 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 requestContext = _config + .getServer("v2.SecurityMonitoringApi.getSuppressionVersionHistory") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getThreatHuntingJob( jobId: string, _options?: Configuration @@ -6048,6 +6102,70 @@ 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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: GetSuppressionVersionHistoryResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "GetSuppressionVersionHistoryResponse" + ) as GetSuppressionVersionHistoryResponse; + return body; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 @@ -8420,6 +8538,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. @@ -10016,6 +10152,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/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 00bee8317f47..d795993d73e2 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -742,6 +742,7 @@ export { SecurityMonitoringApiGetSecurityMonitoringSignalRequest, SecurityMonitoringApiGetSecurityMonitoringSuppressionRequest, SecurityMonitoringApiGetSignalNotificationRuleRequest, + SecurityMonitoringApiGetSuppressionVersionHistoryRequest, SecurityMonitoringApiGetSuppressionsAffectingFutureRuleRequest, SecurityMonitoringApiGetSuppressionsAffectingRuleRequest, SecurityMonitoringApiGetThreatHuntingJobRequest, @@ -2350,6 +2351,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 { GetTeamMembershipsSort } from "./models/GetTeamMembershipsSort"; export { GetWorkflowResponse } from "./models/GetWorkflowResponse"; export { GithubWebhookTrigger } from "./models/GithubWebhookTrigger"; @@ -3604,8 +3608,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 { RUMAggregateBucketValue } from "./models/RUMAggregateBucketValue"; export { RUMAggregateBucketValueTimeseriesPoint } from "./models/RUMAggregateBucketValueTimeseriesPoint"; export { RUMAggregateRequest } from "./models/RUMAggregateRequest"; @@ -4162,6 +4164,8 @@ export { StatsigIntegrationUpdate } from "./models/StatsigIntegrationUpdate"; export { Step } from "./models/Step"; export { StepDisplay } from "./models/StepDisplay"; export { StepDisplayBounds } from "./models/StepDisplayBounds"; +export { SuppressionVersionHistory } from "./models/SuppressionVersionHistory"; +export { SuppressionVersions } from "./models/SuppressionVersions"; export { TableResultV2 } from "./models/TableResultV2"; export { TableResultV2Array } from "./models/TableResultV2Array"; export { TableResultV2Data } from "./models/TableResultV2Data"; @@ -4431,6 +4435,8 @@ export { V2EventResponse } from "./models/V2EventResponse"; export { ValidationError } from "./models/ValidationError"; export { ValidationErrorMeta } from "./models/ValidationErrorMeta"; export { ValidationResponse } from "./models/ValidationResponse"; +export { VersionHistoryUpdate } from "./models/VersionHistoryUpdate"; +export { VersionHistoryUpdateType } from "./models/VersionHistoryUpdateType"; export { VirusTotalAPIKey } from "./models/VirusTotalAPIKey"; export { VirusTotalAPIKeyType } from "./models/VirusTotalAPIKeyType"; export { VirusTotalAPIKeyUpdate } from "./models/VirusTotalAPIKeyUpdate"; diff --git a/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryData.ts b/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryData.ts new file mode 100644 index 000000000000..2467b5fe4916 --- /dev/null +++ b/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryData.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { GetSuppressionVersionHistoryDataType } from "./GetSuppressionVersionHistoryDataType"; +import { SuppressionVersionHistory } from "./SuppressionVersionHistory"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryDataType.ts b/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryDataType.ts new file mode 100644 index 000000000000..dfd2a7757f46 --- /dev/null +++ b/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryDataType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of data. + */ + +export type GetSuppressionVersionHistoryDataType = + | typeof SUPPRESSIONVERSIONHISTORY + | UnparsedObject; +export const SUPPRESSIONVERSIONHISTORY = "suppression_version_history"; diff --git a/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryResponse.ts b/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryResponse.ts new file mode 100644 index 000000000000..240a7f9738d9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/GetSuppressionVersionHistoryResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { GetSuppressionVersionHistoryData } from "./GetSuppressionVersionHistoryData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index df5aaf40e489..f4341540093f 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -1071,6 +1071,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 { GetWorkflowResponse } from "./GetWorkflowResponse"; import { GithubWebhookTrigger } from "./GithubWebhookTrigger"; import { GithubWebhookTriggerWrapper } from "./GithubWebhookTriggerWrapper"; @@ -2007,7 +2009,6 @@ import { RuleAttributes } from "./RuleAttributes"; import { RuleOutcomeRelationships } from "./RuleOutcomeRelationships"; import { RuleUser } from "./RuleUser"; import { RuleVersionHistory } from "./RuleVersionHistory"; -import { RuleVersionUpdate } from "./RuleVersionUpdate"; import { RuleVersions } from "./RuleVersions"; import { RulesValidateQueryRequest } from "./RulesValidateQueryRequest"; import { RulesValidateQueryRequestData } from "./RulesValidateQueryRequestData"; @@ -2400,6 +2401,8 @@ import { StatsigIntegrationUpdate } from "./StatsigIntegrationUpdate"; import { Step } from "./Step"; import { StepDisplay } from "./StepDisplay"; import { StepDisplayBounds } from "./StepDisplayBounds"; +import { SuppressionVersionHistory } from "./SuppressionVersionHistory"; +import { SuppressionVersions } from "./SuppressionVersions"; import { TableResultV2 } from "./TableResultV2"; import { TableResultV2Array } from "./TableResultV2Array"; import { TableResultV2Data } from "./TableResultV2Data"; @@ -2608,6 +2611,7 @@ import { V2EventResponse } from "./V2EventResponse"; import { ValidationError } from "./ValidationError"; import { ValidationErrorMeta } from "./ValidationErrorMeta"; import { ValidationResponse } from "./ValidationResponse"; +import { VersionHistoryUpdate } from "./VersionHistoryUpdate"; import { VirusTotalAPIKey } from "./VirusTotalAPIKey"; import { VirusTotalAPIKeyUpdate } from "./VirusTotalAPIKeyUpdate"; import { VirusTotalIntegration } from "./VirusTotalIntegration"; @@ -3207,6 +3211,7 @@ const enumsMap: { [key: string]: any[] } = { ], GetMultipleRulesetsResponseDataType: ["get_multiple_rulesets_response"], GetRuleVersionHistoryDataType: ["GetRuleVersionHistoryResponse"], + GetSuppressionVersionHistoryDataType: ["suppression_version_history"], GetTeamMembershipsSort: [ "manager_name", "-manager_name", @@ -3834,7 +3839,6 @@ const enumsMap: { [key: string]: any[] } = { "host_vulnerability", "iac_misconfiguration", ], - RuleVersionUpdateType: ["create", "update", "delete"], RulesValidateQueryRequestDataType: ["validate_query"], RulesValidateQueryResponseDataType: ["validate_response"], RulesetRespDataType: ["ruleset"], @@ -4188,6 +4192,7 @@ const enumsMap: { [key: string]: any[] } = { UserTeamType: ["team_memberships"], UserTeamUserType: ["users"], UsersType: ["users"], + VersionHistoryUpdateType: ["create", "update", "delete"], VirusTotalAPIKeyType: ["VirusTotalAPIKey"], VirusTotalIntegrationType: ["VirusTotal"], VulnerabilitiesType: ["vulnerabilities"], @@ -5566,6 +5571,8 @@ const typeMap: { [index: string]: any } = { GetRuleVersionHistoryData: GetRuleVersionHistoryData, GetRuleVersionHistoryResponse: GetRuleVersionHistoryResponse, GetSBOMResponse: GetSBOMResponse, + GetSuppressionVersionHistoryData: GetSuppressionVersionHistoryData, + GetSuppressionVersionHistoryResponse: GetSuppressionVersionHistoryResponse, GetWorkflowResponse: GetWorkflowResponse, GithubWebhookTrigger: GithubWebhookTrigger, GithubWebhookTriggerWrapper: GithubWebhookTriggerWrapper, @@ -6672,7 +6679,6 @@ const typeMap: { [index: string]: any } = { RuleOutcomeRelationships: RuleOutcomeRelationships, RuleUser: RuleUser, RuleVersionHistory: RuleVersionHistory, - RuleVersionUpdate: RuleVersionUpdate, RuleVersions: RuleVersions, RulesValidateQueryRequest: RulesValidateQueryRequest, RulesValidateQueryRequestData: RulesValidateQueryRequestData, @@ -7153,6 +7159,8 @@ const typeMap: { [index: string]: any } = { Step: Step, StepDisplay: StepDisplay, StepDisplayBounds: StepDisplayBounds, + SuppressionVersionHistory: SuppressionVersionHistory, + SuppressionVersions: SuppressionVersions, TableResultV2: TableResultV2, TableResultV2Array: TableResultV2Array, TableResultV2Data: TableResultV2Data, @@ -7391,6 +7399,7 @@ const typeMap: { [index: string]: any } = { ValidationError: ValidationError, ValidationErrorMeta: ValidationErrorMeta, ValidationResponse: ValidationResponse, + VersionHistoryUpdate: VersionHistoryUpdate, VirusTotalAPIKey: VirusTotalAPIKey, VirusTotalAPIKeyUpdate: VirusTotalAPIKeyUpdate, VirusTotalIntegration: VirusTotalIntegration, diff --git a/packages/datadog-api-client-v2/models/RuleVersions.ts b/packages/datadog-api-client-v2/models/RuleVersions.ts index 465deb06b89b..6b6ead39db8a 100644 --- a/packages/datadog-api-client-v2/models/RuleVersions.ts +++ b/packages/datadog-api-client-v2/models/RuleVersions.ts @@ -3,8 +3,8 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { RuleVersionUpdate } from "./RuleVersionUpdate"; import { SecurityMonitoringRuleResponse } from "./SecurityMonitoringRuleResponse"; +import { VersionHistoryUpdate } from "./VersionHistoryUpdate"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -15,7 +15,7 @@ export class RuleVersions { /** * A list of changes. */ - "changes"?: Array; + "changes"?: Array; /** * Create a new rule. */ @@ -39,7 +39,7 @@ export class RuleVersions { static readonly attributeTypeMap: AttributeTypeMap = { changes: { baseName: "changes", - type: "Array", + type: "Array", }, rule: { baseName: "rule", diff --git a/packages/datadog-api-client-v2/models/SuppressionVersionHistory.ts b/packages/datadog-api-client-v2/models/SuppressionVersionHistory.ts new file mode 100644 index 000000000000..13c4026d0404 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuppressionVersionHistory.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SuppressionVersions } from "./SuppressionVersions"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SuppressionVersions.ts b/packages/datadog-api-client-v2/models/SuppressionVersions.ts new file mode 100644 index 000000000000..7bc69876149b --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuppressionVersions.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringSuppressionAttributes } from "./SecurityMonitoringSuppressionAttributes"; +import { VersionHistoryUpdate } from "./VersionHistoryUpdate"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RuleVersionUpdate.ts b/packages/datadog-api-client-v2/models/VersionHistoryUpdate.ts similarity index 84% rename from packages/datadog-api-client-v2/models/RuleVersionUpdate.ts rename to packages/datadog-api-client-v2/models/VersionHistoryUpdate.ts index 6616fdffb44f..a749ad9568b0 100644 --- a/packages/datadog-api-client-v2/models/RuleVersionUpdate.ts +++ b/packages/datadog-api-client-v2/models/VersionHistoryUpdate.ts @@ -3,14 +3,14 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { RuleVersionUpdateType } from "./RuleVersionUpdateType"; +import { VersionHistoryUpdateType } from "./VersionHistoryUpdateType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** * A change in a rule version. */ -export class RuleVersionUpdate { +export class VersionHistoryUpdate { /** * The new value of the field. */ @@ -22,7 +22,7 @@ export class RuleVersionUpdate { /** * The type of change. */ - "type"?: RuleVersionUpdateType; + "type"?: VersionHistoryUpdateType; /** * A container for additional, undeclared properties. @@ -50,7 +50,7 @@ export class RuleVersionUpdate { }, type: { baseName: "type", - type: "RuleVersionUpdateType", + type: "VersionHistoryUpdateType", }, additionalProperties: { baseName: "additionalProperties", @@ -62,7 +62,7 @@ export class RuleVersionUpdate { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return RuleVersionUpdate.attributeTypeMap; + return VersionHistoryUpdate.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/RuleVersionUpdateType.ts b/packages/datadog-api-client-v2/models/VersionHistoryUpdateType.ts similarity index 92% rename from packages/datadog-api-client-v2/models/RuleVersionUpdateType.ts rename to packages/datadog-api-client-v2/models/VersionHistoryUpdateType.ts index 151fa316273c..468fdb7af484 100644 --- a/packages/datadog-api-client-v2/models/RuleVersionUpdateType.ts +++ b/packages/datadog-api-client-v2/models/VersionHistoryUpdateType.ts @@ -10,7 +10,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; * The type of change. */ -export type RuleVersionUpdateType = +export type VersionHistoryUpdateType = | typeof CREATE | typeof UPDATE | typeof DELETE