|
5 | 5 | import com.datadog.api.client.ApiResponse; |
6 | 6 | import com.datadog.api.client.Pair; |
7 | 7 | import com.datadog.api.client.v2.model.DORADeploymentFetchResponse; |
| 8 | +import com.datadog.api.client.v2.model.DORADeploymentPatchRequest; |
8 | 9 | import com.datadog.api.client.v2.model.DORADeploymentRequest; |
9 | 10 | import com.datadog.api.client.v2.model.DORADeploymentResponse; |
10 | 11 | import com.datadog.api.client.v2.model.DORADeploymentsListResponse; |
@@ -1279,4 +1280,166 @@ public CompletableFuture<ApiResponse<DORAFailuresListResponse>> listDORAFailures |
1279 | 1280 | false, |
1280 | 1281 | new GenericType<DORAFailuresListResponse>() {}); |
1281 | 1282 | } |
| 1283 | + |
| 1284 | + /** |
| 1285 | + * Patch a deployment event. |
| 1286 | + * |
| 1287 | + * <p>See {@link #patchDORADeploymentWithHttpInfo}. |
| 1288 | + * |
| 1289 | + * @param deploymentId The ID of the deployment event. (required) |
| 1290 | + * @param body (required) |
| 1291 | + * @return DORADeploymentFetchResponse |
| 1292 | + * @throws ApiException if fails to make API call |
| 1293 | + */ |
| 1294 | + public DORADeploymentFetchResponse patchDORADeployment( |
| 1295 | + String deploymentId, DORADeploymentPatchRequest body) throws ApiException { |
| 1296 | + return patchDORADeploymentWithHttpInfo(deploymentId, body).getData(); |
| 1297 | + } |
| 1298 | + |
| 1299 | + /** |
| 1300 | + * Patch a deployment event. |
| 1301 | + * |
| 1302 | + * <p>See {@link #patchDORADeploymentWithHttpInfoAsync}. |
| 1303 | + * |
| 1304 | + * @param deploymentId The ID of the deployment event. (required) |
| 1305 | + * @param body (required) |
| 1306 | + * @return CompletableFuture<DORADeploymentFetchResponse> |
| 1307 | + */ |
| 1308 | + public CompletableFuture<DORADeploymentFetchResponse> patchDORADeploymentAsync( |
| 1309 | + String deploymentId, DORADeploymentPatchRequest body) { |
| 1310 | + return patchDORADeploymentWithHttpInfoAsync(deploymentId, body) |
| 1311 | + .thenApply( |
| 1312 | + response -> { |
| 1313 | + return response.getData(); |
| 1314 | + }); |
| 1315 | + } |
| 1316 | + |
| 1317 | + /** |
| 1318 | + * Use this API endpoint to patch a deployment event. |
| 1319 | + * |
| 1320 | + * @param deploymentId The ID of the deployment event. (required) |
| 1321 | + * @param body (required) |
| 1322 | + * @return ApiResponse<DORADeploymentFetchResponse> |
| 1323 | + * @throws ApiException if fails to make API call |
| 1324 | + * @http.response.details |
| 1325 | + * <table border="1"> |
| 1326 | + * <caption>Response details</caption> |
| 1327 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 1328 | + * <tr><td> 202 </td><td> Accepted </td><td> - </td></tr> |
| 1329 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 1330 | + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> |
| 1331 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 1332 | + * </table> |
| 1333 | + */ |
| 1334 | + public ApiResponse<DORADeploymentFetchResponse> patchDORADeploymentWithHttpInfo( |
| 1335 | + String deploymentId, DORADeploymentPatchRequest body) throws ApiException { |
| 1336 | + Object localVarPostBody = body; |
| 1337 | + |
| 1338 | + // verify the required parameter 'deploymentId' is set |
| 1339 | + if (deploymentId == null) { |
| 1340 | + throw new ApiException( |
| 1341 | + 400, "Missing the required parameter 'deploymentId' when calling patchDORADeployment"); |
| 1342 | + } |
| 1343 | + |
| 1344 | + // verify the required parameter 'body' is set |
| 1345 | + if (body == null) { |
| 1346 | + throw new ApiException( |
| 1347 | + 400, "Missing the required parameter 'body' when calling patchDORADeployment"); |
| 1348 | + } |
| 1349 | + // create path and map variables |
| 1350 | + String localVarPath = |
| 1351 | + "/api/v2/dora/deployments/{deployment_id}" |
| 1352 | + .replaceAll( |
| 1353 | + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); |
| 1354 | + |
| 1355 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1356 | + |
| 1357 | + Invocation.Builder builder = |
| 1358 | + apiClient.createBuilder( |
| 1359 | + "v2.DoraMetricsApi.patchDORADeployment", |
| 1360 | + localVarPath, |
| 1361 | + new ArrayList<Pair>(), |
| 1362 | + localVarHeaderParams, |
| 1363 | + new HashMap<String, String>(), |
| 1364 | + new String[] {"application/json"}, |
| 1365 | + new String[] {"apiKeyAuth", "appKeyAuth"}); |
| 1366 | + return apiClient.invokeAPI( |
| 1367 | + "PATCH", |
| 1368 | + builder, |
| 1369 | + localVarHeaderParams, |
| 1370 | + new String[] {"application/json"}, |
| 1371 | + localVarPostBody, |
| 1372 | + new HashMap<String, Object>(), |
| 1373 | + false, |
| 1374 | + new GenericType<DORADeploymentFetchResponse>() {}); |
| 1375 | + } |
| 1376 | + |
| 1377 | + /** |
| 1378 | + * Patch a deployment event. |
| 1379 | + * |
| 1380 | + * <p>See {@link #patchDORADeploymentWithHttpInfo}. |
| 1381 | + * |
| 1382 | + * @param deploymentId The ID of the deployment event. (required) |
| 1383 | + * @param body (required) |
| 1384 | + * @return CompletableFuture<ApiResponse<DORADeploymentFetchResponse>> |
| 1385 | + */ |
| 1386 | + public CompletableFuture<ApiResponse<DORADeploymentFetchResponse>> |
| 1387 | + patchDORADeploymentWithHttpInfoAsync(String deploymentId, DORADeploymentPatchRequest body) { |
| 1388 | + Object localVarPostBody = body; |
| 1389 | + |
| 1390 | + // verify the required parameter 'deploymentId' is set |
| 1391 | + if (deploymentId == null) { |
| 1392 | + CompletableFuture<ApiResponse<DORADeploymentFetchResponse>> result = |
| 1393 | + new CompletableFuture<>(); |
| 1394 | + result.completeExceptionally( |
| 1395 | + new ApiException( |
| 1396 | + 400, |
| 1397 | + "Missing the required parameter 'deploymentId' when calling patchDORADeployment")); |
| 1398 | + return result; |
| 1399 | + } |
| 1400 | + |
| 1401 | + // verify the required parameter 'body' is set |
| 1402 | + if (body == null) { |
| 1403 | + CompletableFuture<ApiResponse<DORADeploymentFetchResponse>> result = |
| 1404 | + new CompletableFuture<>(); |
| 1405 | + result.completeExceptionally( |
| 1406 | + new ApiException( |
| 1407 | + 400, "Missing the required parameter 'body' when calling patchDORADeployment")); |
| 1408 | + return result; |
| 1409 | + } |
| 1410 | + // create path and map variables |
| 1411 | + String localVarPath = |
| 1412 | + "/api/v2/dora/deployments/{deployment_id}" |
| 1413 | + .replaceAll( |
| 1414 | + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); |
| 1415 | + |
| 1416 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1417 | + |
| 1418 | + Invocation.Builder builder; |
| 1419 | + try { |
| 1420 | + builder = |
| 1421 | + apiClient.createBuilder( |
| 1422 | + "v2.DoraMetricsApi.patchDORADeployment", |
| 1423 | + localVarPath, |
| 1424 | + new ArrayList<Pair>(), |
| 1425 | + localVarHeaderParams, |
| 1426 | + new HashMap<String, String>(), |
| 1427 | + new String[] {"application/json"}, |
| 1428 | + new String[] {"apiKeyAuth", "appKeyAuth"}); |
| 1429 | + } catch (ApiException ex) { |
| 1430 | + CompletableFuture<ApiResponse<DORADeploymentFetchResponse>> result = |
| 1431 | + new CompletableFuture<>(); |
| 1432 | + result.completeExceptionally(ex); |
| 1433 | + return result; |
| 1434 | + } |
| 1435 | + return apiClient.invokeAPIAsync( |
| 1436 | + "PATCH", |
| 1437 | + builder, |
| 1438 | + localVarHeaderParams, |
| 1439 | + new String[] {"application/json"}, |
| 1440 | + localVarPostBody, |
| 1441 | + new HashMap<String, Object>(), |
| 1442 | + false, |
| 1443 | + new GenericType<DORADeploymentFetchResponse>() {}); |
| 1444 | + } |
1282 | 1445 | } |
0 commit comments