diff --git a/.apigentools-info b/.apigentools-info index ad502cd7e29..b819d4df61f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-19 17:45:10.273296", - "spec_repo_commit": "77e5efb9" + "regenerated": "2025-05-20 07:21:26.115507", + "spec_repo_commit": "fec20f97" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-19 17:45:10.289104", - "spec_repo_commit": "77e5efb9" + "regenerated": "2025-05-20 07:21:26.131253", + "spec_repo_commit": "fec20f97" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 631fc6d1bb8..79fc922a620 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -689,6 +689,21 @@ components: required: true schema: type: string + ResourceFilterAccountID: + description: Filter resource filters by cloud provider account ID. This parameter + is only valid when provider is specified. + in: query + name: account_id + required: false + schema: + type: string + ResourceFilterProvider: + description: Filter resource filters by cloud provider (e.g. aws, gcp, azure). + in: query + name: cloud_provider + required: false + schema: + type: string ResourceID: description: 'Identifier, formatted as `type:id`. Supported types: `connection`, `dashboard`, `integration-account`, `integration-service`, `integration-webhook`, @@ -807,6 +822,13 @@ components: required: true schema: type: string + SkipCache: + description: Skip cache for resource filters. + in: query + name: skip_cache + required: false + schema: + type: boolean SpansMetricIDParameter: description: The name of the span-based metric. in: path @@ -15715,6 +15737,26 @@ components: $ref: '#/components/schemas/GetInterfacesData' type: array type: object + GetResourceEvaluationFiltersResponse: + description: The definition of `GetResourceEvaluationFiltersResponse` object. + properties: + data: + $ref: '#/components/schemas/GetResourceEvaluationFiltersResponseData' + required: + - data + type: object + GetResourceEvaluationFiltersResponseData: + description: The definition of `GetResourceFilterResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/ResourceFilterAttributes' + id: + description: The `data` `id`. + example: csm_resource_filter + type: string + type: + $ref: '#/components/schemas/ResourceFilterRequestType' + type: object GetRuleVersionHistoryData: description: Data for the rule version history. properties: @@ -29270,6 +29312,46 @@ components: required: - data type: object + ResourceFilterAttributes: + description: Attributes of a resource filter. + example: + aws: + '123456789': + - environment:production + - team:devops + azure: + sub-001: + - app:frontend + gcp: + project-abc: + - region:us-central1 + properties: + cloud_provider: + additionalProperties: + additionalProperties: + items: + description: Tag filter in format "key:value" + example: environment:production + type: string + type: array + type: object + description: A map of cloud provider names (e.g., "aws", "gcp", "azure") + to a map of account/resource IDs and their associated tag filters. + type: object + uuid: + description: The UUID of the resource filter. + type: string + required: + - cloud_provider + type: object + ResourceFilterRequestType: + description: Constant string to identify the request type. + enum: + - csm_resource_filter + example: csm_resource_filter + type: string + x-enum-varnames: + - CSM_RESOURCE_FILTER ResponseMetaAttributes: description: Object describing meta attributes of response. properties: @@ -32253,9 +32335,11 @@ components: example: true type: boolean SecurityMonitoringRuleKeepAlive: - description: "Once a signal is generated, the signal will remain \u201Copen\u201D - if a case is matched at least once within\nthis keep alive window. For third - party detection method, this field is not used." + description: 'Once a signal is generated, the signal will remain "open" if a + case is matched at least once within + + this keep alive window. For third party detection method, this field is not + used.' enum: - 0 - 60 @@ -32285,9 +32369,10 @@ components: - TWELVE_HOURS - ONE_DAY SecurityMonitoringRuleMaxSignalDuration: - description: "A signal will \u201Cclose\u201D regardless of the query being - matched once the time exceeds the maximum duration.\nThis time is calculated - from the first seen timestamp." + description: 'A signal will "close" regardless of the query being matched once + the time exceeds the maximum duration. + + This time is calculated from the first seen timestamp.' enum: - 0 - 60 @@ -38688,6 +38773,52 @@ components: id: $ref: '#/components/schemas/ApiID' type: object + UpdateResourceEvaluationFiltersRequest: + description: Request object to update a resource filter. + properties: + data: + $ref: '#/components/schemas/UpdateResourceEvaluationFiltersRequestData' + required: + - data + type: object + UpdateResourceEvaluationFiltersRequestData: + description: The definition of `UpdateResourceFilterRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ResourceFilterAttributes' + id: + description: The `UpdateResourceEvaluationFiltersRequestData` `id`. + example: csm_resource_filter + type: string + type: + $ref: '#/components/schemas/ResourceFilterRequestType' + required: + - attributes + - type + type: object + UpdateResourceEvaluationFiltersResponse: + description: The definition of `UpdateResourceEvaluationFiltersResponse` object. + properties: + data: + $ref: '#/components/schemas/UpdateResourceEvaluationFiltersResponseData' + required: + - data + type: object + UpdateResourceEvaluationFiltersResponseData: + description: The definition of `UpdateResourceFilterResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/ResourceFilterAttributes' + id: + description: The `data` `id`. + example: csm_resource_filter + type: string + type: + $ref: '#/components/schemas/ResourceFilterRequestType' + required: + - attributes + - type + type: object UpdateRuleRequest: description: Request to update a scorecard rule. properties: @@ -43624,6 +43755,74 @@ paths: permissions: - security_monitoring_rules_read - security_monitoring_rules_write + /api/v2/cloud_security_management/resource_filters: + get: + description: List resource filters. + operationId: GetResourceEvaluationFilters + parameters: + - $ref: '#/components/parameters/ResourceFilterProvider' + - $ref: '#/components/parameters/ResourceFilterAccountID' + - $ref: '#/components/parameters/SkipCache' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetResourceEvaluationFiltersResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read + summary: List resource filters + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_monitoring_filters_read + put: + description: Update resource filters. + operationId: UpdateResourceEvaluationFilters + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateResourceEvaluationFiltersRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateResourceEvaluationFiltersResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + summary: Update resource filters + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write /api/v2/container_images: get: description: Get all Container Images for your organization. diff --git a/examples/v2/security-monitoring/GetResourceEvaluationFilters.java b/examples/v2/security-monitoring/GetResourceEvaluationFilters.java new file mode 100644 index 00000000000..c43378de964 --- /dev/null +++ b/examples/v2/security-monitoring/GetResourceEvaluationFilters.java @@ -0,0 +1,30 @@ +// List resource filters 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.api.SecurityMonitoringApi.GetResourceEvaluationFiltersOptionalParameters; +import com.datadog.api.client.v2.model.GetResourceEvaluationFiltersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + GetResourceEvaluationFiltersResponse result = + apiInstance.getResourceEvaluationFilters( + new GetResourceEvaluationFiltersOptionalParameters() + .cloudProvider("aws") + .accountId("123456789")); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#getResourceEvaluationFilters"); + 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/UpdateResourceEvaluationFilters.java b/examples/v2/security-monitoring/UpdateResourceEvaluationFilters.java new file mode 100644 index 00000000000..2a68c5f827d --- /dev/null +++ b/examples/v2/security-monitoring/UpdateResourceEvaluationFilters.java @@ -0,0 +1,49 @@ +// Update resource filters 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.ResourceFilterAttributes; +import com.datadog.api.client.v2.model.ResourceFilterRequestType; +import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersRequest; +import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersRequestData; +import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersResponse; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + UpdateResourceEvaluationFiltersRequest body = + new UpdateResourceEvaluationFiltersRequest() + .data( + new UpdateResourceEvaluationFiltersRequestData() + .attributes( + new ResourceFilterAttributes() + .cloudProvider( + Map.ofEntries( + Map.entry( + "aws", + Map.ofEntries( + Map.entry( + "aws_account_id", + Collections.singletonList("tag1:v1"))))))) + .id("csm_resource_filter") + .type(ResourceFilterRequestType.CSM_RESOURCE_FILTER)); + + try { + UpdateResourceEvaluationFiltersResponse result = + apiInstance.updateResourceEvaluationFilters(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#updateResourceEvaluationFilters"); + 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/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index ed207320cd0..1f5dae6fa56 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 @@ -19,6 +19,7 @@ import com.datadog.api.client.v2.model.FindingVulnerabilityType; import com.datadog.api.client.v2.model.GetCustomFrameworkResponse; import com.datadog.api.client.v2.model.GetFindingResponse; +import com.datadog.api.client.v2.model.GetResourceEvaluationFiltersResponse; import com.datadog.api.client.v2.model.GetRuleVersionHistoryResponse; import com.datadog.api.client.v2.model.GetSBOMResponse; import com.datadog.api.client.v2.model.HistoricalJobResponse; @@ -59,6 +60,8 @@ import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionsResponse; import com.datadog.api.client.v2.model.UpdateCustomFrameworkRequest; import com.datadog.api.client.v2.model.UpdateCustomFrameworkResponse; +import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersRequest; +import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersResponse; import com.datadog.api.client.v2.model.VulnerabilityEcosystem; import com.datadog.api.client.v2.model.VulnerabilitySeverity; import com.datadog.api.client.v2.model.VulnerabilityStatus; @@ -3576,6 +3579,215 @@ public CompletableFuture> getHistoricalJobWit new GenericType() {}); } + /** Manage optional parameters to getResourceEvaluationFilters. */ + public static class GetResourceEvaluationFiltersOptionalParameters { + private String cloudProvider; + private String accountId; + private Boolean skipCache; + + /** + * Set cloudProvider. + * + * @param cloudProvider Filter resource filters by cloud provider (e.g. aws, gcp, azure). + * (optional) + * @return GetResourceEvaluationFiltersOptionalParameters + */ + public GetResourceEvaluationFiltersOptionalParameters cloudProvider(String cloudProvider) { + this.cloudProvider = cloudProvider; + return this; + } + + /** + * Set accountId. + * + * @param accountId Filter resource filters by cloud provider account ID. This parameter is only + * valid when provider is specified. (optional) + * @return GetResourceEvaluationFiltersOptionalParameters + */ + public GetResourceEvaluationFiltersOptionalParameters accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set skipCache. + * + * @param skipCache Skip cache for resource filters. (optional) + * @return GetResourceEvaluationFiltersOptionalParameters + */ + public GetResourceEvaluationFiltersOptionalParameters skipCache(Boolean skipCache) { + this.skipCache = skipCache; + return this; + } + } + + /** + * List resource filters. + * + *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + * + * @return GetResourceEvaluationFiltersResponse + * @throws ApiException if fails to make API call + */ + public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters() throws ApiException { + return getResourceEvaluationFiltersWithHttpInfo( + new GetResourceEvaluationFiltersOptionalParameters()) + .getData(); + } + + /** + * List resource filters. + * + *

See {@link #getResourceEvaluationFiltersWithHttpInfoAsync}. + * + * @return CompletableFuture<GetResourceEvaluationFiltersResponse> + */ + public CompletableFuture + getResourceEvaluationFiltersAsync() { + return getResourceEvaluationFiltersWithHttpInfoAsync( + new GetResourceEvaluationFiltersOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List resource filters. + * + *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return GetResourceEvaluationFiltersResponse + * @throws ApiException if fails to make API call + */ + public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters( + GetResourceEvaluationFiltersOptionalParameters parameters) throws ApiException { + return getResourceEvaluationFiltersWithHttpInfo(parameters).getData(); + } + + /** + * List resource filters. + * + *

See {@link #getResourceEvaluationFiltersWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GetResourceEvaluationFiltersResponse> + */ + public CompletableFuture getResourceEvaluationFiltersAsync( + GetResourceEvaluationFiltersOptionalParameters parameters) { + return getResourceEvaluationFiltersWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List resource filters. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<GetResourceEvaluationFiltersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse getResourceEvaluationFiltersWithHttpInfo( + GetResourceEvaluationFiltersOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String cloudProvider = parameters.cloudProvider; + String accountId = parameters.accountId; + Boolean skipCache = parameters.skipCache; + // create path and map variables + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud_provider", cloudProvider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip_cache", skipCache)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getResourceEvaluationFilters", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List resource filters. + * + *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GetResourceEvaluationFiltersResponse>> + */ + public CompletableFuture> + getResourceEvaluationFiltersWithHttpInfoAsync( + GetResourceEvaluationFiltersOptionalParameters parameters) { + Object localVarPostBody = null; + String cloudProvider = parameters.cloudProvider; + String accountId = parameters.accountId; + Boolean skipCache = parameters.skipCache; + // create path and map variables + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud_provider", cloudProvider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip_cache", skipCache)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getResourceEvaluationFilters", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to getRuleVersionHistory. */ public static class GetRuleVersionHistoryOptionalParameters { private Long pageSize; @@ -9514,6 +9726,146 @@ public ApiResponse updateCustomFrameworkWithHttpI new GenericType() {}); } + /** + * Update resource filters. + * + *

See {@link #updateResourceEvaluationFiltersWithHttpInfo}. + * + * @param body (required) + * @return UpdateResourceEvaluationFiltersResponse + * @throws ApiException if fails to make API call + */ + public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( + UpdateResourceEvaluationFiltersRequest body) throws ApiException { + return updateResourceEvaluationFiltersWithHttpInfo(body).getData(); + } + + /** + * Update resource filters. + * + *

See {@link #updateResourceEvaluationFiltersWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<UpdateResourceEvaluationFiltersResponse> + */ + public CompletableFuture + updateResourceEvaluationFiltersAsync(UpdateResourceEvaluationFiltersRequest body) { + return updateResourceEvaluationFiltersWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update resource filters. + * + * @param body (required) + * @return ApiResponse<UpdateResourceEvaluationFiltersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + updateResourceEvaluationFiltersWithHttpInfo(UpdateResourceEvaluationFiltersRequest 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 updateResourceEvaluationFilters"); + } + // create path and map variables + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateResourceEvaluationFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update resource filters. + * + *

See {@link #updateResourceEvaluationFiltersWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<UpdateResourceEvaluationFiltersResponse>> + */ + public CompletableFuture> + updateResourceEvaluationFiltersWithHttpInfoAsync( + UpdateResourceEvaluationFiltersRequest 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" + + " updateResourceEvaluationFilters")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateResourceEvaluationFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + 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, + new GenericType() {}); + } + /** * Update a security filter. * diff --git a/src/main/java/com/datadog/api/client/v2/model/GetResourceEvaluationFiltersResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetResourceEvaluationFiltersResponse.java new file mode 100644 index 00000000000..73192297d6f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetResourceEvaluationFiltersResponse.java @@ -0,0 +1,148 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of GetResourceEvaluationFiltersResponse object. */ +@JsonPropertyOrder({GetResourceEvaluationFiltersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetResourceEvaluationFiltersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetResourceEvaluationFiltersResponseData data; + + public GetResourceEvaluationFiltersResponse() {} + + @JsonCreator + public GetResourceEvaluationFiltersResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GetResourceEvaluationFiltersResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GetResourceEvaluationFiltersResponse data(GetResourceEvaluationFiltersResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of GetResourceFilterResponseData object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetResourceEvaluationFiltersResponseData getData() { + return data; + } + + public void setData(GetResourceEvaluationFiltersResponseData data) { + this.data = data; + } + + /** + * 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 GetResourceEvaluationFiltersResponse + */ + @JsonAnySetter + public GetResourceEvaluationFiltersResponse 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 GetResourceEvaluationFiltersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourceEvaluationFiltersResponse getResourceEvaluationFiltersResponse = + (GetResourceEvaluationFiltersResponse) o; + return Objects.equals(this.data, getResourceEvaluationFiltersResponse.data) + && Objects.equals( + this.additionalProperties, getResourceEvaluationFiltersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetResourceEvaluationFiltersResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/GetResourceEvaluationFiltersResponseData.java b/src/main/java/com/datadog/api/client/v2/model/GetResourceEvaluationFiltersResponseData.java new file mode 100644 index 00000000000..fcc5e817227 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetResourceEvaluationFiltersResponseData.java @@ -0,0 +1,199 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of GetResourceFilterResponseData object. */ +@JsonPropertyOrder({ + GetResourceEvaluationFiltersResponseData.JSON_PROPERTY_ATTRIBUTES, + GetResourceEvaluationFiltersResponseData.JSON_PROPERTY_ID, + GetResourceEvaluationFiltersResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetResourceEvaluationFiltersResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ResourceFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ResourceFilterRequestType type; + + public GetResourceEvaluationFiltersResponseData attributes(ResourceFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a resource filter. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ResourceFilterAttributes attributes) { + this.attributes = attributes; + } + + public GetResourceEvaluationFiltersResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The data id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GetResourceEvaluationFiltersResponseData type(ResourceFilterRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Constant string to identify the request type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceFilterRequestType getType() { + return type; + } + + public void setType(ResourceFilterRequestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 GetResourceEvaluationFiltersResponseData + */ + @JsonAnySetter + public GetResourceEvaluationFiltersResponseData 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 GetResourceEvaluationFiltersResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourceEvaluationFiltersResponseData getResourceEvaluationFiltersResponseData = + (GetResourceEvaluationFiltersResponseData) o; + return Objects.equals(this.attributes, getResourceEvaluationFiltersResponseData.attributes) + && Objects.equals(this.id, getResourceEvaluationFiltersResponseData.id) + && Objects.equals(this.type, getResourceEvaluationFiltersResponseData.type) + && Objects.equals( + this.additionalProperties, + getResourceEvaluationFiltersResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetResourceEvaluationFiltersResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/HistoricalJobOptions.java b/src/main/java/com/datadog/api/client/v2/model/HistoricalJobOptions.java index 795adf76d05..675b1da972f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/HistoricalJobOptions.java +++ b/src/main/java/com/datadog/api/client/v2/model/HistoricalJobOptions.java @@ -136,7 +136,7 @@ public HistoricalJobOptions keepAlive(SecurityMonitoringRuleKeepAlive keepAlive) } /** - * Once a signal is generated, the signal will remain “open” if a case is matched at least once + * Once a signal is generated, the signal will remain "open" if a case is matched at least once * within this keep alive window. For third party detection method, this field is not used. * * @return keepAlive @@ -163,7 +163,7 @@ public HistoricalJobOptions maxSignalDuration( } /** - * A signal will “close” regardless of the query being matched once the time exceeds the maximum + * A signal will "close" regardless of the query being matched once the time exceeds the maximum * duration. This time is calculated from the first seen timestamp. * * @return maxSignalDuration diff --git a/src/main/java/com/datadog/api/client/v2/model/ResourceFilterAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ResourceFilterAttributes.java new file mode 100644 index 00000000000..e21c9d4a514 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ResourceFilterAttributes.java @@ -0,0 +1,183 @@ +/* + * 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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a resource filter. */ +@JsonPropertyOrder({ + ResourceFilterAttributes.JSON_PROPERTY_CLOUD_PROVIDER, + ResourceFilterAttributes.JSON_PROPERTY_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ResourceFilterAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLOUD_PROVIDER = "cloud_provider"; + private Map>> cloudProvider = + new HashMap>>(); + + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public ResourceFilterAttributes() {} + + @JsonCreator + public ResourceFilterAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CLOUD_PROVIDER) + Map>> cloudProvider) { + this.cloudProvider = cloudProvider; + } + + public ResourceFilterAttributes cloudProvider( + Map>> cloudProvider) { + this.cloudProvider = cloudProvider; + return this; + } + + public ResourceFilterAttributes putCloudProviderItem( + String key, Map> cloudProviderItem) { + this.cloudProvider.put(key, cloudProviderItem); + return this; + } + + /** + * A map of cloud provider names (e.g., "aws", "gcp", "azure") to a map of account/resource IDs + * and their associated tag filters. + * + * @return cloudProvider + */ + @JsonProperty(JSON_PROPERTY_CLOUD_PROVIDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map>> getCloudProvider() { + return cloudProvider; + } + + public void setCloudProvider(Map>> cloudProvider) { + this.cloudProvider = cloudProvider; + } + + public ResourceFilterAttributes uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * The UUID of the resource filter. + * + * @return uuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * 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 ResourceFilterAttributes + */ + @JsonAnySetter + public ResourceFilterAttributes 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 ResourceFilterAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResourceFilterAttributes resourceFilterAttributes = (ResourceFilterAttributes) o; + return Objects.equals(this.cloudProvider, resourceFilterAttributes.cloudProvider) + && Objects.equals(this.uuid, resourceFilterAttributes.uuid) + && Objects.equals(this.additionalProperties, resourceFilterAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cloudProvider, uuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResourceFilterAttributes {\n"); + sb.append(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).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/ResourceFilterRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ResourceFilterRequestType.java new file mode 100644 index 00000000000..4747353739e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ResourceFilterRequestType.java @@ -0,0 +1,57 @@ +/* + * 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.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Constant string to identify the request type. */ +@JsonSerialize(using = ResourceFilterRequestType.ResourceFilterRequestTypeSerializer.class) +public class ResourceFilterRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("csm_resource_filter")); + + public static final ResourceFilterRequestType CSM_RESOURCE_FILTER = + new ResourceFilterRequestType("csm_resource_filter"); + + ResourceFilterRequestType(String value) { + super(value, allowedValues); + } + + public static class ResourceFilterRequestTypeSerializer + extends StdSerializer { + public ResourceFilterRequestTypeSerializer(Class t) { + super(t); + } + + public ResourceFilterRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ResourceFilterRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ResourceFilterRequestType fromValue(String value) { + return new ResourceFilterRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleKeepAlive.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleKeepAlive.java index 099aa1516fa..756fa548b9a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleKeepAlive.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleKeepAlive.java @@ -19,7 +19,7 @@ import java.util.Set; /** - * Once a signal is generated, the signal will remain “open” if a case is matched at least once + * Once a signal is generated, the signal will remain "open" if a case is matched at least once * within this keep alive window. For third party detection method, this field is not used. */ @JsonSerialize( diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleMaxSignalDuration.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleMaxSignalDuration.java index 466289a6c07..baee6493a64 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleMaxSignalDuration.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleMaxSignalDuration.java @@ -19,7 +19,7 @@ import java.util.Set; /** - * A signal will “close” regardless of the query being matched once the time exceeds the maximum + * A signal will "close" regardless of the query being matched once the time exceeds the maximum * duration. This time is calculated from the first seen timestamp. */ @JsonSerialize( diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleOptions.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleOptions.java index 03c748e360d..ec0bdbdabf4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleOptions.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleOptions.java @@ -228,7 +228,7 @@ public SecurityMonitoringRuleOptions keepAlive(SecurityMonitoringRuleKeepAlive k } /** - * Once a signal is generated, the signal will remain “open” if a case is matched at least once + * Once a signal is generated, the signal will remain "open" if a case is matched at least once * within this keep alive window. For third party detection method, this field is not used. * * @return keepAlive @@ -255,7 +255,7 @@ public SecurityMonitoringRuleOptions maxSignalDuration( } /** - * A signal will “close” regardless of the query being matched once the time exceeds the maximum + * A signal will "close" regardless of the query being matched once the time exceeds the maximum * duration. This time is calculated from the first seen timestamp. * * @return maxSignalDuration diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersRequest.java new file mode 100644 index 00000000000..9685a06357b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersRequest.java @@ -0,0 +1,149 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request object to update a resource filter. */ +@JsonPropertyOrder({UpdateResourceEvaluationFiltersRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateResourceEvaluationFiltersRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateResourceEvaluationFiltersRequestData data; + + public UpdateResourceEvaluationFiltersRequest() {} + + @JsonCreator + public UpdateResourceEvaluationFiltersRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpdateResourceEvaluationFiltersRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpdateResourceEvaluationFiltersRequest data( + UpdateResourceEvaluationFiltersRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of UpdateResourceFilterRequestData object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateResourceEvaluationFiltersRequestData getData() { + return data; + } + + public void setData(UpdateResourceEvaluationFiltersRequestData data) { + this.data = data; + } + + /** + * 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 UpdateResourceEvaluationFiltersRequest + */ + @JsonAnySetter + public UpdateResourceEvaluationFiltersRequest 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 UpdateResourceEvaluationFiltersRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateResourceEvaluationFiltersRequest updateResourceEvaluationFiltersRequest = + (UpdateResourceEvaluationFiltersRequest) o; + return Objects.equals(this.data, updateResourceEvaluationFiltersRequest.data) + && Objects.equals( + this.additionalProperties, updateResourceEvaluationFiltersRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateResourceEvaluationFiltersRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/UpdateResourceEvaluationFiltersRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersRequestData.java new file mode 100644 index 00000000000..afdb2be51d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersRequestData.java @@ -0,0 +1,213 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UpdateResourceFilterRequestData object. */ +@JsonPropertyOrder({ + UpdateResourceEvaluationFiltersRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateResourceEvaluationFiltersRequestData.JSON_PROPERTY_ID, + UpdateResourceEvaluationFiltersRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateResourceEvaluationFiltersRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ResourceFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ResourceFilterRequestType type; + + public UpdateResourceEvaluationFiltersRequestData() {} + + @JsonCreator + public UpdateResourceEvaluationFiltersRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ResourceFilterAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ResourceFilterRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateResourceEvaluationFiltersRequestData attributes( + ResourceFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a resource filter. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ResourceFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ResourceFilterAttributes attributes) { + this.attributes = attributes; + } + + public UpdateResourceEvaluationFiltersRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The UpdateResourceEvaluationFiltersRequestData id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UpdateResourceEvaluationFiltersRequestData type(ResourceFilterRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Constant string to identify the request type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ResourceFilterRequestType getType() { + return type; + } + + public void setType(ResourceFilterRequestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 UpdateResourceEvaluationFiltersRequestData + */ + @JsonAnySetter + public UpdateResourceEvaluationFiltersRequestData 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 UpdateResourceEvaluationFiltersRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateResourceEvaluationFiltersRequestData updateResourceEvaluationFiltersRequestData = + (UpdateResourceEvaluationFiltersRequestData) o; + return Objects.equals(this.attributes, updateResourceEvaluationFiltersRequestData.attributes) + && Objects.equals(this.id, updateResourceEvaluationFiltersRequestData.id) + && Objects.equals(this.type, updateResourceEvaluationFiltersRequestData.type) + && Objects.equals( + this.additionalProperties, + updateResourceEvaluationFiltersRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateResourceEvaluationFiltersRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/UpdateResourceEvaluationFiltersResponse.java b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersResponse.java new file mode 100644 index 00000000000..2a78b81c4d6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersResponse.java @@ -0,0 +1,150 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UpdateResourceEvaluationFiltersResponse object. */ +@JsonPropertyOrder({UpdateResourceEvaluationFiltersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateResourceEvaluationFiltersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateResourceEvaluationFiltersResponseData data; + + public UpdateResourceEvaluationFiltersResponse() {} + + @JsonCreator + public UpdateResourceEvaluationFiltersResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpdateResourceEvaluationFiltersResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpdateResourceEvaluationFiltersResponse data( + UpdateResourceEvaluationFiltersResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of UpdateResourceFilterResponseData object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateResourceEvaluationFiltersResponseData getData() { + return data; + } + + public void setData(UpdateResourceEvaluationFiltersResponseData data) { + this.data = data; + } + + /** + * 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 UpdateResourceEvaluationFiltersResponse + */ + @JsonAnySetter + public UpdateResourceEvaluationFiltersResponse 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 UpdateResourceEvaluationFiltersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFiltersResponse = + (UpdateResourceEvaluationFiltersResponse) o; + return Objects.equals(this.data, updateResourceEvaluationFiltersResponse.data) + && Objects.equals( + this.additionalProperties, + updateResourceEvaluationFiltersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateResourceEvaluationFiltersResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/UpdateResourceEvaluationFiltersResponseData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersResponseData.java new file mode 100644 index 00000000000..9e5a68c90f3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateResourceEvaluationFiltersResponseData.java @@ -0,0 +1,213 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UpdateResourceFilterResponseData object. */ +@JsonPropertyOrder({ + UpdateResourceEvaluationFiltersResponseData.JSON_PROPERTY_ATTRIBUTES, + UpdateResourceEvaluationFiltersResponseData.JSON_PROPERTY_ID, + UpdateResourceEvaluationFiltersResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateResourceEvaluationFiltersResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ResourceFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ResourceFilterRequestType type; + + public UpdateResourceEvaluationFiltersResponseData() {} + + @JsonCreator + public UpdateResourceEvaluationFiltersResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ResourceFilterAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ResourceFilterRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateResourceEvaluationFiltersResponseData attributes( + ResourceFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a resource filter. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ResourceFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ResourceFilterAttributes attributes) { + this.attributes = attributes; + } + + public UpdateResourceEvaluationFiltersResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The data id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UpdateResourceEvaluationFiltersResponseData type(ResourceFilterRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Constant string to identify the request type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ResourceFilterRequestType getType() { + return type; + } + + public void setType(ResourceFilterRequestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 UpdateResourceEvaluationFiltersResponseData + */ + @JsonAnySetter + public UpdateResourceEvaluationFiltersResponseData 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 UpdateResourceEvaluationFiltersResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateResourceEvaluationFiltersResponseData updateResourceEvaluationFiltersResponseData = + (UpdateResourceEvaluationFiltersResponseData) o; + return Objects.equals(this.attributes, updateResourceEvaluationFiltersResponseData.attributes) + && Objects.equals(this.id, updateResourceEvaluationFiltersResponseData.id) + && Objects.equals(this.type, updateResourceEvaluationFiltersResponseData.type) + && Objects.equals( + this.additionalProperties, + updateResourceEvaluationFiltersResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateResourceEvaluationFiltersResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/cassettes/features/v2/List_resource_filters_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..1bcb49531c6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-05-06T08:24:43.362Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_resource_filters_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_Bad_Request_response.json new file mode 100644 index 00000000000..b2e670b88e7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_Bad_Request_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/cloud_security_management/resource_filters", + "queryStringParameters": { + "account_id": [ + "123456789" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Field 'account_id' is invalid: account_id provided without specifying the cloud provider\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "08839a3d-63fc-9127-123f-fc356c178826" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_resource_filters_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_OK_response.freeze new file mode 100644 index 00000000000..e99096d4723 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-05-06T10:03:18.837Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_resource_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_OK_response.json new file mode 100644 index 00000000000..e12085508f8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_resource_filters_returns_OK_response.json @@ -0,0 +1,36 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/cloud_security_management/resource_filters", + "queryStringParameters": { + "cloud_provider": [ + "aws" + ], + "account_id": [ + "123456789" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"436195a0-5491-42a8-ac40-e0c0b61879bd\",\"type\":\"csm_resource_filter\",\"attributes\":{\"cloud_provider\":{}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "000eff50-ec68-762b-ad7f-1f9d22febfbf" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..43e0b15fe00 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-05-15T09:52:48.266Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_Bad_Request_response.json new file mode 100644 index 00000000000..05993241895 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"cloud_provider\":{\"invalid\":{\"aws_account_id\":[\"tag1:v1\"]}}},\"id\":\"csm_resource_filter\",\"type\":\"csm_resource_filter\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/cloud_security_management/resource_filters", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Invalid cloud provider invalid\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cce07500-c645-2924-d6e9-0016839fe00e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_OK_response.freeze new file mode 100644 index 00000000000..f30bda1aa9d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-05-15T09:52:49.297Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_OK_response.json new file mode 100644 index 00000000000..5003a8315b3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_resource_filters_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"cloud_provider\":{\"aws\":{\"aws_account_id\":[\"tag1:v1\"]}}},\"id\":\"csm_resource_filter\",\"type\":\"csm_resource_filter\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/cloud_security_management/resource_filters", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"csm_resource_filter\",\"type\":\"csm_resource_filter\",\"attributes\":{\"cloud_provider\":{\"aws\":{\"aws_account_id\":[\"tag1:v1\"]}},\"uuid\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6d030ff7-efca-3875-1ee2-e8125e5bad83" + } +] \ No newline at end of file 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 0d71c0b6e18..57200a3663e 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 @@ -872,6 +872,21 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform + Scenario: List resource filters returns "Bad Request" response + Given new "GetResourceEvaluationFilters" request + And request contains "account_id" parameter with value "123456789" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-cloud-security-platform + Scenario: List resource filters returns "OK" response + Given new "GetResourceEvaluationFilters" request + And request contains "cloud_provider" parameter with value "aws" + And request contains "account_id" parameter with value "123456789" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: List rules returns "Bad Request" response Given new "ListSecurityMonitoringRules" request @@ -1260,6 +1275,20 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}-Updated" And the response "id" has the same value as "security_rule.id" + @team:DataDog/k9-cloud-security-platform + Scenario: Update resource filters returns "Bad Request" response + Given new "UpdateResourceEvaluationFilters" request + And body with value {"data": {"attributes": {"cloud_provider": {"invalid": {"aws_account_id": ["tag1:v1"]}}}, "id": "csm_resource_filter", "type": "csm_resource_filter"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-cloud-security-platform + Scenario: Update resource filters returns "OK" response + Given new "UpdateResourceEvaluationFilters" request + And body with value {"data": {"attributes": {"cloud_provider": {"aws": {"aws_account_id": ["tag1:v1"]}}}, "id": "csm_resource_filter", "type": "csm_resource_filter"}} + When the request is sent + Then the response status is 201 OK + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-typescript @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Validate a detection rule returns "Bad Request" response Given new "ValidateSecurityMonitoringRule" 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 b9ea72c1d00..6f0ee3848a7 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 @@ -548,6 +548,18 @@ "type": "idempotent" } }, + "GetResourceEvaluationFilters": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateResourceEvaluationFilters": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListContainerImages": { "tag": "Container Images", "undo": {