diff --git a/.apigentools-info b/.apigentools-info index 50dbee062a4..e2336e203cb 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-14 15:59:05.257063", - "spec_repo_commit": "0457044b" + "regenerated": "2025-01-14 20:10:47.979598", + "spec_repo_commit": "89d2bdc8" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-14 15:59:05.292969", - "spec_repo_commit": "0457044b" + "regenerated": "2025-01-14 20:10:47.994294", + "spec_repo_commit": "89d2bdc8" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 77866cbe38e..81ffe33dc8e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -297,6 +297,20 @@ components: required: false schema: $ref: '#/components/schemas/RelationType' + FrameworkHandle: + description: The framework handle + in: path + name: handle + required: true + schema: + type: string + FrameworkVersion: + description: The framework version + in: path + name: version + required: true + schema: + type: string GCPSTSServiceAccountID: description: Your GCP STS enabled service account's unique ID. in: path @@ -7145,6 +7159,10 @@ components: type: string x-enum-varnames: - APPDEFINITIONS + CreateCustomFrameworkRequest: + $ref: '#/components/schemas/FrameworkData' + description: Create a custom framework. + type: object CreateDataDeletionRequestBody: description: Object needed to create a data deletion request. properties: @@ -11936,6 +11954,72 @@ components: order: $ref: '#/components/schemas/QuerySortOrder' type: object + FrameworkControl: + description: Framework Control. + properties: + name: + description: Control Name. + example: '' + type: string + rule_ids: + description: Rule IDs. + example: + - '' + items: + type: string + type: array + required: + - name + - rule_ids + type: object + FrameworkData: + description: Framework Data. + properties: + description: + description: Framework Description + type: string + handle: + description: Framework Handle + example: '' + type: string + icon_url: + description: Framework Icon URL + type: string + name: + description: Framework Name + example: '' + type: string + requirements: + description: Framework Requirements + items: + $ref: '#/components/schemas/FrameworkRequirement' + type: array + version: + description: Framework Version + example: '' + type: string + required: + - handle + - version + - name + - requirements + type: object + FrameworkRequirement: + description: Framework Requirement. + properties: + controls: + description: Requirement Controls. + items: + $ref: '#/components/schemas/FrameworkControl' + type: array + name: + description: Requirement Name. + example: '' + type: string + required: + - name + - controls + type: object FullAPIKey: description: Datadog API key. properties: @@ -28953,6 +29037,10 @@ components: deployment: $ref: '#/components/schemas/DeploymentRelationship' type: object + UpdateCustomFrameworkRequest: + $ref: '#/components/schemas/FrameworkData' + description: Update a custom framework. + type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -33028,6 +33116,77 @@ paths: operator: OR permissions: - ci_visibility_read + /api/v2/cloud_security_management/custom_frameworks: + post: + description: Create a custom framework. + operationId: CreateCustomFramework + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCustomFrameworkRequest' + required: true + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + $ref: '#/components/responses/BadRequestResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + - security_monitoring_rules_write + summary: Create a custom framework + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - security_monitoring_rules_read + - security_monitoring_rules_write + /api/v2/cloud_security_management/custom_frameworks/{handle}/{version}: + put: + description: Update a custom framework. + operationId: UpdateCustomFramework + parameters: + - $ref: '#/components/parameters/FrameworkHandle' + - $ref: '#/components/parameters/FrameworkVersion' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateCustomFrameworkRequest' + required: true + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + $ref: '#/components/responses/BadRequestResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + - security_monitoring_rules_write + summary: Update a custom framework + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - security_monitoring_rules_read + - security_monitoring_rules_write /api/v2/container_images: get: description: Get all Container Images for your organization. diff --git a/examples/v2/security-monitoring/CreateCustomFramework.java b/examples/v2/security-monitoring/CreateCustomFramework.java new file mode 100644 index 00000000000..2a8a2a30541 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCustomFramework.java @@ -0,0 +1,41 @@ +// Create a custom framework returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest; +import com.datadog.api.client.v2.model.FrameworkControl; +import com.datadog.api.client.v2.model.FrameworkRequirement; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateCustomFrameworkRequest body = + new CreateCustomFrameworkRequest() + .handle("") + .name("") + .requirements( + Collections.singletonList( + new FrameworkRequirement() + .controls( + Collections.singletonList( + new FrameworkControl() + .name("") + .ruleIds(Collections.singletonList("")))) + .name(""))) + .version(""); + + try { + apiInstance.createCustomFramework(body); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createCustomFramework"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/UpdateCustomFramework.java b/examples/v2/security-monitoring/UpdateCustomFramework.java new file mode 100644 index 00000000000..db327934fc7 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateCustomFramework.java @@ -0,0 +1,41 @@ +// Update a custom framework returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.FrameworkControl; +import com.datadog.api.client.v2.model.FrameworkRequirement; +import com.datadog.api.client.v2.model.UpdateCustomFrameworkRequest; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + UpdateCustomFrameworkRequest body = + new UpdateCustomFrameworkRequest() + .handle("") + .name("") + .requirements( + Collections.singletonList( + new FrameworkRequirement() + .controls( + Collections.singletonList( + new FrameworkControl() + .name("") + .ruleIds(Collections.singletonList("")))) + .name(""))) + .version(""); + + try { + apiInstance.updateCustomFramework("handle", "version", body); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#updateCustomFramework"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 50f544a02be..2f02c9f7801 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -380,6 +380,17 @@ public class ApiClient { put("v2.getApp", false); put("v2.listApps", false); put("v2.updateApp", false); + put("v2.cancelHistoricalJob", false); + put("v2.convertJobResultToSignal", false); + put("v2.deleteHistoricalJob", false); + put("v2.getFinding", false); + put("v2.getHistoricalJob", false); + put("v2.listFindings", false); + put("v2.listHistoricalJobs", false); + put("v2.listVulnerabilities", false); + put("v2.listVulnerableAssets", false); + put("v2.muteFindings", false); + put("v2.runHistoricalJob", false); put("v2.getActiveBillingDimensions", false); put("v2.getBillingDimensionMapping", false); put("v2.getMonthlyCostAttribution", false); @@ -419,17 +430,6 @@ public class ApiClient { put("v2.listAWSNamespaces", false); put("v2.updateAWSAccount", false); put("v2.listAWSLogsServices", false); - put("v2.cancelHistoricalJob", false); - put("v2.convertJobResultToSignal", false); - put("v2.deleteHistoricalJob", false); - put("v2.getFinding", false); - put("v2.getHistoricalJob", false); - put("v2.listFindings", false); - put("v2.listHistoricalJobs", false); - put("v2.listVulnerabilities", false); - put("v2.listVulnerableAssets", false); - put("v2.muteFindings", false); - put("v2.runHistoricalJob", false); put("v2.createScorecardOutcomesBatch", false); put("v2.createScorecardRule", false); put("v2.deleteScorecardRule", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 2cad3609da1..5442a2ee79d 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -9,6 +9,7 @@ import com.datadog.api.client.v2.model.BulkMuteFindingsRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsResponse; import com.datadog.api.client.v2.model.ConvertJobResultsToSignalsRequest; +import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest; import com.datadog.api.client.v2.model.Finding; import com.datadog.api.client.v2.model.FindingEvaluation; import com.datadog.api.client.v2.model.FindingStatus; @@ -48,6 +49,7 @@ import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionResponse; import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionUpdateRequest; import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionsResponse; +import com.datadog.api.client.v2.model.UpdateCustomFrameworkRequest; import com.datadog.api.client.v2.model.VulnerabilityEcosystem; import com.datadog.api.client.v2.model.VulnerabilitySeverity; import com.datadog.api.client.v2.model.VulnerabilityStatus; @@ -686,6 +688,136 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS new GenericType() {}); } + /** + * Create a custom framework. + * + *

See {@link #createCustomFrameworkWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void createCustomFramework(CreateCustomFrameworkRequest body) throws ApiException { + createCustomFrameworkWithHttpInfo(body); + } + + /** + * Create a custom framework. + * + *

See {@link #createCustomFrameworkWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture createCustomFrameworkAsync(CreateCustomFrameworkRequest body) { + return createCustomFrameworkWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a custom framework. + * + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
500 Bad Request -
+ */ + public ApiResponse createCustomFrameworkWithHttpInfo(CreateCustomFrameworkRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createCustomFramework"); + } + // create path and map variables + String localVarPath = "/api/v2/cloud_security_management/custom_frameworks"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createCustomFramework", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Create a custom framework. + * + *

See {@link #createCustomFrameworkWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> createCustomFrameworkWithHttpInfoAsync( + CreateCustomFrameworkRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createCustomFramework")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cloud_security_management/custom_frameworks"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createCustomFramework", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Create a security filter. * @@ -7010,6 +7142,182 @@ public ApiResponse testSecurityMonitoringRul new GenericType() {}); } + /** + * Update a custom framework. + * + *

See {@link #updateCustomFrameworkWithHttpInfo}. + * + * @param handle The framework handle (required) + * @param version The framework version (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateCustomFramework( + String handle, String version, UpdateCustomFrameworkRequest body) throws ApiException { + updateCustomFrameworkWithHttpInfo(handle, version, body); + } + + /** + * Update a custom framework. + * + *

See {@link #updateCustomFrameworkWithHttpInfoAsync}. + * + * @param handle The framework handle (required) + * @param version The framework version (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateCustomFrameworkAsync( + String handle, String version, UpdateCustomFrameworkRequest body) { + return updateCustomFrameworkWithHttpInfoAsync(handle, version, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a custom framework. + * + * @param handle The framework handle (required) + * @param version The framework version (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
500 Bad Request -
+ */ + public ApiResponse updateCustomFrameworkWithHttpInfo( + String handle, String version, UpdateCustomFrameworkRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'handle' is set + if (handle == null) { + throw new ApiException( + 400, "Missing the required parameter 'handle' when calling updateCustomFramework"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, "Missing the required parameter 'version' when calling updateCustomFramework"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCustomFramework"); + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateCustomFramework", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update a custom framework. + * + *

See {@link #updateCustomFrameworkWithHttpInfo}. + * + * @param handle The framework handle (required) + * @param version The framework version (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateCustomFrameworkWithHttpInfoAsync( + String handle, String version, UpdateCustomFrameworkRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'handle' is set + if (handle == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'handle' when calling updateCustomFramework")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'version' when calling updateCustomFramework")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCustomFramework")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateCustomFramework", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Update a security filter. * diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCustomFrameworkRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateCustomFrameworkRequest.java new file mode 100644 index 00000000000..808ea5c4575 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCustomFrameworkRequest.java @@ -0,0 +1,297 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Framework Data. */ +@JsonPropertyOrder({ + CreateCustomFrameworkRequest.JSON_PROPERTY_DESCRIPTION, + CreateCustomFrameworkRequest.JSON_PROPERTY_HANDLE, + CreateCustomFrameworkRequest.JSON_PROPERTY_ICON_URL, + CreateCustomFrameworkRequest.JSON_PROPERTY_NAME, + CreateCustomFrameworkRequest.JSON_PROPERTY_REQUIREMENTS, + CreateCustomFrameworkRequest.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCustomFrameworkRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ICON_URL = "icon_url"; + private String iconUrl; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REQUIREMENTS = "requirements"; + private List requirements = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public CreateCustomFrameworkRequest() {} + + @JsonCreator + public CreateCustomFrameworkRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUIREMENTS) + List requirements, + @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) String version) { + this.handle = handle; + this.name = name; + this.requirements = requirements; + this.version = version; + } + + public CreateCustomFrameworkRequest description(String description) { + this.description = description; + return this; + } + + /** + * Framework Description + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateCustomFrameworkRequest handle(String handle) { + this.handle = handle; + return this; + } + + /** + * Framework Handle + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public CreateCustomFrameworkRequest iconUrl(String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Framework Icon URL + * + * @return iconUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + public void setIconUrl(String iconUrl) { + this.iconUrl = iconUrl; + } + + public CreateCustomFrameworkRequest name(String name) { + this.name = name; + return this; + } + + /** + * Framework Name + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateCustomFrameworkRequest requirements(List requirements) { + this.requirements = requirements; + for (FrameworkRequirement item : requirements) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateCustomFrameworkRequest addRequirementsItem(FrameworkRequirement requirementsItem) { + this.requirements.add(requirementsItem); + this.unparsed |= requirementsItem.unparsed; + return this; + } + + /** + * Framework Requirements + * + * @return requirements + */ + @JsonProperty(JSON_PROPERTY_REQUIREMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequirements() { + return requirements; + } + + public void setRequirements(List requirements) { + this.requirements = requirements; + } + + public CreateCustomFrameworkRequest version(String version) { + this.version = version; + return this; + } + + /** + * Framework Version + * + * @return version + */ + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCustomFrameworkRequest + */ + @JsonAnySetter + public CreateCustomFrameworkRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCustomFrameworkRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCustomFrameworkRequest createCustomFrameworkRequest = (CreateCustomFrameworkRequest) o; + return Objects.equals(this.description, createCustomFrameworkRequest.description) + && Objects.equals(this.handle, createCustomFrameworkRequest.handle) + && Objects.equals(this.iconUrl, createCustomFrameworkRequest.iconUrl) + && Objects.equals(this.name, createCustomFrameworkRequest.name) + && Objects.equals(this.requirements, createCustomFrameworkRequest.requirements) + && Objects.equals(this.version, createCustomFrameworkRequest.version) + && Objects.equals( + this.additionalProperties, createCustomFrameworkRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, handle, iconUrl, name, requirements, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCustomFrameworkRequest {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" requirements: ").append(toIndentedString(requirements)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FrameworkControl.java b/src/main/java/com/datadog/api/client/v2/model/FrameworkControl.java new file mode 100644 index 00000000000..c315af58772 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FrameworkControl.java @@ -0,0 +1,177 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Framework Control. */ +@JsonPropertyOrder({FrameworkControl.JSON_PROPERTY_NAME, FrameworkControl.JSON_PROPERTY_RULE_IDS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FrameworkControl { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE_IDS = "rule_ids"; + private List ruleIds = new ArrayList<>(); + + public FrameworkControl() {} + + @JsonCreator + public FrameworkControl( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_IDS) List ruleIds) { + this.name = name; + this.ruleIds = ruleIds; + } + + public FrameworkControl name(String name) { + this.name = name; + return this; + } + + /** + * Control Name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FrameworkControl ruleIds(List ruleIds) { + this.ruleIds = ruleIds; + return this; + } + + public FrameworkControl addRuleIdsItem(String ruleIdsItem) { + this.ruleIds.add(ruleIdsItem); + return this; + } + + /** + * Rule IDs. + * + * @return ruleIds + */ + @JsonProperty(JSON_PROPERTY_RULE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRuleIds() { + return ruleIds; + } + + public void setRuleIds(List ruleIds) { + this.ruleIds = ruleIds; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FrameworkControl + */ + @JsonAnySetter + public FrameworkControl putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FrameworkControl object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FrameworkControl frameworkControl = (FrameworkControl) o; + return Objects.equals(this.name, frameworkControl.name) + && Objects.equals(this.ruleIds, frameworkControl.ruleIds) + && Objects.equals(this.additionalProperties, frameworkControl.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, ruleIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FrameworkControl {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ruleIds: ").append(toIndentedString(ruleIds)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FrameworkRequirement.java b/src/main/java/com/datadog/api/client/v2/model/FrameworkRequirement.java new file mode 100644 index 00000000000..bf9f6238e94 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FrameworkRequirement.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Framework Requirement. */ +@JsonPropertyOrder({ + FrameworkRequirement.JSON_PROPERTY_CONTROLS, + FrameworkRequirement.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FrameworkRequirement { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONTROLS = "controls"; + private List controls = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public FrameworkRequirement() {} + + @JsonCreator + public FrameworkRequirement( + @JsonProperty(required = true, value = JSON_PROPERTY_CONTROLS) + List controls, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.controls = controls; + this.name = name; + } + + public FrameworkRequirement controls(List controls) { + this.controls = controls; + for (FrameworkControl item : controls) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FrameworkRequirement addControlsItem(FrameworkControl controlsItem) { + this.controls.add(controlsItem); + this.unparsed |= controlsItem.unparsed; + return this; + } + + /** + * Requirement Controls. + * + * @return controls + */ + @JsonProperty(JSON_PROPERTY_CONTROLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getControls() { + return controls; + } + + public void setControls(List controls) { + this.controls = controls; + } + + public FrameworkRequirement name(String name) { + this.name = name; + return this; + } + + /** + * Requirement Name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FrameworkRequirement + */ + @JsonAnySetter + public FrameworkRequirement putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FrameworkRequirement object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FrameworkRequirement frameworkRequirement = (FrameworkRequirement) o; + return Objects.equals(this.controls, frameworkRequirement.controls) + && Objects.equals(this.name, frameworkRequirement.name) + && Objects.equals(this.additionalProperties, frameworkRequirement.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(controls, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FrameworkRequirement {\n"); + sb.append(" controls: ").append(toIndentedString(controls)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateCustomFrameworkRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateCustomFrameworkRequest.java new file mode 100644 index 00000000000..427560abb9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateCustomFrameworkRequest.java @@ -0,0 +1,297 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Framework Data. */ +@JsonPropertyOrder({ + UpdateCustomFrameworkRequest.JSON_PROPERTY_DESCRIPTION, + UpdateCustomFrameworkRequest.JSON_PROPERTY_HANDLE, + UpdateCustomFrameworkRequest.JSON_PROPERTY_ICON_URL, + UpdateCustomFrameworkRequest.JSON_PROPERTY_NAME, + UpdateCustomFrameworkRequest.JSON_PROPERTY_REQUIREMENTS, + UpdateCustomFrameworkRequest.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateCustomFrameworkRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ICON_URL = "icon_url"; + private String iconUrl; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REQUIREMENTS = "requirements"; + private List requirements = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public UpdateCustomFrameworkRequest() {} + + @JsonCreator + public UpdateCustomFrameworkRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUIREMENTS) + List requirements, + @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) String version) { + this.handle = handle; + this.name = name; + this.requirements = requirements; + this.version = version; + } + + public UpdateCustomFrameworkRequest description(String description) { + this.description = description; + return this; + } + + /** + * Framework Description + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public UpdateCustomFrameworkRequest handle(String handle) { + this.handle = handle; + return this; + } + + /** + * Framework Handle + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public UpdateCustomFrameworkRequest iconUrl(String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Framework Icon URL + * + * @return iconUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ICON_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIconUrl() { + return iconUrl; + } + + public void setIconUrl(String iconUrl) { + this.iconUrl = iconUrl; + } + + public UpdateCustomFrameworkRequest name(String name) { + this.name = name; + return this; + } + + /** + * Framework Name + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateCustomFrameworkRequest requirements(List requirements) { + this.requirements = requirements; + for (FrameworkRequirement item : requirements) { + this.unparsed |= item.unparsed; + } + return this; + } + + public UpdateCustomFrameworkRequest addRequirementsItem(FrameworkRequirement requirementsItem) { + this.requirements.add(requirementsItem); + this.unparsed |= requirementsItem.unparsed; + return this; + } + + /** + * Framework Requirements + * + * @return requirements + */ + @JsonProperty(JSON_PROPERTY_REQUIREMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequirements() { + return requirements; + } + + public void setRequirements(List requirements) { + this.requirements = requirements; + } + + public UpdateCustomFrameworkRequest version(String version) { + this.version = version; + return this; + } + + /** + * Framework Version + * + * @return version + */ + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateCustomFrameworkRequest + */ + @JsonAnySetter + public UpdateCustomFrameworkRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateCustomFrameworkRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCustomFrameworkRequest updateCustomFrameworkRequest = (UpdateCustomFrameworkRequest) o; + return Objects.equals(this.description, updateCustomFrameworkRequest.description) + && Objects.equals(this.handle, updateCustomFrameworkRequest.handle) + && Objects.equals(this.iconUrl, updateCustomFrameworkRequest.iconUrl) + && Objects.equals(this.name, updateCustomFrameworkRequest.name) + && Objects.equals(this.requirements, updateCustomFrameworkRequest.requirements) + && Objects.equals(this.version, updateCustomFrameworkRequest.version) + && Objects.equals( + this.additionalProperties, updateCustomFrameworkRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, handle, iconUrl, name, requirements, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCustomFrameworkRequest {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" requirements: ").append(toIndentedString(requirements)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 362378f6349..23dffe98a24 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -171,6 +171,20 @@ Feature: Security Monitoring And the response "message" is equal to "ddd" And the response "options.complianceRuleOptions.resourceType" is equal to "gcp_compute_disk" + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Create a custom framework returns "Bad Request" response + Given new "CreateCustomFramework" request + And body with value {"handle": "", "name": "", "requirements": [{"controls": [{"name": "", "rule_ids": [""]}], "name": ""}], "version": ""} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Create a custom framework returns "OK" response + Given new "CreateCustomFramework" request + And body with value {"handle": "", "name": "", "requirements": [{"controls": [{"name": "", "rule_ids": [""]}], "name": ""}], "version": ""} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule returns "Bad Request" response Given new "CreateSecurityMonitoringRule" request @@ -827,6 +841,24 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}_cloud_updated" And the response "id" has the same value as "cloud_configuration_rule.id" + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Update a custom framework returns "Bad Request" response + Given new "UpdateCustomFramework" request + And request contains "handle" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"handle": "", "name": "", "requirements": [{"controls": [{"name": "", "rule_ids": [""]}], "name": ""}], "version": ""} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Update a custom framework returns "OK" response + Given new "UpdateCustomFramework" request + And request contains "handle" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"handle": "", "name": "", "requirements": [{"controls": [{"name": "", "rule_ids": [""]}], "name": ""}], "version": ""} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index d6c6e9de87c..154e3c46f15 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -439,6 +439,18 @@ "type": "safe" } }, + "CreateCustomFramework": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateCustomFramework": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListContainerImages": { "tag": "Container Images", "undo": {