From dddf338506970fe5f778f71fcd77e59cb94c71e2 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 9 Jun 2026 09:32:19 +0000 Subject: [PATCH] Regenerate client from commit 2b767e7 of spec repo --- .generator/schemas/v2/openapi.yaml | 111 +++++++- .../GetSingleEntityContext.java | 25 ++ .../com/datadog/api/client/ApiClient.java | 1 + .../client/v2/api/SecurityMonitoringApi.java | 261 ++++++++++++++++++ .../v2/model/SingleEntityContextResponse.java | 146 ++++++++++ .../client/v2/api/security_monitoring.feature | 24 ++ .../com/datadog/api/client/v2/api/undo.json | 6 + 7 files changed, 569 insertions(+), 5 deletions(-) create mode 100644 examples/v2/security-monitoring/GetSingleEntityContext.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SingleEntityContextResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2d470c8f2f0..5c2db3b4581 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30868,9 +30868,10 @@ components: additionalProperties: {} description: The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity. example: + accounts: + - linked-account-123 display_name: Test User - emails: - - user@example.com + email: user@example.com principal_id: user@example.com type: object EntityData: @@ -86488,6 +86489,14 @@ components: type: string x-enum-varnames: - AGGREGATED_DNS + SingleEntityContextResponse: + description: Response from the single entity context endpoint, containing the matching entity. + properties: + data: + $ref: "#/components/schemas/EntityContextEntity" + required: + - data + type: object SlackIntegrationMetadata: description: Incident integration metadata for the Slack integration. properties: @@ -163328,9 +163337,10 @@ paths: - attributes: revisions: - attributes: + accounts: + - linked-account-123 display_name: Test User - emails: - - user@example.com + email: user@example.com principal_id: user@example.com first_seen_at: "2026-04-01T00:00:00Z" last_seen_at: "2026-05-01T00:00:00Z" @@ -163361,7 +163371,98 @@ paths: permissions: - siem_entities_read x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/entity_context/{id}: + get: + description: |- + Get a single entity from the Cloud SIEM entity context store by its identifier, returning the historical + revisions of the entity in the requested time range. The endpoint can either return revisions across an + interval (`from` / `to`) or the snapshot of the entity at a single point in time (`as_of`); the two modes + are mutually exclusive. + operationId: GetSingleEntityContext + parameters: + - description: The unique identifier of the entity to retrieve. + in: path + name: id + required: true + schema: + example: user@example.com + type: string + - description: |- + The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`). + Defaults to `now-7d`. Ignored when `as_of` is set. + in: query + name: from + required: false + schema: + default: now-7d + example: now-7d + type: string + - description: |- + The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`). + Defaults to `now`. Ignored when `as_of` is set. + in: query + name: to + required: false + schema: + default: now + example: now + type: string + - description: |- + A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp + (in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored. + Cannot be combined with custom `from` / `to` values. + example: now-1d + in: query + name: as_of + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + revisions: + - attributes: + accounts: + - linked-account-123 + display_name: Test User + email: user@example.com + principal_id: user@example.com + first_seen_at: "2026-04-01T00:00:00Z" + last_seen_at: "2026-05-01T00:00:00Z" + id: user@example.com + type: siem_entity_identity + schema: + $ref: "#/components/schemas/SingleEntityContextResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - siem_entities_read + summary: Get a single entity context + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - siem_entities_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/rules: get: diff --git a/examples/v2/security-monitoring/GetSingleEntityContext.java b/examples/v2/security-monitoring/GetSingleEntityContext.java new file mode 100644 index 00000000000..9d460032fdf --- /dev/null +++ b/examples/v2/security-monitoring/GetSingleEntityContext.java @@ -0,0 +1,25 @@ +// Get a single entity context returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.SingleEntityContextResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getSingleEntityContext", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + SingleEntityContextResponse result = apiInstance.getSingleEntityContext("user@example.com"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getSingleEntityContext"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 3c2d2401c35..fb4d0c41292 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -928,6 +928,7 @@ public class ApiClient { put("v2.getSecurityMonitoringHistsignalsByJobId", false); put("v2.getSecurityMonitoringIntegrationConfig", false); put("v2.getSignalEntities", false); + put("v2.getSingleEntityContext", false); put("v2.getStaticAnalysisDefaultRulesets", false); put("v2.getStaticAnalysisNodeTypes", false); put("v2.getStaticAnalysisRuleset", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index bcb269b2137..53af26bfd19 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -142,6 +142,7 @@ import com.datadog.api.client.v2.model.SecurityMonitoringTerraformExportResponse; import com.datadog.api.client.v2.model.SecurityMonitoringTerraformResourceType; import com.datadog.api.client.v2.model.SignalEntitiesResponse; +import com.datadog.api.client.v2.model.SingleEntityContextResponse; import com.datadog.api.client.v2.model.UpdateCustomFrameworkRequest; import com.datadog.api.client.v2.model.UpdateCustomFrameworkResponse; import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersRequest; @@ -12608,6 +12609,266 @@ public CompletableFuture> getSignalNotificationRulesWithHttp new GenericType() {}); } + /** Manage optional parameters to getSingleEntityContext. */ + public static class GetSingleEntityContextOptionalParameters { + private String from; + private String to; + private String asOf; + + /** + * Set from. + * + * @param from The start of the time range to query, as an RFC3339 timestamp or a relative time + * (for example, now-7d). Defaults to now-7d. Ignored when + * as_of is set. (optional, default to "now-7d") + * @return GetSingleEntityContextOptionalParameters + */ + public GetSingleEntityContextOptionalParameters from(String from) { + this.from = from; + return this; + } + + /** + * Set to. + * + * @param to The end of the time range to query, as an RFC3339 timestamp or a relative time (for + * example, now). Defaults to now. Ignored when as_of + * is set. (optional, default to "now") + * @return GetSingleEntityContextOptionalParameters + */ + public GetSingleEntityContextOptionalParameters to(String to) { + this.to = to; + return this; + } + + /** + * Set asOf. + * + * @param asOf A point in time at which to query the entity revisions, as an RFC3339 timestamp, + * a Unix timestamp (in seconds), or a relative time (for example, now-1d). + * When set, from and to are ignored. Cannot be combined with + * custom from / to values. (optional) + * @return GetSingleEntityContextOptionalParameters + */ + public GetSingleEntityContextOptionalParameters asOf(String asOf) { + this.asOf = asOf; + return this; + } + } + + /** + * Get a single entity context. + * + *

See {@link #getSingleEntityContextWithHttpInfo}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @return SingleEntityContextResponse + * @throws ApiException if fails to make API call + */ + public SingleEntityContextResponse getSingleEntityContext(String id) throws ApiException { + return getSingleEntityContextWithHttpInfo(id, new GetSingleEntityContextOptionalParameters()) + .getData(); + } + + /** + * Get a single entity context. + * + *

See {@link #getSingleEntityContextWithHttpInfoAsync}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @return CompletableFuture<SingleEntityContextResponse> + */ + public CompletableFuture getSingleEntityContextAsync(String id) { + return getSingleEntityContextWithHttpInfoAsync( + id, new GetSingleEntityContextOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single entity context. + * + *

See {@link #getSingleEntityContextWithHttpInfo}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return SingleEntityContextResponse + * @throws ApiException if fails to make API call + */ + public SingleEntityContextResponse getSingleEntityContext( + String id, GetSingleEntityContextOptionalParameters parameters) throws ApiException { + return getSingleEntityContextWithHttpInfo(id, parameters).getData(); + } + + /** + * Get a single entity context. + * + *

See {@link #getSingleEntityContextWithHttpInfoAsync}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SingleEntityContextResponse> + */ + public CompletableFuture getSingleEntityContextAsync( + String id, GetSingleEntityContextOptionalParameters parameters) { + return getSingleEntityContextWithHttpInfoAsync(id, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single entity from the Cloud SIEM entity context store by its identifier, returning the + * historical revisions of the entity in the requested time range. The endpoint can either return + * revisions across an interval (from / to) or the snapshot of the + * entity at a single point in time (as_of); the two modes are mutually exclusive. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SingleEntityContextResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getSingleEntityContextWithHttpInfo( + String id, GetSingleEntityContextOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSingleEntityContext"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getSingleEntityContext"); + } + String from = parameters.from; + String to = parameters.to; + String asOf = parameters.asOf; + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/entity_context/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getSingleEntityContext", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a single entity context. + * + *

See {@link #getSingleEntityContextWithHttpInfo}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SingleEntityContextResponse>> + */ + public CompletableFuture> + getSingleEntityContextWithHttpInfoAsync( + String id, GetSingleEntityContextOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getSingleEntityContext"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getSingleEntityContext")); + return result; + } + String from = parameters.from; + String to = parameters.to; + String asOf = parameters.asOf; + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/entity_context/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getSingleEntityContext", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get default rulesets for a language. * diff --git a/src/main/java/com/datadog/api/client/v2/model/SingleEntityContextResponse.java b/src/main/java/com/datadog/api/client/v2/model/SingleEntityContextResponse.java new file mode 100644 index 00000000000..6ec79cd6615 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SingleEntityContextResponse.java @@ -0,0 +1,146 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response from the single entity context endpoint, containing the matching entity. */ +@JsonPropertyOrder({SingleEntityContextResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SingleEntityContextResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private EntityContextEntity data; + + public SingleEntityContextResponse() {} + + @JsonCreator + public SingleEntityContextResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) EntityContextEntity data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SingleEntityContextResponse data(EntityContextEntity data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A single entity returned by the entity context endpoint. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EntityContextEntity getData() { + return data; + } + + public void setData(EntityContextEntity data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SingleEntityContextResponse + */ + @JsonAnySetter + public SingleEntityContextResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SingleEntityContextResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SingleEntityContextResponse singleEntityContextResponse = (SingleEntityContextResponse) o; + return Objects.equals(this.data, singleEntityContextResponse.data) + && Objects.equals( + this.additionalProperties, singleEntityContextResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SingleEntityContextResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index bae8918780e..3773f2831e2 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -1608,6 +1608,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a single entity context returns "Bad Request" response + Given operation "GetSingleEntityContext" enabled + And new "GetSingleEntityContext" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a single entity context returns "Not Found" response + Given operation "GetSingleEntityContext" enabled + And new "GetSingleEntityContext" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a single entity context returns "OK" response + Given operation "GetSingleEntityContext" enabled + And new "GetSingleEntityContext" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Get a suppression rule returns "Not Found" response Given new "GetSecurityMonitoringSuppression" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 9101d0155cb..189a08ba69a 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -7104,6 +7104,12 @@ "type": "safe" } }, + "GetSingleEntityContext": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": {