Skip to content

Commit 3e3e026

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 81b4470 of spec repo (#3982)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1df4959 commit 3e3e026

9 files changed

Lines changed: 804 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55468,6 +55468,40 @@ components:
5546855468
type: string
5546955469
x-enum-varnames:
5547055470
- MANAGED_ORGS
55471+
MaxSessionDurationType:
55472+
description: Data type of a maximum session duration update.
55473+
enum: [max_session_duration]
55474+
example: max_session_duration
55475+
type: string
55476+
x-enum-varnames:
55477+
- MAX_SESSION_DURATION
55478+
MaxSessionDurationUpdateAttributes:
55479+
description: Attributes for the maximum session duration update request.
55480+
properties:
55481+
max_session_duration:
55482+
description: The maximum session duration, in seconds.
55483+
example: 604800
55484+
format: int64
55485+
minimum: 1
55486+
type: integer
55487+
required: [max_session_duration]
55488+
type: object
55489+
MaxSessionDurationUpdateData:
55490+
description: The data object for a maximum session duration update request.
55491+
properties:
55492+
attributes:
55493+
$ref: "#/components/schemas/MaxSessionDurationUpdateAttributes"
55494+
type:
55495+
$ref: "#/components/schemas/MaxSessionDurationType"
55496+
required: [type, attributes]
55497+
type: object
55498+
MaxSessionDurationUpdateRequest:
55499+
description: A request to update the maximum session duration for an organization.
55500+
properties:
55501+
data:
55502+
$ref: "#/components/schemas/MaxSessionDurationUpdateData"
55503+
required: [data]
55504+
type: object
5547155505
McpScanRequest:
5547255506
description: The top-level request object for submitting an MCP SCA dependency scan.
5547355507
properties:
@@ -143303,6 +143337,47 @@ paths:
143303143337
x-unstable: |-
143304143338
**Note**: This endpoint is in preview and is subject to change.
143305143339
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
143340+
/api/v2/login/org_configs/max_session_duration:
143341+
put:
143342+
description: |-
143343+
Update the maximum session duration for the current organization.
143344+
The duration is specified in seconds.
143345+
operationId: UpdateLoginOrgConfigsMaxSessionDuration
143346+
requestBody:
143347+
content:
143348+
application/json:
143349+
examples:
143350+
default:
143351+
value:
143352+
data:
143353+
attributes:
143354+
max_session_duration: 604800
143355+
type: max_session_duration
143356+
schema:
143357+
$ref: "#/components/schemas/MaxSessionDurationUpdateRequest"
143358+
required: true
143359+
responses:
143360+
"204":
143361+
description: No Content
143362+
"400":
143363+
$ref: "#/components/responses/BadRequestResponse"
143364+
"401":
143365+
$ref: "#/components/responses/UnauthorizedResponse"
143366+
"403":
143367+
$ref: "#/components/responses/ForbiddenResponse"
143368+
"429":
143369+
$ref: "#/components/responses/TooManyRequestsResponse"
143370+
security:
143371+
- apiKeyAuth: []
143372+
appKeyAuth: []
143373+
- AuthZ:
143374+
- org_management
143375+
summary: Update the maximum session duration
143376+
tags: [Organizations]
143377+
"x-permission":
143378+
operator: OR
143379+
permissions:
143380+
- org_management
143306143381
/api/v2/logs:
143307143382
post:
143308143383
description: |-
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Update the maximum session duration returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OrganizationsApi;
6+
import com.datadog.api.client.v2.model.MaxSessionDurationType;
7+
import com.datadog.api.client.v2.model.MaxSessionDurationUpdateAttributes;
8+
import com.datadog.api.client.v2.model.MaxSessionDurationUpdateData;
9+
import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequest;
10+
11+
public class Example {
12+
public static void main(String[] args) {
13+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
14+
OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
15+
16+
MaxSessionDurationUpdateRequest body =
17+
new MaxSessionDurationUpdateRequest()
18+
.data(
19+
new MaxSessionDurationUpdateData()
20+
.attributes(
21+
new MaxSessionDurationUpdateAttributes().maxSessionDuration(604800L))
22+
.type(MaxSessionDurationType.MAX_SESSION_DURATION));
23+
24+
try {
25+
apiInstance.updateLoginOrgConfigsMaxSessionDuration(body);
26+
} catch (ApiException e) {
27+
System.err.println(
28+
"Exception when calling OrganizationsApi#updateLoginOrgConfigsMaxSessionDuration");
29+
System.err.println("Status code: " + e.getCode());
30+
System.err.println("Reason: " + e.getResponseBody());
31+
System.err.println("Response headers: " + e.getResponseHeaders());
32+
e.printStackTrace();
33+
}
34+
}
35+
}

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

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.datadog.api.client.v2.model.GlobalOrgData;
99
import com.datadog.api.client.v2.model.GlobalOrgsResponse;
1010
import com.datadog.api.client.v2.model.ManagedOrgsResponse;
11+
import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequest;
1112
import com.datadog.api.client.v2.model.OrgConfigGetResponse;
1213
import com.datadog.api.client.v2.model.OrgConfigListResponse;
1314
import com.datadog.api.client.v2.model.OrgConfigWriteRequest;
@@ -997,6 +998,145 @@ public ApiResponse<SAMLConfigurationsResponse> listSAMLConfigurationsWithHttpInf
997998
new GenericType<SAMLConfigurationsResponse>() {});
998999
}
9991000

1001+
/**
1002+
* Update the maximum session duration.
1003+
*
1004+
* <p>See {@link #updateLoginOrgConfigsMaxSessionDurationWithHttpInfo}.
1005+
*
1006+
* @param body (required)
1007+
* @throws ApiException if fails to make API call
1008+
*/
1009+
public void updateLoginOrgConfigsMaxSessionDuration(MaxSessionDurationUpdateRequest body)
1010+
throws ApiException {
1011+
updateLoginOrgConfigsMaxSessionDurationWithHttpInfo(body);
1012+
}
1013+
1014+
/**
1015+
* Update the maximum session duration.
1016+
*
1017+
* <p>See {@link #updateLoginOrgConfigsMaxSessionDurationWithHttpInfoAsync}.
1018+
*
1019+
* @param body (required)
1020+
* @return CompletableFuture
1021+
*/
1022+
public CompletableFuture<Void> updateLoginOrgConfigsMaxSessionDurationAsync(
1023+
MaxSessionDurationUpdateRequest body) {
1024+
return updateLoginOrgConfigsMaxSessionDurationWithHttpInfoAsync(body)
1025+
.thenApply(
1026+
response -> {
1027+
return response.getData();
1028+
});
1029+
}
1030+
1031+
/**
1032+
* Update the maximum session duration for the current organization. The duration is specified in
1033+
* seconds.
1034+
*
1035+
* @param body (required)
1036+
* @return ApiResponse&lt;Void&gt;
1037+
* @throws ApiException if fails to make API call
1038+
* @http.response.details
1039+
* <table border="1">
1040+
* <caption>Response details</caption>
1041+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1042+
* <tr><td> 204 </td><td> No Content </td><td> - </td></tr>
1043+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
1044+
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
1045+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
1046+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1047+
* </table>
1048+
*/
1049+
public ApiResponse<Void> updateLoginOrgConfigsMaxSessionDurationWithHttpInfo(
1050+
MaxSessionDurationUpdateRequest body) throws ApiException {
1051+
Object localVarPostBody = body;
1052+
1053+
// verify the required parameter 'body' is set
1054+
if (body == null) {
1055+
throw new ApiException(
1056+
400,
1057+
"Missing the required parameter 'body' when calling"
1058+
+ " updateLoginOrgConfigsMaxSessionDuration");
1059+
}
1060+
// create path and map variables
1061+
String localVarPath = "/api/v2/login/org_configs/max_session_duration";
1062+
1063+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1064+
1065+
Invocation.Builder builder =
1066+
apiClient.createBuilder(
1067+
"v2.OrganizationsApi.updateLoginOrgConfigsMaxSessionDuration",
1068+
localVarPath,
1069+
new ArrayList<Pair>(),
1070+
localVarHeaderParams,
1071+
new HashMap<String, String>(),
1072+
new String[] {"*/*"},
1073+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
1074+
return apiClient.invokeAPI(
1075+
"PUT",
1076+
builder,
1077+
localVarHeaderParams,
1078+
new String[] {"application/json"},
1079+
localVarPostBody,
1080+
new HashMap<String, Object>(),
1081+
false,
1082+
null);
1083+
}
1084+
1085+
/**
1086+
* Update the maximum session duration.
1087+
*
1088+
* <p>See {@link #updateLoginOrgConfigsMaxSessionDurationWithHttpInfo}.
1089+
*
1090+
* @param body (required)
1091+
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
1092+
*/
1093+
public CompletableFuture<ApiResponse<Void>>
1094+
updateLoginOrgConfigsMaxSessionDurationWithHttpInfoAsync(
1095+
MaxSessionDurationUpdateRequest body) {
1096+
Object localVarPostBody = body;
1097+
1098+
// verify the required parameter 'body' is set
1099+
if (body == null) {
1100+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1101+
result.completeExceptionally(
1102+
new ApiException(
1103+
400,
1104+
"Missing the required parameter 'body' when calling"
1105+
+ " updateLoginOrgConfigsMaxSessionDuration"));
1106+
return result;
1107+
}
1108+
// create path and map variables
1109+
String localVarPath = "/api/v2/login/org_configs/max_session_duration";
1110+
1111+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1112+
1113+
Invocation.Builder builder;
1114+
try {
1115+
builder =
1116+
apiClient.createBuilder(
1117+
"v2.OrganizationsApi.updateLoginOrgConfigsMaxSessionDuration",
1118+
localVarPath,
1119+
new ArrayList<Pair>(),
1120+
localVarHeaderParams,
1121+
new HashMap<String, String>(),
1122+
new String[] {"*/*"},
1123+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
1124+
} catch (ApiException ex) {
1125+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1126+
result.completeExceptionally(ex);
1127+
return result;
1128+
}
1129+
return apiClient.invokeAPIAsync(
1130+
"PUT",
1131+
builder,
1132+
localVarHeaderParams,
1133+
new String[] {"application/json"},
1134+
localVarPostBody,
1135+
new HashMap<String, Object>(),
1136+
false,
1137+
null);
1138+
}
1139+
10001140
/**
10011141
* Update a specific Org Config.
10021142
*
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.datadog.api.client.ModelEnum;
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
import com.fasterxml.jackson.core.JsonGenerator;
12+
import com.fasterxml.jackson.core.JsonProcessingException;
13+
import com.fasterxml.jackson.databind.SerializerProvider;
14+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15+
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
16+
import java.io.IOException;
17+
import java.util.Arrays;
18+
import java.util.HashSet;
19+
import java.util.Set;
20+
21+
/** Data type of a maximum session duration update. */
22+
@JsonSerialize(using = MaxSessionDurationType.MaxSessionDurationTypeSerializer.class)
23+
public class MaxSessionDurationType extends ModelEnum<String> {
24+
25+
private static final Set<String> allowedValues =
26+
new HashSet<String>(Arrays.asList("max_session_duration"));
27+
28+
public static final MaxSessionDurationType MAX_SESSION_DURATION =
29+
new MaxSessionDurationType("max_session_duration");
30+
31+
MaxSessionDurationType(String value) {
32+
super(value, allowedValues);
33+
}
34+
35+
public static class MaxSessionDurationTypeSerializer
36+
extends StdSerializer<MaxSessionDurationType> {
37+
public MaxSessionDurationTypeSerializer(Class<MaxSessionDurationType> t) {
38+
super(t);
39+
}
40+
41+
public MaxSessionDurationTypeSerializer() {
42+
this(null);
43+
}
44+
45+
@Override
46+
public void serialize(
47+
MaxSessionDurationType value, JsonGenerator jgen, SerializerProvider provider)
48+
throws IOException, JsonProcessingException {
49+
jgen.writeObject(value.value);
50+
}
51+
}
52+
53+
@JsonCreator
54+
public static MaxSessionDurationType fromValue(String value) {
55+
return new MaxSessionDurationType(value);
56+
}
57+
}

0 commit comments

Comments
 (0)