Skip to content

Commit 2befbbe

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit e52b06e of spec repo (#4080)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 877be6b commit 2befbbe

12 files changed

Lines changed: 1250 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73429,6 +73429,86 @@ components:
7342973429
- MINUS_ID
7343073430
- NAME
7343173431
- MINUS_NAME
73432+
OrgGroupPolicySuggestionAttributes:
73433+
description: Attributes of an org group policy suggestion.
73434+
properties:
73435+
consensus_ratio:
73436+
description: The ratio of member orgs whose configuration agrees on the recommended value.
73437+
example: 0.75
73438+
format: double
73439+
maximum: 1
73440+
minimum: 0
73441+
type: number
73442+
policy_name:
73443+
description: The name of the suggested policy.
73444+
example: "monitor_timezone"
73445+
type: string
73446+
recommended_value:
73447+
description: The recommended value for the policy, based on member org consensus.
73448+
example: "UTC"
73449+
status:
73450+
$ref: "#/components/schemas/OrgGroupPolicySuggestionStatus"
73451+
required:
73452+
- policy_name
73453+
- status
73454+
- consensus_ratio
73455+
- recommended_value
73456+
type: object
73457+
OrgGroupPolicySuggestionData:
73458+
description: An org group policy suggestion resource.
73459+
properties:
73460+
attributes:
73461+
$ref: "#/components/schemas/OrgGroupPolicySuggestionAttributes"
73462+
id:
73463+
description: The ID of the org group policy suggestion.
73464+
example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
73465+
type: string
73466+
relationships:
73467+
$ref: "#/components/schemas/OrgGroupPolicySuggestionRelationships"
73468+
type:
73469+
$ref: "#/components/schemas/OrgGroupPolicySuggestionType"
73470+
required:
73471+
- id
73472+
- type
73473+
- attributes
73474+
type: object
73475+
OrgGroupPolicySuggestionListResponse:
73476+
description: Response containing a list of org group policy suggestions.
73477+
properties:
73478+
data:
73479+
description: An array of org group policy suggestions.
73480+
items:
73481+
$ref: "#/components/schemas/OrgGroupPolicySuggestionData"
73482+
type: array
73483+
required:
73484+
- data
73485+
type: object
73486+
OrgGroupPolicySuggestionRelationships:
73487+
description: Relationships of an org group policy suggestion.
73488+
properties:
73489+
org_group:
73490+
$ref: "#/components/schemas/OrgGroupRelationshipToOne"
73491+
type: object
73492+
OrgGroupPolicySuggestionStatus:
73493+
description: The status of the policy suggestion.
73494+
enum:
73495+
- pending
73496+
- accepted
73497+
- dismissed
73498+
example: pending
73499+
type: string
73500+
x-enum-varnames:
73501+
- PENDING
73502+
- ACCEPTED
73503+
- DISMISSED
73504+
OrgGroupPolicySuggestionType:
73505+
description: Org group policy suggestions resource type.
73506+
enum:
73507+
- org_group_policy_suggestions
73508+
example: org_group_policy_suggestions
73509+
type: string
73510+
x-enum-varnames:
73511+
- ORG_GROUP_POLICY_SUGGESTIONS
7343273512
OrgGroupPolicyType:
7343373513
description: Org group policies resource type.
7343473514
enum:
@@ -164938,6 +165018,64 @@ paths:
164938165018
x-unstable: |-
164939165019
**Note**: This endpoint is in preview and is subject to change.
164940165020
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
165021+
/api/v2/org_group_policy_suggestions:
165022+
get:
165023+
description: List suggested organization group policies. Requires a filter on org group ID.
165024+
operationId: ListOrgGroupPolicySuggestions
165025+
parameters:
165026+
- $ref: "#/components/parameters/OrgGroupPolicyFilterOrgGroupId"
165027+
responses:
165028+
"200":
165029+
content:
165030+
application/json:
165031+
examples:
165032+
default:
165033+
value:
165034+
data:
165035+
- attributes:
165036+
consensus_ratio: 0.75
165037+
policy_name: "monitor_timezone"
165038+
recommended_value: "UTC"
165039+
status: "pending"
165040+
id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
165041+
relationships:
165042+
org_group:
165043+
data:
165044+
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
165045+
type: org_groups
165046+
type: org_group_policy_suggestions
165047+
schema:
165048+
$ref: "#/components/schemas/OrgGroupPolicySuggestionListResponse"
165049+
description: OK
165050+
"400":
165051+
content:
165052+
application/json:
165053+
schema:
165054+
$ref: "#/components/schemas/JSONAPIErrorResponse"
165055+
description: Bad Request
165056+
"401":
165057+
content:
165058+
application/json:
165059+
schema:
165060+
$ref: "#/components/schemas/JSONAPIErrorResponse"
165061+
description: Unauthorized
165062+
"403":
165063+
content:
165064+
application/json:
165065+
schema:
165066+
$ref: "#/components/schemas/JSONAPIErrorResponse"
165067+
description: Forbidden
165068+
"429":
165069+
$ref: "#/components/responses/TooManyRequestsResponse"
165070+
summary: List org group policy suggestions
165071+
tags: [Org Groups]
165072+
"x-permission":
165073+
operator: OR
165074+
permissions:
165075+
- org_group_read
165076+
x-unstable: |-
165077+
**Note**: This endpoint is in preview and is subject to change.
165078+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
164941165079
/api/v2/org_groups:
164942165080
get:
164943165081
description: List all organization groups that the requesting organization has access to.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// List org group policy suggestions returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OrgGroupsApi;
6+
import com.datadog.api.client.v2.model.OrgGroupPolicySuggestionListResponse;
7+
import java.util.UUID;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.listOrgGroupPolicySuggestions", true);
13+
OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);
14+
15+
try {
16+
OrgGroupPolicySuggestionListResponse result =
17+
apiInstance.listOrgGroupPolicySuggestions(
18+
UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"));
19+
System.out.println(result);
20+
} catch (ApiException e) {
21+
System.err.println("Exception when calling OrgGroupsApi#listOrgGroupPolicySuggestions");
22+
System.err.println("Status code: " + e.getCode());
23+
System.err.println("Reason: " + e.getResponseBody());
24+
System.err.println("Response headers: " + e.getResponseHeaders());
25+
e.printStackTrace();
26+
}
27+
}
28+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ public class ApiClient {
12141214
put("v2.listOrgGroupPolicies", false);
12151215
put("v2.listOrgGroupPolicyConfigs", false);
12161216
put("v2.listOrgGroupPolicyOverrides", false);
1217+
put("v2.listOrgGroupPolicySuggestions", false);
12171218
put("v2.listOrgGroups", false);
12181219
put("v2.updateOrgGroup", false);
12191220
put("v2.updateOrgGroupMembership", false);

src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideUpdateRequest;
2222
import com.datadog.api.client.v2.model.OrgGroupPolicyResponse;
2323
import com.datadog.api.client.v2.model.OrgGroupPolicySortOption;
24+
import com.datadog.api.client.v2.model.OrgGroupPolicySuggestionListResponse;
2425
import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateRequest;
2526
import com.datadog.api.client.v2.model.OrgGroupResponse;
2627
import com.datadog.api.client.v2.model.OrgGroupSortOption;
@@ -2747,6 +2748,172 @@ public ApiResponse<OrgGroupPolicyOverrideListResponse> listOrgGroupPolicyOverrid
27472748
new GenericType<OrgGroupPolicyOverrideListResponse>() {});
27482749
}
27492750

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&lt;OrgGroupPolicySuggestionListResponse&gt;
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&lt;OrgGroupPolicySuggestionListResponse&gt;
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&lt;ApiResponse&lt;OrgGroupPolicySuggestionListResponse&gt;&gt;
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+
27502917
/** Manage optional parameters to listOrgGroups. */
27512918
public static class ListOrgGroupsOptionalParameters {
27522919
private Long pageNumber;

0 commit comments

Comments
 (0)