|
21 | 21 | import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideUpdateRequest; |
22 | 22 | import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; |
23 | 23 | import com.datadog.api.client.v2.model.OrgGroupPolicySortOption; |
| 24 | +import com.datadog.api.client.v2.model.OrgGroupPolicySuggestionListResponse; |
24 | 25 | import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateRequest; |
25 | 26 | import com.datadog.api.client.v2.model.OrgGroupResponse; |
26 | 27 | import com.datadog.api.client.v2.model.OrgGroupSortOption; |
@@ -2747,6 +2748,172 @@ public ApiResponse<OrgGroupPolicyOverrideListResponse> listOrgGroupPolicyOverrid |
2747 | 2748 | new GenericType<OrgGroupPolicyOverrideListResponse>() {}); |
2748 | 2749 | } |
2749 | 2750 |
|
| 2751 | + /** |
| 2752 | + * List org group policy suggestions. |
| 2753 | + * |
| 2754 | + * <p>See {@link #listOrgGroupPolicySuggestionsWithHttpInfo}. |
| 2755 | + * |
| 2756 | + * @param filterOrgGroupId Filter policies by org group ID. (required) |
| 2757 | + * @return OrgGroupPolicySuggestionListResponse |
| 2758 | + * @throws ApiException if fails to make API call |
| 2759 | + */ |
| 2760 | + public OrgGroupPolicySuggestionListResponse listOrgGroupPolicySuggestions(UUID filterOrgGroupId) |
| 2761 | + throws ApiException { |
| 2762 | + return listOrgGroupPolicySuggestionsWithHttpInfo(filterOrgGroupId).getData(); |
| 2763 | + } |
| 2764 | + |
| 2765 | + /** |
| 2766 | + * List org group policy suggestions. |
| 2767 | + * |
| 2768 | + * <p>See {@link #listOrgGroupPolicySuggestionsWithHttpInfoAsync}. |
| 2769 | + * |
| 2770 | + * @param filterOrgGroupId Filter policies by org group ID. (required) |
| 2771 | + * @return CompletableFuture<OrgGroupPolicySuggestionListResponse> |
| 2772 | + */ |
| 2773 | + public CompletableFuture<OrgGroupPolicySuggestionListResponse> listOrgGroupPolicySuggestionsAsync( |
| 2774 | + UUID filterOrgGroupId) { |
| 2775 | + return listOrgGroupPolicySuggestionsWithHttpInfoAsync(filterOrgGroupId) |
| 2776 | + .thenApply( |
| 2777 | + response -> { |
| 2778 | + return response.getData(); |
| 2779 | + }); |
| 2780 | + } |
| 2781 | + |
| 2782 | + /** |
| 2783 | + * List suggested organization group policies. Requires a filter on org group ID. |
| 2784 | + * |
| 2785 | + * @param filterOrgGroupId Filter policies by org group ID. (required) |
| 2786 | + * @return ApiResponse<OrgGroupPolicySuggestionListResponse> |
| 2787 | + * @throws ApiException if fails to make API call |
| 2788 | + * @http.response.details |
| 2789 | + * <table border="1"> |
| 2790 | + * <caption>Response details</caption> |
| 2791 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 2792 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 2793 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 2794 | + * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> |
| 2795 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 2796 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 2797 | + * </table> |
| 2798 | + */ |
| 2799 | + public ApiResponse<OrgGroupPolicySuggestionListResponse> |
| 2800 | + listOrgGroupPolicySuggestionsWithHttpInfo(UUID filterOrgGroupId) throws ApiException { |
| 2801 | + // Check if unstable operation is enabled |
| 2802 | + String operationId = "listOrgGroupPolicySuggestions"; |
| 2803 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 2804 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 2805 | + } else { |
| 2806 | + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); |
| 2807 | + } |
| 2808 | + Object localVarPostBody = null; |
| 2809 | + |
| 2810 | + // verify the required parameter 'filterOrgGroupId' is set |
| 2811 | + if (filterOrgGroupId == null) { |
| 2812 | + throw new ApiException( |
| 2813 | + 400, |
| 2814 | + "Missing the required parameter 'filterOrgGroupId' when calling" |
| 2815 | + + " listOrgGroupPolicySuggestions"); |
| 2816 | + } |
| 2817 | + // create path and map variables |
| 2818 | + String localVarPath = "/api/v2/org_group_policy_suggestions"; |
| 2819 | + |
| 2820 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2821 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2822 | + |
| 2823 | + localVarQueryParams.addAll( |
| 2824 | + apiClient.parameterToPairs("", "filter[org_group_id]", filterOrgGroupId)); |
| 2825 | + |
| 2826 | + Invocation.Builder builder = |
| 2827 | + apiClient.createBuilder( |
| 2828 | + "v2.OrgGroupsApi.listOrgGroupPolicySuggestions", |
| 2829 | + localVarPath, |
| 2830 | + localVarQueryParams, |
| 2831 | + localVarHeaderParams, |
| 2832 | + new HashMap<String, String>(), |
| 2833 | + new String[] {"application/json"}, |
| 2834 | + new String[] {"apiKeyAuth", "appKeyAuth"}); |
| 2835 | + return apiClient.invokeAPI( |
| 2836 | + "GET", |
| 2837 | + builder, |
| 2838 | + localVarHeaderParams, |
| 2839 | + new String[] {}, |
| 2840 | + localVarPostBody, |
| 2841 | + new HashMap<String, Object>(), |
| 2842 | + false, |
| 2843 | + new GenericType<OrgGroupPolicySuggestionListResponse>() {}); |
| 2844 | + } |
| 2845 | + |
| 2846 | + /** |
| 2847 | + * List org group policy suggestions. |
| 2848 | + * |
| 2849 | + * <p>See {@link #listOrgGroupPolicySuggestionsWithHttpInfo}. |
| 2850 | + * |
| 2851 | + * @param filterOrgGroupId Filter policies by org group ID. (required) |
| 2852 | + * @return CompletableFuture<ApiResponse<OrgGroupPolicySuggestionListResponse>> |
| 2853 | + */ |
| 2854 | + public CompletableFuture<ApiResponse<OrgGroupPolicySuggestionListResponse>> |
| 2855 | + listOrgGroupPolicySuggestionsWithHttpInfoAsync(UUID filterOrgGroupId) { |
| 2856 | + // Check if unstable operation is enabled |
| 2857 | + String operationId = "listOrgGroupPolicySuggestions"; |
| 2858 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 2859 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 2860 | + } else { |
| 2861 | + CompletableFuture<ApiResponse<OrgGroupPolicySuggestionListResponse>> result = |
| 2862 | + new CompletableFuture<>(); |
| 2863 | + result.completeExceptionally( |
| 2864 | + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); |
| 2865 | + return result; |
| 2866 | + } |
| 2867 | + Object localVarPostBody = null; |
| 2868 | + |
| 2869 | + // verify the required parameter 'filterOrgGroupId' is set |
| 2870 | + if (filterOrgGroupId == null) { |
| 2871 | + CompletableFuture<ApiResponse<OrgGroupPolicySuggestionListResponse>> result = |
| 2872 | + new CompletableFuture<>(); |
| 2873 | + result.completeExceptionally( |
| 2874 | + new ApiException( |
| 2875 | + 400, |
| 2876 | + "Missing the required parameter 'filterOrgGroupId' when calling" |
| 2877 | + + " listOrgGroupPolicySuggestions")); |
| 2878 | + return result; |
| 2879 | + } |
| 2880 | + // create path and map variables |
| 2881 | + String localVarPath = "/api/v2/org_group_policy_suggestions"; |
| 2882 | + |
| 2883 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2884 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2885 | + |
| 2886 | + localVarQueryParams.addAll( |
| 2887 | + apiClient.parameterToPairs("", "filter[org_group_id]", filterOrgGroupId)); |
| 2888 | + |
| 2889 | + Invocation.Builder builder; |
| 2890 | + try { |
| 2891 | + builder = |
| 2892 | + apiClient.createBuilder( |
| 2893 | + "v2.OrgGroupsApi.listOrgGroupPolicySuggestions", |
| 2894 | + localVarPath, |
| 2895 | + localVarQueryParams, |
| 2896 | + localVarHeaderParams, |
| 2897 | + new HashMap<String, String>(), |
| 2898 | + new String[] {"application/json"}, |
| 2899 | + new String[] {"apiKeyAuth", "appKeyAuth"}); |
| 2900 | + } catch (ApiException ex) { |
| 2901 | + CompletableFuture<ApiResponse<OrgGroupPolicySuggestionListResponse>> result = |
| 2902 | + new CompletableFuture<>(); |
| 2903 | + result.completeExceptionally(ex); |
| 2904 | + return result; |
| 2905 | + } |
| 2906 | + return apiClient.invokeAPIAsync( |
| 2907 | + "GET", |
| 2908 | + builder, |
| 2909 | + localVarHeaderParams, |
| 2910 | + new String[] {}, |
| 2911 | + localVarPostBody, |
| 2912 | + new HashMap<String, Object>(), |
| 2913 | + false, |
| 2914 | + new GenericType<OrgGroupPolicySuggestionListResponse>() {}); |
| 2915 | + } |
| 2916 | + |
2750 | 2917 | /** Manage optional parameters to listOrgGroups. */ |
2751 | 2918 | public static class ListOrgGroupsOptionalParameters { |
2752 | 2919 | private Long pageNumber; |
|
0 commit comments