|
70 | 70 | import com.datadog.api.client.v2.model.ListSecurityFindingsResponse; |
71 | 71 | import com.datadog.api.client.v2.model.ListVulnerabilitiesResponse; |
72 | 72 | import com.datadog.api.client.v2.model.ListVulnerableAssetsResponse; |
| 73 | +import com.datadog.api.client.v2.model.MatchingSignalsResponse; |
73 | 74 | import com.datadog.api.client.v2.model.MuteFindingsRequest; |
74 | 75 | import com.datadog.api.client.v2.model.MuteFindingsResponse; |
75 | 76 | import com.datadog.api.client.v2.model.MuteRuleCreateRequest; |
@@ -12393,6 +12394,186 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri |
12393 | 12394 | new GenericType<SecurityMonitoringSignalSuggestedActionsResponse>() {}); |
12394 | 12395 | } |
12395 | 12396 |
|
| 12397 | + /** |
| 12398 | + * Get signals matching an event. |
| 12399 | + * |
| 12400 | + * <p>See {@link #getMatchingSignalsWithHttpInfo}. |
| 12401 | + * |
| 12402 | + * @param eventId The ID of the event to find matching signals for. (required) |
| 12403 | + * @param track The product track that the event belongs to. (required) |
| 12404 | + * @return MatchingSignalsResponse |
| 12405 | + * @throws ApiException if fails to make API call |
| 12406 | + */ |
| 12407 | + public MatchingSignalsResponse getMatchingSignals(String eventId, String track) |
| 12408 | + throws ApiException { |
| 12409 | + return getMatchingSignalsWithHttpInfo(eventId, track).getData(); |
| 12410 | + } |
| 12411 | + |
| 12412 | + /** |
| 12413 | + * Get signals matching an event. |
| 12414 | + * |
| 12415 | + * <p>See {@link #getMatchingSignalsWithHttpInfoAsync}. |
| 12416 | + * |
| 12417 | + * @param eventId The ID of the event to find matching signals for. (required) |
| 12418 | + * @param track The product track that the event belongs to. (required) |
| 12419 | + * @return CompletableFuture<MatchingSignalsResponse> |
| 12420 | + */ |
| 12421 | + public CompletableFuture<MatchingSignalsResponse> getMatchingSignalsAsync( |
| 12422 | + String eventId, String track) { |
| 12423 | + return getMatchingSignalsWithHttpInfoAsync(eventId, track) |
| 12424 | + .thenApply( |
| 12425 | + response -> { |
| 12426 | + return response.getData(); |
| 12427 | + }); |
| 12428 | + } |
| 12429 | + |
| 12430 | + /** |
| 12431 | + * Returns the list of security signals that match a given event on the given track. |
| 12432 | + * |
| 12433 | + * @param eventId The ID of the event to find matching signals for. (required) |
| 12434 | + * @param track The product track that the event belongs to. (required) |
| 12435 | + * @return ApiResponse<MatchingSignalsResponse> |
| 12436 | + * @throws ApiException if fails to make API call |
| 12437 | + * @http.response.details |
| 12438 | + * <table border="1"> |
| 12439 | + * <caption>Response details</caption> |
| 12440 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 12441 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 12442 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 12443 | + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> |
| 12444 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 12445 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 12446 | + * </table> |
| 12447 | + */ |
| 12448 | + public ApiResponse<MatchingSignalsResponse> getMatchingSignalsWithHttpInfo( |
| 12449 | + String eventId, String track) throws ApiException { |
| 12450 | + // Check if unstable operation is enabled |
| 12451 | + String operationId = "getMatchingSignals"; |
| 12452 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 12453 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 12454 | + } else { |
| 12455 | + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); |
| 12456 | + } |
| 12457 | + Object localVarPostBody = null; |
| 12458 | + |
| 12459 | + // verify the required parameter 'eventId' is set |
| 12460 | + if (eventId == null) { |
| 12461 | + throw new ApiException( |
| 12462 | + 400, "Missing the required parameter 'eventId' when calling getMatchingSignals"); |
| 12463 | + } |
| 12464 | + |
| 12465 | + // verify the required parameter 'track' is set |
| 12466 | + if (track == null) { |
| 12467 | + throw new ApiException( |
| 12468 | + 400, "Missing the required parameter 'track' when calling getMatchingSignals"); |
| 12469 | + } |
| 12470 | + // create path and map variables |
| 12471 | + String localVarPath = |
| 12472 | + "/api/v2/security_monitoring/events/{event_id}/matching_signals" |
| 12473 | + .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); |
| 12474 | + |
| 12475 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 12476 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 12477 | + |
| 12478 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "track", track)); |
| 12479 | + |
| 12480 | + Invocation.Builder builder = |
| 12481 | + apiClient.createBuilder( |
| 12482 | + "v2.SecurityMonitoringApi.getMatchingSignals", |
| 12483 | + localVarPath, |
| 12484 | + localVarQueryParams, |
| 12485 | + localVarHeaderParams, |
| 12486 | + new HashMap<String, String>(), |
| 12487 | + new String[] {"application/json"}, |
| 12488 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 12489 | + return apiClient.invokeAPI( |
| 12490 | + "GET", |
| 12491 | + builder, |
| 12492 | + localVarHeaderParams, |
| 12493 | + new String[] {}, |
| 12494 | + localVarPostBody, |
| 12495 | + new HashMap<String, Object>(), |
| 12496 | + false, |
| 12497 | + new GenericType<MatchingSignalsResponse>() {}); |
| 12498 | + } |
| 12499 | + |
| 12500 | + /** |
| 12501 | + * Get signals matching an event. |
| 12502 | + * |
| 12503 | + * <p>See {@link #getMatchingSignalsWithHttpInfo}. |
| 12504 | + * |
| 12505 | + * @param eventId The ID of the event to find matching signals for. (required) |
| 12506 | + * @param track The product track that the event belongs to. (required) |
| 12507 | + * @return CompletableFuture<ApiResponse<MatchingSignalsResponse>> |
| 12508 | + */ |
| 12509 | + public CompletableFuture<ApiResponse<MatchingSignalsResponse>> |
| 12510 | + getMatchingSignalsWithHttpInfoAsync(String eventId, String track) { |
| 12511 | + // Check if unstable operation is enabled |
| 12512 | + String operationId = "getMatchingSignals"; |
| 12513 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 12514 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 12515 | + } else { |
| 12516 | + CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>(); |
| 12517 | + result.completeExceptionally( |
| 12518 | + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); |
| 12519 | + return result; |
| 12520 | + } |
| 12521 | + Object localVarPostBody = null; |
| 12522 | + |
| 12523 | + // verify the required parameter 'eventId' is set |
| 12524 | + if (eventId == null) { |
| 12525 | + CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>(); |
| 12526 | + result.completeExceptionally( |
| 12527 | + new ApiException( |
| 12528 | + 400, "Missing the required parameter 'eventId' when calling getMatchingSignals")); |
| 12529 | + return result; |
| 12530 | + } |
| 12531 | + |
| 12532 | + // verify the required parameter 'track' is set |
| 12533 | + if (track == null) { |
| 12534 | + CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>(); |
| 12535 | + result.completeExceptionally( |
| 12536 | + new ApiException( |
| 12537 | + 400, "Missing the required parameter 'track' when calling getMatchingSignals")); |
| 12538 | + return result; |
| 12539 | + } |
| 12540 | + // create path and map variables |
| 12541 | + String localVarPath = |
| 12542 | + "/api/v2/security_monitoring/events/{event_id}/matching_signals" |
| 12543 | + .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); |
| 12544 | + |
| 12545 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 12546 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 12547 | + |
| 12548 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "track", track)); |
| 12549 | + |
| 12550 | + Invocation.Builder builder; |
| 12551 | + try { |
| 12552 | + builder = |
| 12553 | + apiClient.createBuilder( |
| 12554 | + "v2.SecurityMonitoringApi.getMatchingSignals", |
| 12555 | + localVarPath, |
| 12556 | + localVarQueryParams, |
| 12557 | + localVarHeaderParams, |
| 12558 | + new HashMap<String, String>(), |
| 12559 | + new String[] {"application/json"}, |
| 12560 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 12561 | + } catch (ApiException ex) { |
| 12562 | + CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>(); |
| 12563 | + result.completeExceptionally(ex); |
| 12564 | + return result; |
| 12565 | + } |
| 12566 | + return apiClient.invokeAPIAsync( |
| 12567 | + "GET", |
| 12568 | + builder, |
| 12569 | + localVarHeaderParams, |
| 12570 | + new String[] {}, |
| 12571 | + localVarPostBody, |
| 12572 | + new HashMap<String, Object>(), |
| 12573 | + false, |
| 12574 | + new GenericType<MatchingSignalsResponse>() {}); |
| 12575 | + } |
| 12576 | + |
12396 | 12577 | /** Manage optional parameters to getResourceEvaluationFilters. */ |
12397 | 12578 | public static class GetResourceEvaluationFiltersOptionalParameters { |
12398 | 12579 | private String cloudProvider; |
|
0 commit comments