|
8 | 8 | import com.datadog.api.client.v2.model.GlobalOrgData; |
9 | 9 | import com.datadog.api.client.v2.model.GlobalOrgsResponse; |
10 | 10 | import com.datadog.api.client.v2.model.ManagedOrgsResponse; |
| 11 | +import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequest; |
11 | 12 | import com.datadog.api.client.v2.model.OrgConfigGetResponse; |
12 | 13 | import com.datadog.api.client.v2.model.OrgConfigListResponse; |
13 | 14 | import com.datadog.api.client.v2.model.OrgConfigWriteRequest; |
@@ -997,6 +998,145 @@ public ApiResponse<SAMLConfigurationsResponse> listSAMLConfigurationsWithHttpInf |
997 | 998 | new GenericType<SAMLConfigurationsResponse>() {}); |
998 | 999 | } |
999 | 1000 |
|
| 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<Void> |
| 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<ApiResponse<Void>> |
| 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 | + |
1000 | 1140 | /** |
1001 | 1141 | * Update a specific Org Config. |
1002 | 1142 | * |
|
0 commit comments