Skip to content

Commit b03e38d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fab55767 of spec repo
1 parent 65b1673 commit b03e38d

File tree

10 files changed

+966
-15
lines changed

10 files changed

+966
-15
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-14 15:59:05.257063",
8-
"spec_repo_commit": "0457044b"
7+
"regenerated": "2025-01-14 18:26:34.949262",
8+
"spec_repo_commit": "fab55767"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-14 15:59:05.292969",
13-
"spec_repo_commit": "0457044b"
12+
"regenerated": "2025-01-14 18:26:34.964339",
13+
"spec_repo_commit": "fab55767"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7145,6 +7145,38 @@ components:
71457145
type: string
71467146
x-enum-varnames:
71477147
- APPDEFINITIONS
7148+
CreateCustomFrameworkRequest:
7149+
description: Create a custom framework.
7150+
properties:
7151+
description:
7152+
description: Framework Description
7153+
type: string
7154+
handle:
7155+
description: Framework Handle
7156+
example: ''
7157+
type: string
7158+
icon_url:
7159+
description: Framework Icon URL
7160+
type: string
7161+
name:
7162+
description: Framework Name
7163+
example: ''
7164+
type: string
7165+
requirements:
7166+
description: Framework Requirements
7167+
items:
7168+
$ref: '#/components/schemas/FrameworkRequirement'
7169+
type: array
7170+
version:
7171+
description: Framework Version
7172+
example: ''
7173+
type: string
7174+
required:
7175+
- handle
7176+
- version
7177+
- name
7178+
- requirements
7179+
type: object
71487180
CreateDataDeletionRequestBody:
71497181
description: Object needed to create a data deletion request.
71507182
properties:
@@ -11936,6 +11968,40 @@ components:
1193611968
order:
1193711969
$ref: '#/components/schemas/QuerySortOrder'
1193811970
type: object
11971+
FrameworkControl:
11972+
description: Framework Control.
11973+
properties:
11974+
name:
11975+
description: Control Name.
11976+
example: ''
11977+
type: string
11978+
rule_ids:
11979+
description: Rule IDs.
11980+
example:
11981+
- ''
11982+
items:
11983+
type: string
11984+
type: array
11985+
required:
11986+
- name
11987+
- rule_ids
11988+
type: object
11989+
FrameworkRequirement:
11990+
description: Framework Requirement.
11991+
properties:
11992+
controls:
11993+
description: Requirement Controls.
11994+
items:
11995+
$ref: '#/components/schemas/FrameworkControl'
11996+
type: array
11997+
name:
11998+
description: Requirement Name.
11999+
example: ''
12000+
type: string
12001+
required:
12002+
- name
12003+
- controls
12004+
type: object
1193912005
FullAPIKey:
1194012006
description: Datadog API key.
1194112007
properties:
@@ -33028,6 +33094,40 @@ paths:
3302833094
operator: OR
3302933095
permissions:
3303033096
- ci_visibility_read
33097+
/api/v2/cloud_security_management/custom_frameworks:
33098+
post:
33099+
description: Create a custom framework.
33100+
operationId: CreateCustomFramework
33101+
requestBody:
33102+
content:
33103+
application/json:
33104+
schema:
33105+
$ref: '#/components/schemas/CreateCustomFrameworkRequest'
33106+
required: true
33107+
responses:
33108+
'200':
33109+
description: OK
33110+
'400':
33111+
$ref: '#/components/responses/BadRequestResponse'
33112+
'429':
33113+
$ref: '#/components/responses/TooManyRequestsResponse'
33114+
'500':
33115+
$ref: '#/components/responses/BadRequestResponse'
33116+
security:
33117+
- apiKeyAuth: []
33118+
appKeyAuth: []
33119+
- AuthZ:
33120+
- security_monitoring_rules_read
33121+
- security_monitoring_rules_write
33122+
summary: Create a custom framework
33123+
tags:
33124+
- Security Monitoring
33125+
x-codegen-request-body-name: body
33126+
x-permission:
33127+
operator: AND
33128+
permissions:
33129+
- security_monitoring_rules_read
33130+
- security_monitoring_rules_write
3303133131
/api/v2/container_images:
3303233132
get:
3303333133
description: Get all Container Images for your organization.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Create a custom framework 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.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest;
7+
import com.datadog.api.client.v2.model.FrameworkControl;
8+
import com.datadog.api.client.v2.model.FrameworkRequirement;
9+
import java.util.Collections;
10+
11+
public class Example {
12+
public static void main(String[] args) {
13+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
14+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
15+
16+
CreateCustomFrameworkRequest body =
17+
new CreateCustomFrameworkRequest()
18+
.handle("")
19+
.name("")
20+
.requirements(
21+
Collections.singletonList(
22+
new FrameworkRequirement()
23+
.controls(
24+
Collections.singletonList(
25+
new FrameworkControl()
26+
.name("")
27+
.ruleIds(Collections.singletonList(""))))
28+
.name("")))
29+
.version("");
30+
31+
try {
32+
apiInstance.createCustomFramework(body);
33+
} catch (ApiException e) {
34+
System.err.println("Exception when calling SecurityMonitoringApi#createCustomFramework");
35+
System.err.println("Status code: " + e.getCode());
36+
System.err.println("Reason: " + e.getResponseBody());
37+
System.err.println("Response headers: " + e.getResponseHeaders());
38+
e.printStackTrace();
39+
}
40+
}
41+
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,17 @@ public class ApiClient {
380380
put("v2.getApp", false);
381381
put("v2.listApps", false);
382382
put("v2.updateApp", false);
383+
put("v2.cancelHistoricalJob", false);
384+
put("v2.convertJobResultToSignal", false);
385+
put("v2.deleteHistoricalJob", false);
386+
put("v2.getFinding", false);
387+
put("v2.getHistoricalJob", false);
388+
put("v2.listFindings", false);
389+
put("v2.listHistoricalJobs", false);
390+
put("v2.listVulnerabilities", false);
391+
put("v2.listVulnerableAssets", false);
392+
put("v2.muteFindings", false);
393+
put("v2.runHistoricalJob", false);
383394
put("v2.getActiveBillingDimensions", false);
384395
put("v2.getBillingDimensionMapping", false);
385396
put("v2.getMonthlyCostAttribution", false);
@@ -419,17 +430,6 @@ public class ApiClient {
419430
put("v2.listAWSNamespaces", false);
420431
put("v2.updateAWSAccount", false);
421432
put("v2.listAWSLogsServices", false);
422-
put("v2.cancelHistoricalJob", false);
423-
put("v2.convertJobResultToSignal", false);
424-
put("v2.deleteHistoricalJob", false);
425-
put("v2.getFinding", false);
426-
put("v2.getHistoricalJob", false);
427-
put("v2.listFindings", false);
428-
put("v2.listHistoricalJobs", false);
429-
put("v2.listVulnerabilities", false);
430-
put("v2.listVulnerableAssets", false);
431-
put("v2.muteFindings", false);
432-
put("v2.runHistoricalJob", false);
433433
put("v2.createScorecardOutcomesBatch", false);
434434
put("v2.createScorecardRule", false);
435435
put("v2.deleteScorecardRule", false);

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

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.datadog.api.client.v2.model.BulkMuteFindingsRequest;
1010
import com.datadog.api.client.v2.model.BulkMuteFindingsResponse;
1111
import com.datadog.api.client.v2.model.ConvertJobResultsToSignalsRequest;
12+
import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest;
1213
import com.datadog.api.client.v2.model.Finding;
1314
import com.datadog.api.client.v2.model.FindingEvaluation;
1415
import com.datadog.api.client.v2.model.FindingStatus;
@@ -686,6 +687,136 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS
686687
new GenericType<SecurityMonitoringRuleConvertResponse>() {});
687688
}
688689

690+
/**
691+
* Create a custom framework.
692+
*
693+
* <p>See {@link #createCustomFrameworkWithHttpInfo}.
694+
*
695+
* @param body (required)
696+
* @throws ApiException if fails to make API call
697+
*/
698+
public void createCustomFramework(CreateCustomFrameworkRequest body) throws ApiException {
699+
createCustomFrameworkWithHttpInfo(body);
700+
}
701+
702+
/**
703+
* Create a custom framework.
704+
*
705+
* <p>See {@link #createCustomFrameworkWithHttpInfoAsync}.
706+
*
707+
* @param body (required)
708+
* @return CompletableFuture
709+
*/
710+
public CompletableFuture<Void> createCustomFrameworkAsync(CreateCustomFrameworkRequest body) {
711+
return createCustomFrameworkWithHttpInfoAsync(body)
712+
.thenApply(
713+
response -> {
714+
return response.getData();
715+
});
716+
}
717+
718+
/**
719+
* Create a custom framework.
720+
*
721+
* @param body (required)
722+
* @return ApiResponse&lt;Void&gt;
723+
* @throws ApiException if fails to make API call
724+
* @http.response.details
725+
* <table border="1">
726+
* <caption>Response details</caption>
727+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
728+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
729+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
730+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
731+
* <tr><td> 500 </td><td> Bad Request </td><td> - </td></tr>
732+
* </table>
733+
*/
734+
public ApiResponse<Void> createCustomFrameworkWithHttpInfo(CreateCustomFrameworkRequest body)
735+
throws ApiException {
736+
Object localVarPostBody = body;
737+
738+
// verify the required parameter 'body' is set
739+
if (body == null) {
740+
throw new ApiException(
741+
400, "Missing the required parameter 'body' when calling createCustomFramework");
742+
}
743+
// create path and map variables
744+
String localVarPath = "/api/v2/cloud_security_management/custom_frameworks";
745+
746+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
747+
748+
Invocation.Builder builder =
749+
apiClient.createBuilder(
750+
"v2.SecurityMonitoringApi.createCustomFramework",
751+
localVarPath,
752+
new ArrayList<Pair>(),
753+
localVarHeaderParams,
754+
new HashMap<String, String>(),
755+
new String[] {"*/*"},
756+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
757+
return apiClient.invokeAPI(
758+
"POST",
759+
builder,
760+
localVarHeaderParams,
761+
new String[] {"application/json"},
762+
localVarPostBody,
763+
new HashMap<String, Object>(),
764+
false,
765+
null);
766+
}
767+
768+
/**
769+
* Create a custom framework.
770+
*
771+
* <p>See {@link #createCustomFrameworkWithHttpInfo}.
772+
*
773+
* @param body (required)
774+
* @return CompletableFuture&lt;ApiResponse&lt;Void&gt;&gt;
775+
*/
776+
public CompletableFuture<ApiResponse<Void>> createCustomFrameworkWithHttpInfoAsync(
777+
CreateCustomFrameworkRequest body) {
778+
Object localVarPostBody = body;
779+
780+
// verify the required parameter 'body' is set
781+
if (body == null) {
782+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
783+
result.completeExceptionally(
784+
new ApiException(
785+
400, "Missing the required parameter 'body' when calling createCustomFramework"));
786+
return result;
787+
}
788+
// create path and map variables
789+
String localVarPath = "/api/v2/cloud_security_management/custom_frameworks";
790+
791+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
792+
793+
Invocation.Builder builder;
794+
try {
795+
builder =
796+
apiClient.createBuilder(
797+
"v2.SecurityMonitoringApi.createCustomFramework",
798+
localVarPath,
799+
new ArrayList<Pair>(),
800+
localVarHeaderParams,
801+
new HashMap<String, String>(),
802+
new String[] {"*/*"},
803+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
804+
} catch (ApiException ex) {
805+
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
806+
result.completeExceptionally(ex);
807+
return result;
808+
}
809+
return apiClient.invokeAPIAsync(
810+
"POST",
811+
builder,
812+
localVarHeaderParams,
813+
new String[] {"application/json"},
814+
localVarPostBody,
815+
new HashMap<String, Object>(),
816+
false,
817+
null);
818+
}
819+
689820
/**
690821
* Create a security filter.
691822
*

0 commit comments

Comments
 (0)