Skip to content

Commit b13d66c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e1f3e97 of spec repo
1 parent 9b1d4cb commit b13d66c

File tree

11 files changed

+1188
-0
lines changed

11 files changed

+1188
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16972,6 +16972,89 @@ components:
1697216972
- started_at
1697316973
- finished_at
1697416974
type: object
16975+
DORADeploymentPatchRemediation:
16976+
description: Remediation details for the deployment.
16977+
properties:
16978+
id:
16979+
description: The ID of the remediation action.
16980+
example: eG42zNIkVjM
16981+
type: string
16982+
type:
16983+
$ref: '#/components/schemas/DORADeploymentPatchRemediationType'
16984+
required:
16985+
- id
16986+
- type
16987+
type: object
16988+
DORADeploymentPatchRemediationType:
16989+
description: The type of remediation action taken.
16990+
enum:
16991+
- rollback
16992+
- rollforward
16993+
example: rollback
16994+
type: string
16995+
x-enum-varnames:
16996+
- ROLLBACK
16997+
- ROLLFORWARD
16998+
DORADeploymentPatchRequest:
16999+
description: Request to patch a DORA deployment event.
17000+
example:
17001+
data:
17002+
attributes:
17003+
change_failure: true
17004+
remediation:
17005+
id: eG42zNIkVjM
17006+
type: rollback
17007+
id: z_RwVLi7v4Y
17008+
type: dora_deployment_patch_request
17009+
properties:
17010+
data:
17011+
$ref: '#/components/schemas/DORADeploymentPatchRequestData'
17012+
required:
17013+
- data
17014+
type: object
17015+
DORADeploymentPatchRequestAttributes:
17016+
description: Attributes for patching a DORA deployment event.
17017+
properties:
17018+
change_failure:
17019+
description: Indicates whether the deployment resulted in a change failure.
17020+
example: true
17021+
type: boolean
17022+
remediation:
17023+
$ref: '#/components/schemas/DORADeploymentPatchRemediation'
17024+
type: object
17025+
DORADeploymentPatchRequestData:
17026+
description: The JSON:API data for patching a deployment.
17027+
example:
17028+
attributes:
17029+
change_failure: true
17030+
remediation:
17031+
id: eG42zNIkVjM
17032+
type: rollback
17033+
id: z_RwVLi7v4Y
17034+
type: dora_deployment_patch_request
17035+
properties:
17036+
attributes:
17037+
$ref: '#/components/schemas/DORADeploymentPatchRequestAttributes'
17038+
id:
17039+
description: The ID of the deployment to patch.
17040+
example: z_RwVLi7v4Y
17041+
type: string
17042+
type:
17043+
$ref: '#/components/schemas/DORADeploymentPatchRequestDataType'
17044+
required:
17045+
- type
17046+
- id
17047+
- attributes
17048+
type: object
17049+
DORADeploymentPatchRequestDataType:
17050+
default: dora_deployment_patch_request
17051+
description: JSON:API type for DORA deployment patch request.
17052+
enum:
17053+
- dora_deployment_patch_request
17054+
example: dora_deployment_patch_request
17055+
type: string
17056+
x-enum-varnames:
17057+
- DORA_DEPLOYMENT_PATCH_REQUEST
1697517058
DORADeploymentRequest:
1697617059
description: Request to create a DORA deployment event.
1697717060
properties:
@@ -74114,6 +74197,50 @@ paths:
7411474197
operator: OR
7411574198
permissions:
7411674199
- dora_metrics_read
74200+
patch:
74201+
description: Use this API endpoint to patch a deployment event.
74202+
operationId: PatchDORADeployment
74203+
parameters:
74204+
- description: The ID of the deployment event.
74205+
in: path
74206+
name: deployment_id
74207+
required: true
74208+
schema:
74209+
type: string
74210+
requestBody:
74211+
content:
74212+
application/json:
74213+
schema:
74214+
$ref: '#/components/schemas/DORADeploymentPatchRequest'
74215+
required: true
74216+
responses:
74217+
'202':
74218+
content:
74219+
application/json:
74220+
schema:
74221+
$ref: '#/components/schemas/DORADeploymentFetchResponse'
74222+
description: Accepted
74223+
'400':
74224+
content:
74225+
application/json:
74226+
schema:
74227+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74228+
description: Bad Request
74229+
'403':
74230+
$ref: '#/components/responses/NotAuthorizedResponse'
74231+
'429':
74232+
$ref: '#/components/responses/TooManyRequestsResponse'
74233+
security:
74234+
- apiKeyAuth: []
74235+
appKeyAuth: []
74236+
summary: Patch a deployment event
74237+
tags:
74238+
- DORA Metrics
74239+
x-codegen-request-body-name: body
74240+
x-permission:
74241+
operator: OR
74242+
permissions:
74243+
- dora_metrics_write
7411774244
/api/v2/dora/failure:
7411874245
post:
7411974246
description: 'Use this API endpoint to provide failure data.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Patch a deployment event returns "Accepted" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DoraMetricsApi;
6+
import com.datadog.api.client.v2.model.DORADeploymentFetchResponse;
7+
import com.datadog.api.client.v2.model.DORADeploymentPatchRemediation;
8+
import com.datadog.api.client.v2.model.DORADeploymentPatchRemediationType;
9+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequest;
10+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequestAttributes;
11+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequestData;
12+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequestDataType;
13+
14+
public class Example {
15+
public static void main(String[] args) {
16+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
17+
DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient);
18+
19+
DORADeploymentPatchRequest body =
20+
new DORADeploymentPatchRequest()
21+
.data(
22+
new DORADeploymentPatchRequestData()
23+
.attributes(
24+
new DORADeploymentPatchRequestAttributes()
25+
.changeFailure(true)
26+
.remediation(
27+
new DORADeploymentPatchRemediation()
28+
.id("eG42zNIkVjM")
29+
.type(DORADeploymentPatchRemediationType.ROLLBACK)))
30+
.id("z_RwVLi7v4Y")
31+
.type(DORADeploymentPatchRequestDataType.DORA_DEPLOYMENT_PATCH_REQUEST));
32+
33+
try {
34+
DORADeploymentFetchResponse result = apiInstance.patchDORADeployment("deployment_id", body);
35+
System.out.println(result);
36+
} catch (ApiException e) {
37+
System.err.println("Exception when calling DoraMetricsApi#patchDORADeployment");
38+
System.err.println("Status code: " + e.getCode());
39+
System.err.println("Reason: " + e.getResponseBody());
40+
System.err.println("Response headers: " + e.getResponseHeaders());
41+
e.printStackTrace();
42+
}
43+
}
44+
}

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

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.datadog.api.client.ApiResponse;
66
import com.datadog.api.client.Pair;
77
import com.datadog.api.client.v2.model.DORADeploymentFetchResponse;
8+
import com.datadog.api.client.v2.model.DORADeploymentPatchRequest;
89
import com.datadog.api.client.v2.model.DORADeploymentRequest;
910
import com.datadog.api.client.v2.model.DORADeploymentResponse;
1011
import com.datadog.api.client.v2.model.DORADeploymentsListResponse;
@@ -1279,4 +1280,166 @@ public CompletableFuture<ApiResponse<DORAFailuresListResponse>> listDORAFailures
12791280
false,
12801281
new GenericType<DORAFailuresListResponse>() {});
12811282
}
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&lt;DORADeploymentFetchResponse&gt;
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&lt;DORADeploymentFetchResponse&gt;
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&lt;ApiResponse&lt;DORADeploymentFetchResponse&gt;&gt;
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+
}
12821445
}

0 commit comments

Comments
 (0)