Skip to content

Commit b6a0c0c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 898cd727 of spec repo
1 parent 6ded755 commit b6a0c0c

File tree

9 files changed

+1066
-4
lines changed

9 files changed

+1066
-4
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-13 18:28:02.734157",
8-
"spec_repo_commit": "3517c947"
7+
"regenerated": "2025-01-14 17:10:34.983026",
8+
"spec_repo_commit": "898cd727"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-13 18:28:02.749067",
13-
"spec_repo_commit": "3517c947"
12+
"regenerated": "2025-01-14 17:10:34.998786",
13+
"spec_repo_commit": "898cd727"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ components:
213213
required: true
214214
schema:
215215
type: string
216+
CustomFrameworkOrgID:
217+
description: The ID of the organization.
218+
in: path
219+
name: org_id
220+
required: true
221+
schema:
222+
type: string
216223
EntityID:
217224
description: UUID or Entity Ref.
218225
in: path
@@ -7145,6 +7152,44 @@ components:
71457152
type: string
71467153
x-enum-varnames:
71477154
- APPDEFINITIONS
7155+
CreateCustomFrameworkRequest:
7156+
description: Create a custom framework.
7157+
properties:
7158+
description:
7159+
description: Framework Description
7160+
type: string
7161+
handle:
7162+
description: Framework Handle
7163+
example: ''
7164+
type: string
7165+
icon_url:
7166+
description: Framework Icon URL
7167+
type: string
7168+
id:
7169+
description: Custom Framework ID
7170+
type: string
7171+
name:
7172+
description: Framework Name
7173+
example: ''
7174+
type: string
7175+
requirements:
7176+
description: Framework Requirements
7177+
items:
7178+
$ref: '#/components/schemas/FrameworkRequirement'
7179+
type: array
7180+
user_email:
7181+
description: Framework Creator
7182+
type: string
7183+
version:
7184+
description: Framework Version
7185+
example: ''
7186+
type: string
7187+
required:
7188+
- handle
7189+
- version
7190+
- name
7191+
- requirements
7192+
type: object
71487193
CreateDataDeletionRequestBody:
71497194
description: Object needed to create a data deletion request.
71507195
properties:
@@ -11936,6 +11981,40 @@ components:
1193611981
order:
1193711982
$ref: '#/components/schemas/QuerySortOrder'
1193811983
type: object
11984+
FrameworkControl:
11985+
description: Framework Control.
11986+
properties:
11987+
name:
11988+
description: Control Name.
11989+
example: ''
11990+
type: string
11991+
rule_ids:
11992+
description: Rule IDs.
11993+
example:
11994+
- ''
11995+
items:
11996+
type: string
11997+
type: array
11998+
required:
11999+
- name
12000+
- rule_ids
12001+
type: object
12002+
FrameworkRequirement:
12003+
description: Framework Requirement.
12004+
properties:
12005+
controls:
12006+
description: Requirement Controls.
12007+
items:
12008+
$ref: '#/components/schemas/FrameworkControl'
12009+
type: array
12010+
name:
12011+
description: Requirement Name.
12012+
example: ''
12013+
type: string
12014+
required:
12015+
- name
12016+
- controls
12017+
type: object
1193912018
FullAPIKey:
1194012019
description: Datadog API key.
1194112020
properties:
@@ -30263,6 +30342,12 @@ components:
3026330342
scheme: bearer
3026430343
type: http
3026530344
x-env-name: DD_BEARER_TOKEN
30345+
userAuth:
30346+
description: Your Datadog User ID.
30347+
in: header
30348+
name: X-Datadog-UserId
30349+
type: http
30350+
x-env-name: X_Datadog_UserId
3026630351
info:
3026730352
contact:
3026830353
email: support@datadoghq.com
@@ -40135,6 +40220,43 @@ paths:
4013540220
operator: OR
4013640221
permissions:
4013740222
- org_management
40223+
/api/v2/orgs/{org_id}/cloud_security_management/custom_frameworks:
40224+
post:
40225+
description: Create a custom framework.
40226+
operationId: CreateCustomFramework
40227+
parameters:
40228+
- $ref: '#/components/parameters/CustomFrameworkOrgID'
40229+
requestBody:
40230+
content:
40231+
application/json:
40232+
schema:
40233+
$ref: '#/components/schemas/CreateCustomFrameworkRequest'
40234+
required: true
40235+
responses:
40236+
'200':
40237+
description: OK
40238+
'400':
40239+
$ref: '#/components/responses/BadRequestResponse'
40240+
'429':
40241+
$ref: '#/components/responses/TooManyRequestsResponse'
40242+
'500':
40243+
$ref: '#/components/responses/BadRequestResponse'
40244+
security:
40245+
- apiKeyAuth: []
40246+
appKeyAuth: []
40247+
userAuth: []
40248+
- AuthZ:
40249+
- security_monitoring_rules_read
40250+
- security_monitoring_rules_write
40251+
summary: Create a custom framework
40252+
tags:
40253+
- Security Monitoring
40254+
x-codegen-request-body-name: body
40255+
x-permission:
40256+
operator: AND
40257+
permissions:
40258+
- security_monitoring_rules_read
40259+
- security_monitoring_rules_write
4013840260
/api/v2/permissions:
4013940261
get:
4014040262
description: Returns a list of all permissions, including name, description,
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("org_id", 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/v2/api/SecurityMonitoringApi.java

Lines changed: 156 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,161 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS
686687
new GenericType<SecurityMonitoringRuleConvertResponse>() {});
687688
}
688689

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

0 commit comments

Comments
 (0)