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