|
67 | 67 | import com.datadog.api.client.v2.model.SecurityMonitoringCriticalAssetsResponse; |
68 | 68 | import com.datadog.api.client.v2.model.SecurityMonitoringListRulesResponse; |
69 | 69 | import com.datadog.api.client.v2.model.SecurityMonitoringPaginatedSuppressionsResponse; |
| 70 | +import com.datadog.api.client.v2.model.SecurityMonitoringRuleBulkDeletePayload; |
| 71 | +import com.datadog.api.client.v2.model.SecurityMonitoringRuleBulkDeleteResponse; |
70 | 72 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleBulkExportPayload; |
71 | 73 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleConvertPayload; |
72 | 74 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleConvertResponse; |
@@ -605,6 +607,147 @@ public CompletableFuture<ApiResponse<FindingCaseResponse>> attachJiraIssueWithHt |
605 | 607 | new GenericType<FindingCaseResponse>() {}); |
606 | 608 | } |
607 | 609 |
|
| 610 | + /** |
| 611 | + * Bulk delete security monitoring rules. |
| 612 | + * |
| 613 | + * <p>See {@link #bulkDeleteSecurityMonitoringRulesWithHttpInfo}. |
| 614 | + * |
| 615 | + * @param body (required) |
| 616 | + * @return SecurityMonitoringRuleBulkDeleteResponse |
| 617 | + * @throws ApiException if fails to make API call |
| 618 | + */ |
| 619 | + public SecurityMonitoringRuleBulkDeleteResponse bulkDeleteSecurityMonitoringRules( |
| 620 | + SecurityMonitoringRuleBulkDeletePayload body) throws ApiException { |
| 621 | + return bulkDeleteSecurityMonitoringRulesWithHttpInfo(body).getData(); |
| 622 | + } |
| 623 | + |
| 624 | + /** |
| 625 | + * Bulk delete security monitoring rules. |
| 626 | + * |
| 627 | + * <p>See {@link #bulkDeleteSecurityMonitoringRulesWithHttpInfoAsync}. |
| 628 | + * |
| 629 | + * @param body (required) |
| 630 | + * @return CompletableFuture<SecurityMonitoringRuleBulkDeleteResponse> |
| 631 | + */ |
| 632 | + public CompletableFuture<SecurityMonitoringRuleBulkDeleteResponse> |
| 633 | + bulkDeleteSecurityMonitoringRulesAsync(SecurityMonitoringRuleBulkDeletePayload body) { |
| 634 | + return bulkDeleteSecurityMonitoringRulesWithHttpInfoAsync(body) |
| 635 | + .thenApply( |
| 636 | + response -> { |
| 637 | + return response.getData(); |
| 638 | + }); |
| 639 | + } |
| 640 | + |
| 641 | + /** |
| 642 | + * Delete multiple security monitoring rules in a single request. Default rules cannot be deleted. |
| 643 | + * |
| 644 | + * @param body (required) |
| 645 | + * @return ApiResponse<SecurityMonitoringRuleBulkDeleteResponse> |
| 646 | + * @throws ApiException if fails to make API call |
| 647 | + * @http.response.details |
| 648 | + * <table border="1"> |
| 649 | + * <caption>Response details</caption> |
| 650 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 651 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 652 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 653 | + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> |
| 654 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 655 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 656 | + * </table> |
| 657 | + */ |
| 658 | + public ApiResponse<SecurityMonitoringRuleBulkDeleteResponse> |
| 659 | + bulkDeleteSecurityMonitoringRulesWithHttpInfo(SecurityMonitoringRuleBulkDeletePayload body) |
| 660 | + throws ApiException { |
| 661 | + Object localVarPostBody = body; |
| 662 | + |
| 663 | + // verify the required parameter 'body' is set |
| 664 | + if (body == null) { |
| 665 | + throw new ApiException( |
| 666 | + 400, |
| 667 | + "Missing the required parameter 'body' when calling bulkDeleteSecurityMonitoringRules"); |
| 668 | + } |
| 669 | + // create path and map variables |
| 670 | + String localVarPath = "/api/v2/security_monitoring/rules/bulk_delete"; |
| 671 | + |
| 672 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 673 | + |
| 674 | + Invocation.Builder builder = |
| 675 | + apiClient.createBuilder( |
| 676 | + "v2.SecurityMonitoringApi.bulkDeleteSecurityMonitoringRules", |
| 677 | + localVarPath, |
| 678 | + new ArrayList<Pair>(), |
| 679 | + localVarHeaderParams, |
| 680 | + new HashMap<String, String>(), |
| 681 | + new String[] {"application/json"}, |
| 682 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 683 | + return apiClient.invokeAPI( |
| 684 | + "DELETE", |
| 685 | + builder, |
| 686 | + localVarHeaderParams, |
| 687 | + new String[] {"application/json"}, |
| 688 | + localVarPostBody, |
| 689 | + new HashMap<String, Object>(), |
| 690 | + false, |
| 691 | + new GenericType<SecurityMonitoringRuleBulkDeleteResponse>() {}); |
| 692 | + } |
| 693 | + |
| 694 | + /** |
| 695 | + * Bulk delete security monitoring rules. |
| 696 | + * |
| 697 | + * <p>See {@link #bulkDeleteSecurityMonitoringRulesWithHttpInfo}. |
| 698 | + * |
| 699 | + * @param body (required) |
| 700 | + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleBulkDeleteResponse>> |
| 701 | + */ |
| 702 | + public CompletableFuture<ApiResponse<SecurityMonitoringRuleBulkDeleteResponse>> |
| 703 | + bulkDeleteSecurityMonitoringRulesWithHttpInfoAsync( |
| 704 | + SecurityMonitoringRuleBulkDeletePayload body) { |
| 705 | + Object localVarPostBody = body; |
| 706 | + |
| 707 | + // verify the required parameter 'body' is set |
| 708 | + if (body == null) { |
| 709 | + CompletableFuture<ApiResponse<SecurityMonitoringRuleBulkDeleteResponse>> result = |
| 710 | + new CompletableFuture<>(); |
| 711 | + result.completeExceptionally( |
| 712 | + new ApiException( |
| 713 | + 400, |
| 714 | + "Missing the required parameter 'body' when calling" |
| 715 | + + " bulkDeleteSecurityMonitoringRules")); |
| 716 | + return result; |
| 717 | + } |
| 718 | + // create path and map variables |
| 719 | + String localVarPath = "/api/v2/security_monitoring/rules/bulk_delete"; |
| 720 | + |
| 721 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 722 | + |
| 723 | + Invocation.Builder builder; |
| 724 | + try { |
| 725 | + builder = |
| 726 | + apiClient.createBuilder( |
| 727 | + "v2.SecurityMonitoringApi.bulkDeleteSecurityMonitoringRules", |
| 728 | + localVarPath, |
| 729 | + new ArrayList<Pair>(), |
| 730 | + localVarHeaderParams, |
| 731 | + new HashMap<String, String>(), |
| 732 | + new String[] {"application/json"}, |
| 733 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 734 | + } catch (ApiException ex) { |
| 735 | + CompletableFuture<ApiResponse<SecurityMonitoringRuleBulkDeleteResponse>> result = |
| 736 | + new CompletableFuture<>(); |
| 737 | + result.completeExceptionally(ex); |
| 738 | + return result; |
| 739 | + } |
| 740 | + return apiClient.invokeAPIAsync( |
| 741 | + "DELETE", |
| 742 | + builder, |
| 743 | + localVarHeaderParams, |
| 744 | + new String[] {"application/json"}, |
| 745 | + localVarPostBody, |
| 746 | + new HashMap<String, Object>(), |
| 747 | + false, |
| 748 | + new GenericType<SecurityMonitoringRuleBulkDeleteResponse>() {}); |
| 749 | + } |
| 750 | + |
608 | 751 | /** |
609 | 752 | * Bulk update security signals. |
610 | 753 | * |
|
0 commit comments