diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a0d18121678..bbbf3bfc986 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20370,6 +20370,266 @@ components: - ASSIGNEE - CASE - TEAM_OWNERS + GetMultipleRulesetsRequest: + description: The definition of `GetMultipleRulesetsRequest` object. + properties: + data: + $ref: '#/components/schemas/GetMultipleRulesetsRequestData' + type: object + GetMultipleRulesetsRequestData: + description: The definition of `GetMultipleRulesetsRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/GetMultipleRulesetsRequestDataAttributes' + id: + description: The `GetMultipleRulesetsRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsRequestDataType' + required: + - type + type: object + GetMultipleRulesetsRequestDataAttributes: + description: The definition of `GetMultipleRulesetsRequestDataAttributes` object. + properties: + include_testing_rules: + description: The `attributes` `include_testing_rules`. + type: boolean + include_tests: + description: The `attributes` `include_tests`. + type: boolean + rulesets: + description: The `attributes` `rulesets`. + items: + type: string + type: array + type: object + GetMultipleRulesetsRequestDataType: + default: get_multiple_rulesets_request + description: Get multiple rulesets request resource type. + enum: + - get_multiple_rulesets_request + example: get_multiple_rulesets_request + type: string + x-enum-varnames: + - GET_MULTIPLE_RULESETS_REQUEST + GetMultipleRulesetsResponse: + description: The definition of `GetMultipleRulesetsResponse` object. + properties: + data: + $ref: '#/components/schemas/GetMultipleRulesetsResponseData' + type: object + GetMultipleRulesetsResponseData: + description: The definition of `GetMultipleRulesetsResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributes' + id: + description: The `GetMultipleRulesetsResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataType' + required: + - type + type: object + GetMultipleRulesetsResponseDataAttributes: + description: The definition of `GetMultipleRulesetsResponseDataAttributes` object. + properties: + rulesets: + description: The `attributes` `rulesets`. + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItems' + type: array + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItems: + description: The definition of `GetMultipleRulesetsResponseDataAttributesRulesetsItems` + object. + properties: + data: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsData' + description: + description: The `items` `description`. + type: string + name: + description: The `items` `name`. + type: string + rules: + description: The `items` `rules`. + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems' + type: array + short_description: + description: The `items` `short_description`. + type: string + required: + - data + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData: + description: The definition of `GetMultipleRulesetsResponseDataAttributesRulesetsItemsData` + object. + properties: + id: + description: The `data` `id`. + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType' + required: + - type + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType: + default: rulesets + description: Rulesets resource type. + enum: + - rulesets + example: rulesets + type: string + x-enum-varnames: + - RULESETS + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems: + description: The definition of `GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems` + object. + properties: + arguments: + description: The `items` `arguments`. + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems' + type: array + category: + description: The `items` `category`. + type: string + checksum: + description: The `items` `checksum`. + type: string + code: + description: The `items` `code`. + type: string + created_at: + description: The `items` `created_at`. + format: date-time + type: string + created_by: + description: The `items` `created_by`. + type: string + cve: + description: The `items` `cve`. + type: string + cwe: + description: The `items` `cwe`. + type: string + data: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData' + description: + description: The `items` `description`. + type: string + documentation_url: + description: The `items` `documentation_url`. + type: string + entity_checked: + description: The `items` `entity_checked`. + type: string + is_published: + description: The `items` `is_published`. + type: boolean + is_testing: + description: The `items` `is_testing`. + type: boolean + language: + description: The `items` `language`. + type: string + last_updated_at: + description: The `items` `last_updated_at`. + format: date-time + type: string + last_updated_by: + description: The `items` `last_updated_by`. + type: string + name: + description: The `items` `name`. + type: string + regex: + description: The `items` `regex`. + type: string + severity: + description: The `items` `severity`. + type: string + short_description: + description: The `items` `short_description`. + type: string + should_use_ai_fix: + description: The `items` `should_use_ai_fix`. + type: boolean + tests: + description: The `items` `tests`. + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems' + type: array + tree_sitter_query: + description: The `items` `tree_sitter_query`. + type: string + type: + description: The `items` `type`. + type: string + required: + - data + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems: + description: The definition of `GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems` + object. + properties: + description: + description: The `items` `description`. + type: string + name: + description: The `items` `name`. + type: string + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData: + description: The definition of `GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData` + object. + properties: + id: + description: The `data` `id`. + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType' + required: + - type + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType: + default: rules + description: Rules resource type. + enum: + - rules + example: rules + type: string + x-enum-varnames: + - RULES + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems: + description: The definition of `GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems` + object. + properties: + annotation_count: + description: The `items` `annotation_count`. + format: int64 + maximum: 65535 + minimum: 0 + type: integer + code: + description: The `items` `code`. + type: string + filename: + description: The `items` `filename`. + type: string + type: object + GetMultipleRulesetsResponseDataType: + default: get_multiple_rulesets_response + description: Get multiple rulesets response resource type. + enum: + - get_multiple_rulesets_response + example: get_multiple_rulesets_response + type: string + x-enum-varnames: + - GET_MULTIPLE_RULESETS_RESPONSE GetResourceEvaluationFiltersResponse: description: The definition of `GetResourceEvaluationFiltersResponse` object. properties: @@ -40993,6 +41253,146 @@ components: - ISSUE_ASSIGNEE - ISSUE_CASE - ISSUE_TEAM_OWNERS + SecretRuleArray: + description: The definition of `SecretRuleArray` object. + properties: + data: + description: The `SecretRuleArray` `data`. + items: + $ref: '#/components/schemas/SecretRuleData' + type: array + required: + - data + type: object + SecretRuleData: + description: The definition of `SecretRuleData` object. + properties: + attributes: + $ref: '#/components/schemas/SecretRuleDataAttributes' + id: + description: The `SecretRuleData` `id`. + type: string + type: + $ref: '#/components/schemas/SecretRuleDataType' + required: + - type + type: object + SecretRuleDataAttributes: + description: The definition of `SecretRuleDataAttributes` object. + properties: + default_included_keywords: + description: The `attributes` `default_included_keywords`. + items: + type: string + type: array + description: + description: The `attributes` `description`. + type: string + license: + description: The `attributes` `license`. + type: string + match_validation: + $ref: '#/components/schemas/SecretRuleDataAttributesMatchValidation' + name: + description: The `attributes` `name`. + type: string + pattern: + description: The `attributes` `pattern`. + type: string + priority: + description: The `attributes` `priority`. + type: string + sds_id: + description: The `attributes` `sds_id`. + type: string + validators: + description: The `attributes` `validators`. + items: + type: string + type: array + type: object + SecretRuleDataAttributesMatchValidation: + description: The definition of `SecretRuleDataAttributesMatchValidation` object. + properties: + endpoint: + description: The `match_validation` `endpoint`. + type: string + hosts: + description: The `match_validation` `hosts`. + items: + type: string + type: array + http_method: + description: The `match_validation` `http_method`. + type: string + invalid_http_status_code: + description: The `match_validation` `invalid_http_status_code`. + items: + $ref: '#/components/schemas/SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems' + type: array + request_headers: + additionalProperties: + type: string + description: The `match_validation` `request_headers`. + type: object + timeout_seconds: + description: The `match_validation` `timeout_seconds`. + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + type: + description: The `match_validation` `type`. + type: string + valid_http_status_code: + description: The `match_validation` `valid_http_status_code`. + items: + $ref: '#/components/schemas/SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems' + type: array + type: object + SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems: + description: The definition of `SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems` + object. + properties: + end: + description: The `items` `end`. + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + start: + description: The `items` `start`. + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + type: object + SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems: + description: The definition of `SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems` + object. + properties: + end: + description: The `items` `end`. + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + start: + description: The `items` `start`. + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + type: object + SecretRuleDataType: + default: secret_rule + description: Secret rule resource type. + enum: + - secret_rule + example: secret_rule + type: string + x-enum-varnames: + - SECRET_RULE SecurityFilter: description: The security filter's properties. properties: @@ -73498,6 +73898,57 @@ paths: cursorPath: meta.page.after limitParam: body.data.attributes.page.limit resultsPath: data + /api/v2/static-analysis/rulesets: + post: + description: Get rules for multiple rulesets in batch. + operationId: ListMultipleRulesets + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMultipleRulesetsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetMultipleRulesetsResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - AuthZ: + - code_analysis_read + - apiKeyAuth: [] + appKeyAuth: [] + summary: Ruleset get multiple + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis/secrets/rules: + get: + description: Returns list of Secrets rules with ID, Pattern, Description, Priority, + and SDS ID + operationId: GetSecretsRules + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecretRuleArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - AuthZ: + - code_analysis_read + - apiKeyAuth: [] + appKeyAuth: [] + summary: Returns list of Secrets rules + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. diff --git a/examples/v2/security-monitoring/GetSecretsRules.java b/examples/v2/security-monitoring/GetSecretsRules.java new file mode 100644 index 00000000000..9a2dda746b3 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecretsRules.java @@ -0,0 +1,25 @@ +// Returns list of Secrets rules 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.SecretRuleArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getSecretsRules", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + SecretRuleArray result = apiInstance.getSecretsRules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getSecretsRules"); + 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/ListMultipleRulesets.java b/examples/v2/security-monitoring/ListMultipleRulesets.java new file mode 100644 index 00000000000..04972f5ea22 --- /dev/null +++ b/examples/v2/security-monitoring/ListMultipleRulesets.java @@ -0,0 +1,36 @@ +// Ruleset get multiple 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.GetMultipleRulesetsRequest; +import com.datadog.api.client.v2.model.GetMultipleRulesetsRequestData; +import com.datadog.api.client.v2.model.GetMultipleRulesetsRequestDataAttributes; +import com.datadog.api.client.v2.model.GetMultipleRulesetsRequestDataType; +import com.datadog.api.client.v2.model.GetMultipleRulesetsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listMultipleRulesets", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + GetMultipleRulesetsRequest body = + new GetMultipleRulesetsRequest() + .data( + new GetMultipleRulesetsRequestData() + .attributes(new GetMultipleRulesetsRequestDataAttributes()) + .type(GetMultipleRulesetsRequestDataType.GET_MULTIPLE_RULESETS_REQUEST)); + + try { + GetMultipleRulesetsResponse result = apiInstance.listMultipleRulesets(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#listMultipleRulesets"); + 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 089349ea92e..f82af3dbdfc 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -699,11 +699,13 @@ public class ApiClient { put("v2.getHistoricalJob", false); put("v2.getRuleVersionHistory", false); put("v2.getSBOM", false); + put("v2.getSecretsRules", false); put("v2.getSecurityMonitoringHistsignal", false); put("v2.getSecurityMonitoringHistsignalsByJobId", false); put("v2.listAssetsSBOMs", false); put("v2.listFindings", false); put("v2.listHistoricalJobs", false); + put("v2.listMultipleRulesets", false); put("v2.listSecurityMonitoringHistsignals", false); put("v2.listVulnerabilities", false); put("v2.listVulnerableAssets", 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 7ccf094aeaf..b15e10fd5fc 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,8 @@ 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.GetMultipleRulesetsRequest; +import com.datadog.api.client.v2.model.GetMultipleRulesetsResponse; import com.datadog.api.client.v2.model.GetResourceEvaluationFiltersResponse; import com.datadog.api.client.v2.model.GetRuleVersionHistoryResponse; import com.datadog.api.client.v2.model.GetSBOMResponse; @@ -33,6 +35,7 @@ import com.datadog.api.client.v2.model.PatchNotificationRuleParameters; import com.datadog.api.client.v2.model.RunHistoricalJobRequest; import com.datadog.api.client.v2.model.SBOMComponentLicenseType; +import com.datadog.api.client.v2.model.SecretRuleArray; import com.datadog.api.client.v2.model.SecurityFilterCreateRequest; import com.datadog.api.client.v2.model.SecurityFilterResponse; import com.datadog.api.client.v2.model.SecurityFilterUpdateRequest; @@ -4269,6 +4272,131 @@ public CompletableFuture> getSBOMWithHttpInfoAsync( new GenericType() {}); } + /** + * Returns list of Secrets rules. + * + *

See {@link #getSecretsRulesWithHttpInfo}. + * + * @return SecretRuleArray + * @throws ApiException if fails to make API call + */ + public SecretRuleArray getSecretsRules() throws ApiException { + return getSecretsRulesWithHttpInfo().getData(); + } + + /** + * Returns list of Secrets rules. + * + *

See {@link #getSecretsRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<SecretRuleArray> + */ + public CompletableFuture getSecretsRulesAsync() { + return getSecretsRulesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID + * + * @return ApiResponse<SecretRuleArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getSecretsRulesWithHttpInfo() throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSecretsRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/static-analysis/secrets/rules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getSecretsRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Returns list of Secrets rules. + * + *

See {@link #getSecretsRulesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<SecretRuleArray>> + */ + public CompletableFuture> getSecretsRulesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "getSecretsRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/static-analysis/secrets/rules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getSecretsRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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() {}); + } + /** * Get a security filter. * @@ -7211,6 +7339,157 @@ public ApiResponse listHistoricalJobsWithHttpInfo( new GenericType() {}); } + /** + * Ruleset get multiple. + * + *

See {@link #listMultipleRulesetsWithHttpInfo}. + * + * @param body (required) + * @return GetMultipleRulesetsResponse + * @throws ApiException if fails to make API call + */ + public GetMultipleRulesetsResponse listMultipleRulesets(GetMultipleRulesetsRequest body) + throws ApiException { + return listMultipleRulesetsWithHttpInfo(body).getData(); + } + + /** + * Ruleset get multiple. + * + *

See {@link #listMultipleRulesetsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<GetMultipleRulesetsResponse> + */ + public CompletableFuture listMultipleRulesetsAsync( + GetMultipleRulesetsRequest body) { + return listMultipleRulesetsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get rules for multiple rulesets in batch. + * + * @param body (required) + * @return ApiResponse<GetMultipleRulesetsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse listMultipleRulesetsWithHttpInfo( + GetMultipleRulesetsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listMultipleRulesets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling listMultipleRulesets"); + } + // create path and map variables + String localVarPath = "/api/v2/static-analysis/rulesets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listMultipleRulesets", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Ruleset get multiple. + * + *

See {@link #listMultipleRulesetsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<GetMultipleRulesetsResponse>> + */ + public CompletableFuture> + listMultipleRulesetsWithHttpInfoAsync(GetMultipleRulesetsRequest body) { + // Check if unstable operation is enabled + String operationId = "listMultipleRulesets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + 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 listMultipleRulesets")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/static-analysis/rulesets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listMultipleRulesets", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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, + new GenericType() {}); + } + /** * Get all security filters. * diff --git a/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequest.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequest.java new file mode 100644 index 00000000000..3f9a82f09e6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequest.java @@ -0,0 +1,137 @@ +/* + * 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 GetMultipleRulesetsRequest object. */ +@JsonPropertyOrder({GetMultipleRulesetsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetMultipleRulesetsRequestData data; + + public GetMultipleRulesetsRequest data(GetMultipleRulesetsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of GetMultipleRulesetsRequestData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetMultipleRulesetsRequestData getData() { + return data; + } + + public void setData(GetMultipleRulesetsRequestData 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 GetMultipleRulesetsRequest + */ + @JsonAnySetter + public GetMultipleRulesetsRequest 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 GetMultipleRulesetsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsRequest getMultipleRulesetsRequest = (GetMultipleRulesetsRequest) o; + return Objects.equals(this.data, getMultipleRulesetsRequest.data) + && Objects.equals( + this.additionalProperties, getMultipleRulesetsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsRequest {\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/GetMultipleRulesetsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequestData.java new file mode 100644 index 00000000000..ba93518fd23 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequestData.java @@ -0,0 +1,210 @@ +/* + * 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 GetMultipleRulesetsRequestData object. */ +@JsonPropertyOrder({ + GetMultipleRulesetsRequestData.JSON_PROPERTY_ATTRIBUTES, + GetMultipleRulesetsRequestData.JSON_PROPERTY_ID, + GetMultipleRulesetsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GetMultipleRulesetsRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GetMultipleRulesetsRequestDataType type = + GetMultipleRulesetsRequestDataType.GET_MULTIPLE_RULESETS_REQUEST; + + public GetMultipleRulesetsRequestData() {} + + @JsonCreator + public GetMultipleRulesetsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GetMultipleRulesetsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetMultipleRulesetsRequestData attributes( + GetMultipleRulesetsRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of GetMultipleRulesetsRequestDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetMultipleRulesetsRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GetMultipleRulesetsRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public GetMultipleRulesetsRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The GetMultipleRulesetsRequestData 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 GetMultipleRulesetsRequestData type(GetMultipleRulesetsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Get multiple rulesets request resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetMultipleRulesetsRequestDataType getType() { + return type; + } + + public void setType(GetMultipleRulesetsRequestDataType 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 GetMultipleRulesetsRequestData + */ + @JsonAnySetter + public GetMultipleRulesetsRequestData 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 GetMultipleRulesetsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsRequestData getMultipleRulesetsRequestData = + (GetMultipleRulesetsRequestData) o; + return Objects.equals(this.attributes, getMultipleRulesetsRequestData.attributes) + && Objects.equals(this.id, getMultipleRulesetsRequestData.id) + && Objects.equals(this.type, getMultipleRulesetsRequestData.type) + && Objects.equals( + this.additionalProperties, getMultipleRulesetsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsRequestData {\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/GetMultipleRulesetsRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequestDataAttributes.java new file mode 100644 index 00000000000..14197a51791 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequestDataAttributes.java @@ -0,0 +1,207 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of GetMultipleRulesetsRequestDataAttributes object. */ +@JsonPropertyOrder({ + GetMultipleRulesetsRequestDataAttributes.JSON_PROPERTY_INCLUDE_TESTING_RULES, + GetMultipleRulesetsRequestDataAttributes.JSON_PROPERTY_INCLUDE_TESTS, + GetMultipleRulesetsRequestDataAttributes.JSON_PROPERTY_RULESETS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_TESTING_RULES = "include_testing_rules"; + private Boolean includeTestingRules; + + public static final String JSON_PROPERTY_INCLUDE_TESTS = "include_tests"; + private Boolean includeTests; + + public static final String JSON_PROPERTY_RULESETS = "rulesets"; + private List rulesets = null; + + public GetMultipleRulesetsRequestDataAttributes includeTestingRules(Boolean includeTestingRules) { + this.includeTestingRules = includeTestingRules; + return this; + } + + /** + * The attributes include_testing_rules. + * + * @return includeTestingRules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDE_TESTING_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeTestingRules() { + return includeTestingRules; + } + + public void setIncludeTestingRules(Boolean includeTestingRules) { + this.includeTestingRules = includeTestingRules; + } + + public GetMultipleRulesetsRequestDataAttributes includeTests(Boolean includeTests) { + this.includeTests = includeTests; + return this; + } + + /** + * The attributes include_tests. + * + * @return includeTests + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDE_TESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeTests() { + return includeTests; + } + + public void setIncludeTests(Boolean includeTests) { + this.includeTests = includeTests; + } + + public GetMultipleRulesetsRequestDataAttributes rulesets(List rulesets) { + this.rulesets = rulesets; + return this; + } + + public GetMultipleRulesetsRequestDataAttributes addRulesetsItem(String rulesetsItem) { + if (this.rulesets == null) { + this.rulesets = new ArrayList<>(); + } + this.rulesets.add(rulesetsItem); + return this; + } + + /** + * The attributes rulesets. + * + * @return rulesets + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULESETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRulesets() { + return rulesets; + } + + public void setRulesets(List rulesets) { + this.rulesets = rulesets; + } + + /** + * 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 GetMultipleRulesetsRequestDataAttributes + */ + @JsonAnySetter + public GetMultipleRulesetsRequestDataAttributes 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 GetMultipleRulesetsRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsRequestDataAttributes getMultipleRulesetsRequestDataAttributes = + (GetMultipleRulesetsRequestDataAttributes) o; + return Objects.equals( + this.includeTestingRules, getMultipleRulesetsRequestDataAttributes.includeTestingRules) + && Objects.equals(this.includeTests, getMultipleRulesetsRequestDataAttributes.includeTests) + && Objects.equals(this.rulesets, getMultipleRulesetsRequestDataAttributes.rulesets) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeTestingRules, includeTests, rulesets, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsRequestDataAttributes {\n"); + sb.append(" includeTestingRules: ") + .append(toIndentedString(includeTestingRules)) + .append("\n"); + sb.append(" includeTests: ").append(toIndentedString(includeTests)).append("\n"); + sb.append(" rulesets: ").append(toIndentedString(rulesets)).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/GetMultipleRulesetsRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequestDataType.java new file mode 100644 index 00000000000..0e422484dfa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsRequestDataType.java @@ -0,0 +1,59 @@ +/* + * 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; + +/** Get multiple rulesets request resource type. */ +@JsonSerialize( + using = GetMultipleRulesetsRequestDataType.GetMultipleRulesetsRequestDataTypeSerializer.class) +public class GetMultipleRulesetsRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("get_multiple_rulesets_request")); + + public static final GetMultipleRulesetsRequestDataType GET_MULTIPLE_RULESETS_REQUEST = + new GetMultipleRulesetsRequestDataType("get_multiple_rulesets_request"); + + GetMultipleRulesetsRequestDataType(String value) { + super(value, allowedValues); + } + + public static class GetMultipleRulesetsRequestDataTypeSerializer + extends StdSerializer { + public GetMultipleRulesetsRequestDataTypeSerializer( + Class t) { + super(t); + } + + public GetMultipleRulesetsRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GetMultipleRulesetsRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GetMultipleRulesetsRequestDataType fromValue(String value) { + return new GetMultipleRulesetsRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponse.java new file mode 100644 index 00000000000..bc63df9b324 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponse.java @@ -0,0 +1,137 @@ +/* + * 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 GetMultipleRulesetsResponse object. */ +@JsonPropertyOrder({GetMultipleRulesetsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetMultipleRulesetsResponseData data; + + public GetMultipleRulesetsResponse data(GetMultipleRulesetsResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of GetMultipleRulesetsResponseData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetMultipleRulesetsResponseData getData() { + return data; + } + + public void setData(GetMultipleRulesetsResponseData 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 GetMultipleRulesetsResponse + */ + @JsonAnySetter + public GetMultipleRulesetsResponse 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 GetMultipleRulesetsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponse getMultipleRulesetsResponse = (GetMultipleRulesetsResponse) o; + return Objects.equals(this.data, getMultipleRulesetsResponse.data) + && Objects.equals( + this.additionalProperties, getMultipleRulesetsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponse {\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/GetMultipleRulesetsResponseData.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseData.java new file mode 100644 index 00000000000..85e00363443 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseData.java @@ -0,0 +1,210 @@ +/* + * 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 GetMultipleRulesetsResponseData object. */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseData.JSON_PROPERTY_ATTRIBUTES, + GetMultipleRulesetsResponseData.JSON_PROPERTY_ID, + GetMultipleRulesetsResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GetMultipleRulesetsResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GetMultipleRulesetsResponseDataType type = + GetMultipleRulesetsResponseDataType.GET_MULTIPLE_RULESETS_RESPONSE; + + public GetMultipleRulesetsResponseData() {} + + @JsonCreator + public GetMultipleRulesetsResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GetMultipleRulesetsResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetMultipleRulesetsResponseData attributes( + GetMultipleRulesetsResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of GetMultipleRulesetsResponseDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetMultipleRulesetsResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GetMultipleRulesetsResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public GetMultipleRulesetsResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The GetMultipleRulesetsResponseData 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 GetMultipleRulesetsResponseData type(GetMultipleRulesetsResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Get multiple rulesets response resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetMultipleRulesetsResponseDataType getType() { + return type; + } + + public void setType(GetMultipleRulesetsResponseDataType 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 GetMultipleRulesetsResponseData + */ + @JsonAnySetter + public GetMultipleRulesetsResponseData 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 GetMultipleRulesetsResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseData getMultipleRulesetsResponseData = + (GetMultipleRulesetsResponseData) o; + return Objects.equals(this.attributes, getMultipleRulesetsResponseData.attributes) + && Objects.equals(this.id, getMultipleRulesetsResponseData.id) + && Objects.equals(this.type, getMultipleRulesetsResponseData.type) + && Objects.equals( + this.additionalProperties, getMultipleRulesetsResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponseData {\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/GetMultipleRulesetsResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributes.java new file mode 100644 index 00000000000..c153a6f83d9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributes.java @@ -0,0 +1,154 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of GetMultipleRulesetsResponseDataAttributes object. */ +@JsonPropertyOrder({GetMultipleRulesetsResponseDataAttributes.JSON_PROPERTY_RULESETS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RULESETS = "rulesets"; + private List rulesets = null; + + public GetMultipleRulesetsResponseDataAttributes rulesets( + List rulesets) { + this.rulesets = rulesets; + for (GetMultipleRulesetsResponseDataAttributesRulesetsItems item : rulesets) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GetMultipleRulesetsResponseDataAttributes addRulesetsItem( + GetMultipleRulesetsResponseDataAttributesRulesetsItems rulesetsItem) { + if (this.rulesets == null) { + this.rulesets = new ArrayList<>(); + } + this.rulesets.add(rulesetsItem); + this.unparsed |= rulesetsItem.unparsed; + return this; + } + + /** + * The attributes rulesets. + * + * @return rulesets + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULESETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRulesets() { + return rulesets; + } + + public void setRulesets(List rulesets) { + this.rulesets = rulesets; + } + + /** + * 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 GetMultipleRulesetsResponseDataAttributes + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributes 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 GetMultipleRulesetsResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributes getMultipleRulesetsResponseDataAttributes = + (GetMultipleRulesetsResponseDataAttributes) o; + return Objects.equals(this.rulesets, getMultipleRulesetsResponseDataAttributes.rulesets) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rulesets, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponseDataAttributes {\n"); + sb.append(" rulesets: ").append(toIndentedString(rulesets)).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/GetMultipleRulesetsResponseDataAttributesRulesetsItems.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItems.java new file mode 100644 index 00000000000..5a94fbc3ffa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItems.java @@ -0,0 +1,287 @@ +/* + * 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; + +/** The definition of GetMultipleRulesetsResponseDataAttributesRulesetsItems object. */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseDataAttributesRulesetsItems.JSON_PROPERTY_DATA, + GetMultipleRulesetsResponseDataAttributesRulesetsItems.JSON_PROPERTY_DESCRIPTION, + GetMultipleRulesetsResponseDataAttributesRulesetsItems.JSON_PROPERTY_NAME, + GetMultipleRulesetsResponseDataAttributesRulesetsItems.JSON_PROPERTY_RULES, + GetMultipleRulesetsResponseDataAttributesRulesetsItems.JSON_PROPERTY_SHORT_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributesRulesetsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetMultipleRulesetsResponseDataAttributesRulesetsItemsData data; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULES = "rules"; + private List rules = null; + + public static final String JSON_PROPERTY_SHORT_DESCRIPTION = "short_description"; + private String shortDescription; + + public GetMultipleRulesetsResponseDataAttributesRulesetsItems() {} + + @JsonCreator + public GetMultipleRulesetsResponseDataAttributesRulesetsItems( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItems data( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of GetMultipleRulesetsResponseDataAttributesRulesetsItemsData + * object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsData getData() { + return data; + } + + public void setData(GetMultipleRulesetsResponseDataAttributesRulesetsItemsData data) { + this.data = data; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItems description(String description) { + this.description = description; + return this; + } + + /** + * The items 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 GetMultipleRulesetsResponseDataAttributesRulesetsItems name(String name) { + this.name = name; + return this; + } + + /** + * The items name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItems rules( + List rules) { + this.rules = rules; + for (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems item : rules) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItems addRulesItem( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); + } + this.rules.add(rulesItem); + this.unparsed |= rulesItem.unparsed; + return this; + } + + /** + * The items rules. + * + * @return rules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRules() { + return rules; + } + + public void setRules( + List rules) { + this.rules = rules; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItems shortDescription( + String shortDescription) { + this.shortDescription = shortDescription; + return this; + } + + /** + * The items short_description. + * + * @return shortDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHORT_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortDescription() { + return shortDescription; + } + + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + + /** + * 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 GetMultipleRulesetsResponseDataAttributesRulesetsItems + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributesRulesetsItems 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 GetMultipleRulesetsResponseDataAttributesRulesetsItems object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributesRulesetsItems + getMultipleRulesetsResponseDataAttributesRulesetsItems = + (GetMultipleRulesetsResponseDataAttributesRulesetsItems) o; + return Objects.equals(this.data, getMultipleRulesetsResponseDataAttributesRulesetsItems.data) + && Objects.equals( + this.description, getMultipleRulesetsResponseDataAttributesRulesetsItems.description) + && Objects.equals(this.name, getMultipleRulesetsResponseDataAttributesRulesetsItems.name) + && Objects.equals(this.rules, getMultipleRulesetsResponseDataAttributesRulesetsItems.rules) + && Objects.equals( + this.shortDescription, + getMultipleRulesetsResponseDataAttributesRulesetsItems.shortDescription) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributesRulesetsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, description, name, rules, shortDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponseDataAttributesRulesetsItems {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" shortDescription: ").append(toIndentedString(shortDescription)).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/GetMultipleRulesetsResponseDataAttributesRulesetsItemsData.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsData.java new file mode 100644 index 00000000000..bd447b88f26 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsData.java @@ -0,0 +1,191 @@ +/* + * 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsData object. + */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData.JSON_PROPERTY_ID, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType type = + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType.RULESETS; + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsData() {} + + @JsonCreator + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsData 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsData type( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Rulesets resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType getType() { + return type; + } + + public void setType(GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsData + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsData 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsData object is equal + * to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData + getMultipleRulesetsResponseDataAttributesRulesetsItemsData = + (GetMultipleRulesetsResponseDataAttributesRulesetsItemsData) o; + return Objects.equals(this.id, getMultipleRulesetsResponseDataAttributesRulesetsItemsData.id) + && Objects.equals( + this.type, getMultipleRulesetsResponseDataAttributesRulesetsItemsData.type) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributesRulesetsItemsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponseDataAttributesRulesetsItemsData {\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/GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType.java new file mode 100644 index 00000000000..c9c38bb7f65 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType.java @@ -0,0 +1,64 @@ +/* + * 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; + +/** Rulesets resource type. */ +@JsonSerialize( + using = + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType + .GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataTypeSerializer.class) +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType + extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("rulesets")); + + public static final GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType RULESETS = + new GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType("rulesets"); + + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType(String value) { + super(value, allowedValues); + } + + public static class GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataTypeSerializer + extends StdSerializer { + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataTypeSerializer( + Class t) { + super(t); + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType fromValue( + String value) { + return new GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.java new file mode 100644 index 00000000000..2e9dca98129 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.java @@ -0,0 +1,934 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems + * object. + */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_ARGUMENTS, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CATEGORY, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CHECKSUM, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CODE, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CREATED_AT, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CREATED_BY, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CVE, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_CWE, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_DATA, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_DESCRIPTION, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_DOCUMENTATION_URL, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_ENTITY_CHECKED, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_IS_PUBLISHED, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_IS_TESTING, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_LANGUAGE, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_LAST_UPDATED_AT, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_LAST_UPDATED_BY, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_NAME, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_REGEX, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_SEVERITY, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_SHORT_DESCRIPTION, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_SHOULD_USE_AI_FIX, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_TESTS, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_TREE_SITTER_QUERY, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARGUMENTS = "arguments"; + private List + arguments = null; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_CHECKSUM = "checksum"; + private String checksum; + + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_CVE = "cve"; + private String cve; + + public static final String JSON_PROPERTY_CWE = "cwe"; + private String cwe; + + public static final String JSON_PROPERTY_DATA = "data"; + private GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData data; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DOCUMENTATION_URL = "documentation_url"; + private String documentationUrl; + + public static final String JSON_PROPERTY_ENTITY_CHECKED = "entity_checked"; + private String entityChecked; + + public static final String JSON_PROPERTY_IS_PUBLISHED = "is_published"; + private Boolean isPublished; + + public static final String JSON_PROPERTY_IS_TESTING = "is_testing"; + private Boolean isTesting; + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private String language; + + public static final String JSON_PROPERTY_LAST_UPDATED_AT = "last_updated_at"; + private OffsetDateTime lastUpdatedAt; + + public static final String JSON_PROPERTY_LAST_UPDATED_BY = "last_updated_by"; + private String lastUpdatedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REGEX = "regex"; + private String regex; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private String severity; + + public static final String JSON_PROPERTY_SHORT_DESCRIPTION = "short_description"; + private String shortDescription; + + public static final String JSON_PROPERTY_SHOULD_USE_AI_FIX = "should_use_ai_fix"; + private Boolean shouldUseAiFix; + + public static final String JSON_PROPERTY_TESTS = "tests"; + private List tests = + null; + + public static final String JSON_PROPERTY_TREE_SITTER_QUERY = "tree_sitter_query"; + private String treeSitterQuery; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems() {} + + @JsonCreator + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems arguments( + List + arguments) { + this.arguments = arguments; + for (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems item : + arguments) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems addArgumentsItem( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + argumentsItem) { + if (this.arguments == null) { + this.arguments = new ArrayList<>(); + } + this.arguments.add(argumentsItem); + this.unparsed |= argumentsItem.unparsed; + return this; + } + + /** + * The items arguments. + * + * @return arguments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List + getArguments() { + return arguments; + } + + public void setArguments( + List + arguments) { + this.arguments = arguments; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems category( + String category) { + this.category = category; + return this; + } + + /** + * The items category. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems checksum( + String checksum) { + this.checksum = checksum; + return this; + } + + /** + * The items checksum. + * + * @return checksum + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHECKSUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChecksum() { + return checksum; + } + + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems code(String code) { + this.code = code; + return this; + } + + /** + * The items code. + * + * @return code + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems createdAt( + OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The items created_at. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems createdBy( + String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * The items created_by. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems cve(String cve) { + this.cve = cve; + return this; + } + + /** + * The items cve. + * + * @return cve + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCve() { + return cve; + } + + public void setCve(String cve) { + this.cve = cve; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems cwe(String cwe) { + this.cwe = cwe; + return this; + } + + /** + * The items cwe. + * + * @return cwe + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CWE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCwe() { + return cwe; + } + + public void setCwe(String cwe) { + this.cwe = cwe; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems data( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData + * object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData getData() { + return data; + } + + public void setData(GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData data) { + this.data = data; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems description( + String description) { + this.description = description; + return this; + } + + /** + * The items 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems documentationUrl( + String documentationUrl) { + this.documentationUrl = documentationUrl; + return this; + } + + /** + * The items documentation_url. + * + * @return documentationUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOCUMENTATION_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDocumentationUrl() { + return documentationUrl; + } + + public void setDocumentationUrl(String documentationUrl) { + this.documentationUrl = documentationUrl; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems entityChecked( + String entityChecked) { + this.entityChecked = entityChecked; + return this; + } + + /** + * The items entity_checked. + * + * @return entityChecked + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTITY_CHECKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntityChecked() { + return entityChecked; + } + + public void setEntityChecked(String entityChecked) { + this.entityChecked = entityChecked; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems isPublished( + Boolean isPublished) { + this.isPublished = isPublished; + return this; + } + + /** + * The items is_published. + * + * @return isPublished + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PUBLISHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPublished() { + return isPublished; + } + + public void setIsPublished(Boolean isPublished) { + this.isPublished = isPublished; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems isTesting( + Boolean isTesting) { + this.isTesting = isTesting; + return this; + } + + /** + * The items is_testing. + * + * @return isTesting + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsTesting() { + return isTesting; + } + + public void setIsTesting(Boolean isTesting) { + this.isTesting = isTesting; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems language( + String language) { + this.language = language; + return this; + } + + /** + * The items language. + * + * @return language + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems lastUpdatedAt( + OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + return this; + } + + /** + * The items last_updated_at. + * + * @return lastUpdatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastUpdatedAt() { + return lastUpdatedAt; + } + + public void setLastUpdatedAt(OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems lastUpdatedBy( + String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + return this; + } + + /** + * The items last_updated_by. + * + * @return lastUpdatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems name(String name) { + this.name = name; + return this; + } + + /** + * The items name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems regex(String regex) { + this.regex = regex; + return this; + } + + /** + * The items regex. + * + * @return regex + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRegex() { + return regex; + } + + public void setRegex(String regex) { + this.regex = regex; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems severity( + String severity) { + this.severity = severity; + return this; + } + + /** + * The items severity. + * + * @return severity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems shortDescription( + String shortDescription) { + this.shortDescription = shortDescription; + return this; + } + + /** + * The items short_description. + * + * @return shortDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHORT_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortDescription() { + return shortDescription; + } + + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems shouldUseAiFix( + Boolean shouldUseAiFix) { + this.shouldUseAiFix = shouldUseAiFix; + return this; + } + + /** + * The items should_use_ai_fix. + * + * @return shouldUseAiFix + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOULD_USE_AI_FIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShouldUseAiFix() { + return shouldUseAiFix; + } + + public void setShouldUseAiFix(Boolean shouldUseAiFix) { + this.shouldUseAiFix = shouldUseAiFix; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems tests( + List tests) { + this.tests = tests; + for (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems item : tests) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems addTestsItem( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems testsItem) { + if (this.tests == null) { + this.tests = new ArrayList<>(); + } + this.tests.add(testsItem); + this.unparsed |= testsItem.unparsed; + return this; + } + + /** + * The items tests. + * + * @return tests + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List + getTests() { + return tests; + } + + public void setTests( + List tests) { + this.tests = tests; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems treeSitterQuery( + String treeSitterQuery) { + this.treeSitterQuery = treeSitterQuery; + return this; + } + + /** + * The items tree_sitter_query. + * + * @return treeSitterQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TREE_SITTER_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTreeSitterQuery() { + return treeSitterQuery; + } + + public void setTreeSitterQuery(String treeSitterQuery) { + this.treeSitterQuery = treeSitterQuery; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems type(String type) { + this.type = type; + return this; + } + + /** + * The items type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems = + (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems) o; + return Objects.equals( + this.arguments, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.arguments) + && Objects.equals( + this.category, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.category) + && Objects.equals( + this.checksum, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.checksum) + && Objects.equals( + this.code, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.code) + && Objects.equals( + this.createdAt, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.createdAt) + && Objects.equals( + this.createdBy, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.createdBy) + && Objects.equals( + this.cve, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.cve) + && Objects.equals( + this.cwe, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.cwe) + && Objects.equals( + this.data, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.data) + && Objects.equals( + this.description, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.description) + && Objects.equals( + this.documentationUrl, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.documentationUrl) + && Objects.equals( + this.entityChecked, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.entityChecked) + && Objects.equals( + this.isPublished, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.isPublished) + && Objects.equals( + this.isTesting, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.isTesting) + && Objects.equals( + this.language, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.language) + && Objects.equals( + this.lastUpdatedAt, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.lastUpdatedAt) + && Objects.equals( + this.lastUpdatedBy, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.lastUpdatedBy) + && Objects.equals( + this.name, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.name) + && Objects.equals( + this.regex, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.regex) + && Objects.equals( + this.severity, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.severity) + && Objects.equals( + this.shortDescription, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.shortDescription) + && Objects.equals( + this.shouldUseAiFix, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.shouldUseAiFix) + && Objects.equals( + this.tests, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.tests) + && Objects.equals( + this.treeSitterQuery, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.treeSitterQuery) + && Objects.equals( + this.type, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.type) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + arguments, + category, + checksum, + code, + createdAt, + createdBy, + cve, + cwe, + data, + description, + documentationUrl, + entityChecked, + isPublished, + isTesting, + language, + lastUpdatedAt, + lastUpdatedBy, + name, + regex, + severity, + shortDescription, + shouldUseAiFix, + tests, + treeSitterQuery, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems {\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" cve: ").append(toIndentedString(cve)).append("\n"); + sb.append(" cwe: ").append(toIndentedString(cwe)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" documentationUrl: ").append(toIndentedString(documentationUrl)).append("\n"); + sb.append(" entityChecked: ").append(toIndentedString(entityChecked)).append("\n"); + sb.append(" isPublished: ").append(toIndentedString(isPublished)).append("\n"); + sb.append(" isTesting: ").append(toIndentedString(isTesting)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n"); + sb.append(" lastUpdatedBy: ").append(toIndentedString(lastUpdatedBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" regex: ").append(toIndentedString(regex)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" shortDescription: ").append(toIndentedString(shortDescription)).append("\n"); + sb.append(" shouldUseAiFix: ").append(toIndentedString(shouldUseAiFix)).append("\n"); + sb.append(" tests: ").append(toIndentedString(tests)).append("\n"); + sb.append(" treeSitterQuery: ").append(toIndentedString(treeSitterQuery)).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/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems.java new file mode 100644 index 00000000000..dbae328a802 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems.java @@ -0,0 +1,186 @@ +/* + * 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 + * GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems object. + */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + .JSON_PROPERTY_DESCRIPTION, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems description( + String description) { + this.description = description; + return this; + } + + /** + * The items 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems name( + String name) { + this.name = name; + return this; + } + + /** + * The items name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + 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 + * GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems object is equal + * to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems = + (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems) o; + return Objects.equals( + this.description, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + .description) + && Objects.equals( + this.name, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems.name) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems {\n"); + sb.append(" description: ").append(toIndentedString(description)).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/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.java new file mode 100644 index 00000000000..e920981e53a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.java @@ -0,0 +1,195 @@ +/* + * 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData + * object. + */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.JSON_PROPERTY_ID, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType type = + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType.RULES; + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData() {} + + @JsonCreator + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData type( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Rules resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType getType() { + return type; + } + + public void setType( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData object + * is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData = + (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData) o; + return Objects.equals( + this.id, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.id) + && Objects.equals( + this.type, getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData.type) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData {\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/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType.java new file mode 100644 index 00000000000..fba0da317b2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType.java @@ -0,0 +1,67 @@ +/* + * 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; + +/** Rules resource type. */ +@JsonSerialize( + using = + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType + .GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataTypeSerializer + .class) +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType + extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("rules")); + + public static final GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType + RULES = new GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType("rules"); + + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType(String value) { + super(value, allowedValues); + } + + public static + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataTypeSerializer + extends StdSerializer< + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType> { + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataTypeSerializer( + Class t) { + super(t); + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType fromValue( + String value) { + return new GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.java new file mode 100644 index 00000000000..703d24a4ee4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.java @@ -0,0 +1,215 @@ +/* + * 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 + * GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems object. + */ +@JsonPropertyOrder({ + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + .JSON_PROPERTY_ANNOTATION_COUNT, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.JSON_PROPERTY_CODE, + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.JSON_PROPERTY_FILENAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATION_COUNT = "annotation_count"; + private Long annotationCount; + + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_FILENAME = "filename"; + private String filename; + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems annotationCount( + Long annotationCount) { + this.annotationCount = annotationCount; + return this; + } + + /** + * The items annotation_count. minimum: 0 maximum: 65535 + * + * @return annotationCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANNOTATION_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getAnnotationCount() { + return annotationCount; + } + + public void setAnnotationCount(Long annotationCount) { + this.annotationCount = annotationCount; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems code( + String code) { + this.code = code; + return this; + } + + /** + * The items code. + * + * @return code + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems filename( + String filename) { + this.filename = filename; + return this; + } + + /** + * The items filename. + * + * @return filename + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILENAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + /** + * 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + */ + @JsonAnySetter + public GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + 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 GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + * object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems = + (GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems) o; + return Objects.equals( + this.annotationCount, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + .annotationCount) + && Objects.equals( + this.code, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.code) + && Objects.equals( + this.filename, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems.filename) + && Objects.equals( + this.additionalProperties, + getMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + .additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(annotationCount, code, filename, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems {\n"); + sb.append(" annotationCount: ").append(toIndentedString(annotationCount)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).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/GetMultipleRulesetsResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataType.java new file mode 100644 index 00000000000..1686ebcb400 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetMultipleRulesetsResponseDataType.java @@ -0,0 +1,59 @@ +/* + * 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; + +/** Get multiple rulesets response resource type. */ +@JsonSerialize( + using = GetMultipleRulesetsResponseDataType.GetMultipleRulesetsResponseDataTypeSerializer.class) +public class GetMultipleRulesetsResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("get_multiple_rulesets_response")); + + public static final GetMultipleRulesetsResponseDataType GET_MULTIPLE_RULESETS_RESPONSE = + new GetMultipleRulesetsResponseDataType("get_multiple_rulesets_response"); + + GetMultipleRulesetsResponseDataType(String value) { + super(value, allowedValues); + } + + public static class GetMultipleRulesetsResponseDataTypeSerializer + extends StdSerializer { + public GetMultipleRulesetsResponseDataTypeSerializer( + Class t) { + super(t); + } + + public GetMultipleRulesetsResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GetMultipleRulesetsResponseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GetMultipleRulesetsResponseDataType fromValue(String value) { + return new GetMultipleRulesetsResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SecretRuleArray.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleArray.java new file mode 100644 index 00000000000..ba70875ffaa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleArray.java @@ -0,0 +1,154 @@ +/* + * 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; + +/** The definition of SecretRuleArray object. */ +@JsonPropertyOrder({SecretRuleArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecretRuleArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public SecretRuleArray() {} + + @JsonCreator + public SecretRuleArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public SecretRuleArray data(List data) { + this.data = data; + for (SecretRuleData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SecretRuleArray addDataItem(SecretRuleData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The SecretRuleArray data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List 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 SecretRuleArray + */ + @JsonAnySetter + public SecretRuleArray 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 SecretRuleArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecretRuleArray secretRuleArray = (SecretRuleArray) o; + return Objects.equals(this.data, secretRuleArray.data) + && Objects.equals(this.additionalProperties, secretRuleArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecretRuleArray {\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/SecretRuleData.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleData.java new file mode 100644 index 00000000000..1a3c0912d5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleData.java @@ -0,0 +1,205 @@ +/* + * 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 SecretRuleData object. */ +@JsonPropertyOrder({ + SecretRuleData.JSON_PROPERTY_ATTRIBUTES, + SecretRuleData.JSON_PROPERTY_ID, + SecretRuleData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecretRuleData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SecretRuleDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SecretRuleDataType type = SecretRuleDataType.SECRET_RULE; + + public SecretRuleData() {} + + @JsonCreator + public SecretRuleData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SecretRuleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SecretRuleData attributes(SecretRuleDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of SecretRuleDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SecretRuleDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SecretRuleDataAttributes attributes) { + this.attributes = attributes; + } + + public SecretRuleData id(String id) { + this.id = id; + return this; + } + + /** + * The SecretRuleData 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 SecretRuleData type(SecretRuleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Secret rule resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecretRuleDataType getType() { + return type; + } + + public void setType(SecretRuleDataType 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 SecretRuleData + */ + @JsonAnySetter + public SecretRuleData 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 SecretRuleData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecretRuleData secretRuleData = (SecretRuleData) o; + return Objects.equals(this.attributes, secretRuleData.attributes) + && Objects.equals(this.id, secretRuleData.id) + && Objects.equals(this.type, secretRuleData.type) + && Objects.equals(this.additionalProperties, secretRuleData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecretRuleData {\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/SecretRuleDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributes.java new file mode 100644 index 00000000000..214b3a270e4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributes.java @@ -0,0 +1,387 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of SecretRuleDataAttributes object. */ +@JsonPropertyOrder({ + SecretRuleDataAttributes.JSON_PROPERTY_DEFAULT_INCLUDED_KEYWORDS, + SecretRuleDataAttributes.JSON_PROPERTY_DESCRIPTION, + SecretRuleDataAttributes.JSON_PROPERTY_LICENSE, + SecretRuleDataAttributes.JSON_PROPERTY_MATCH_VALIDATION, + SecretRuleDataAttributes.JSON_PROPERTY_NAME, + SecretRuleDataAttributes.JSON_PROPERTY_PATTERN, + SecretRuleDataAttributes.JSON_PROPERTY_PRIORITY, + SecretRuleDataAttributes.JSON_PROPERTY_SDS_ID, + SecretRuleDataAttributes.JSON_PROPERTY_VALIDATORS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecretRuleDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFAULT_INCLUDED_KEYWORDS = "default_included_keywords"; + private List defaultIncludedKeywords = null; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_LICENSE = "license"; + private String license; + + public static final String JSON_PROPERTY_MATCH_VALIDATION = "match_validation"; + private SecretRuleDataAttributesMatchValidation matchValidation; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PATTERN = "pattern"; + private String pattern; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private String priority; + + public static final String JSON_PROPERTY_SDS_ID = "sds_id"; + private String sdsId; + + public static final String JSON_PROPERTY_VALIDATORS = "validators"; + private List validators = null; + + public SecretRuleDataAttributes defaultIncludedKeywords(List defaultIncludedKeywords) { + this.defaultIncludedKeywords = defaultIncludedKeywords; + return this; + } + + public SecretRuleDataAttributes addDefaultIncludedKeywordsItem( + String defaultIncludedKeywordsItem) { + if (this.defaultIncludedKeywords == null) { + this.defaultIncludedKeywords = new ArrayList<>(); + } + this.defaultIncludedKeywords.add(defaultIncludedKeywordsItem); + return this; + } + + /** + * The attributes default_included_keywords. + * + * @return defaultIncludedKeywords + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_INCLUDED_KEYWORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDefaultIncludedKeywords() { + return defaultIncludedKeywords; + } + + public void setDefaultIncludedKeywords(List defaultIncludedKeywords) { + this.defaultIncludedKeywords = defaultIncludedKeywords; + } + + public SecretRuleDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The attributes 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 SecretRuleDataAttributes license(String license) { + this.license = license; + return this; + } + + /** + * The attributes license. + * + * @return license + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LICENSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLicense() { + return license; + } + + public void setLicense(String license) { + this.license = license; + } + + public SecretRuleDataAttributes matchValidation( + SecretRuleDataAttributesMatchValidation matchValidation) { + this.matchValidation = matchValidation; + this.unparsed |= matchValidation.unparsed; + return this; + } + + /** + * The definition of SecretRuleDataAttributesMatchValidation object. + * + * @return matchValidation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MATCH_VALIDATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SecretRuleDataAttributesMatchValidation getMatchValidation() { + return matchValidation; + } + + public void setMatchValidation(SecretRuleDataAttributesMatchValidation matchValidation) { + this.matchValidation = matchValidation; + } + + public SecretRuleDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The attributes name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SecretRuleDataAttributes pattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * The attributes pattern. + * + * @return pattern + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPattern() { + return pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public SecretRuleDataAttributes priority(String priority) { + this.priority = priority; + return this; + } + + /** + * The attributes priority. + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public SecretRuleDataAttributes sdsId(String sdsId) { + this.sdsId = sdsId; + return this; + } + + /** + * The attributes sds_id. + * + * @return sdsId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SDS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSdsId() { + return sdsId; + } + + public void setSdsId(String sdsId) { + this.sdsId = sdsId; + } + + public SecretRuleDataAttributes validators(List validators) { + this.validators = validators; + return this; + } + + public SecretRuleDataAttributes addValidatorsItem(String validatorsItem) { + if (this.validators == null) { + this.validators = new ArrayList<>(); + } + this.validators.add(validatorsItem); + return this; + } + + /** + * The attributes validators. + * + * @return validators + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValidators() { + return validators; + } + + public void setValidators(List validators) { + this.validators = validators; + } + + /** + * 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 SecretRuleDataAttributes + */ + @JsonAnySetter + public SecretRuleDataAttributes 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 SecretRuleDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecretRuleDataAttributes secretRuleDataAttributes = (SecretRuleDataAttributes) o; + return Objects.equals( + this.defaultIncludedKeywords, secretRuleDataAttributes.defaultIncludedKeywords) + && Objects.equals(this.description, secretRuleDataAttributes.description) + && Objects.equals(this.license, secretRuleDataAttributes.license) + && Objects.equals(this.matchValidation, secretRuleDataAttributes.matchValidation) + && Objects.equals(this.name, secretRuleDataAttributes.name) + && Objects.equals(this.pattern, secretRuleDataAttributes.pattern) + && Objects.equals(this.priority, secretRuleDataAttributes.priority) + && Objects.equals(this.sdsId, secretRuleDataAttributes.sdsId) + && Objects.equals(this.validators, secretRuleDataAttributes.validators) + && Objects.equals(this.additionalProperties, secretRuleDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultIncludedKeywords, + description, + license, + matchValidation, + name, + pattern, + priority, + sdsId, + validators, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecretRuleDataAttributes {\n"); + sb.append(" defaultIncludedKeywords: ") + .append(toIndentedString(defaultIncludedKeywords)) + .append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" license: ").append(toIndentedString(license)).append("\n"); + sb.append(" matchValidation: ").append(toIndentedString(matchValidation)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" sdsId: ").append(toIndentedString(sdsId)).append("\n"); + sb.append(" validators: ").append(toIndentedString(validators)).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/SecretRuleDataAttributesMatchValidation.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributesMatchValidation.java new file mode 100644 index 00000000000..98c1ab756bd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributesMatchValidation.java @@ -0,0 +1,406 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of SecretRuleDataAttributesMatchValidation object. */ +@JsonPropertyOrder({ + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_ENDPOINT, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_HOSTS, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_HTTP_METHOD, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_INVALID_HTTP_STATUS_CODE, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_REQUEST_HEADERS, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_TIMEOUT_SECONDS, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_TYPE, + SecretRuleDataAttributesMatchValidation.JSON_PROPERTY_VALID_HTTP_STATUS_CODE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecretRuleDataAttributesMatchValidation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_HOSTS = "hosts"; + private List hosts = null; + + public static final String JSON_PROPERTY_HTTP_METHOD = "http_method"; + private String httpMethod; + + public static final String JSON_PROPERTY_INVALID_HTTP_STATUS_CODE = "invalid_http_status_code"; + private List + invalidHttpStatusCode = null; + + public static final String JSON_PROPERTY_REQUEST_HEADERS = "request_headers"; + private Map requestHeaders = null; + + public static final String JSON_PROPERTY_TIMEOUT_SECONDS = "timeout_seconds"; + private Long timeoutSeconds; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_VALID_HTTP_STATUS_CODE = "valid_http_status_code"; + private List + validHttpStatusCode = null; + + public SecretRuleDataAttributesMatchValidation endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * The match_validation endpoint. + * + * @return endpoint + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public SecretRuleDataAttributesMatchValidation hosts(List hosts) { + this.hosts = hosts; + return this; + } + + public SecretRuleDataAttributesMatchValidation addHostsItem(String hostsItem) { + if (this.hosts == null) { + this.hosts = new ArrayList<>(); + } + this.hosts.add(hostsItem); + return this; + } + + /** + * The match_validation hosts. + * + * @return hosts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHosts() { + return hosts; + } + + public void setHosts(List hosts) { + this.hosts = hosts; + } + + public SecretRuleDataAttributesMatchValidation httpMethod(String httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * The match_validation http_method. + * + * @return httpMethod + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTTP_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHttpMethod() { + return httpMethod; + } + + public void setHttpMethod(String httpMethod) { + this.httpMethod = httpMethod; + } + + public SecretRuleDataAttributesMatchValidation invalidHttpStatusCode( + List + invalidHttpStatusCode) { + this.invalidHttpStatusCode = invalidHttpStatusCode; + for (SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems item : + invalidHttpStatusCode) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SecretRuleDataAttributesMatchValidation addInvalidHttpStatusCodeItem( + SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems invalidHttpStatusCodeItem) { + if (this.invalidHttpStatusCode == null) { + this.invalidHttpStatusCode = new ArrayList<>(); + } + this.invalidHttpStatusCode.add(invalidHttpStatusCodeItem); + this.unparsed |= invalidHttpStatusCodeItem.unparsed; + return this; + } + + /** + * The match_validation invalid_http_status_code. + * + * @return invalidHttpStatusCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVALID_HTTP_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List + getInvalidHttpStatusCode() { + return invalidHttpStatusCode; + } + + public void setInvalidHttpStatusCode( + List + invalidHttpStatusCode) { + this.invalidHttpStatusCode = invalidHttpStatusCode; + } + + public SecretRuleDataAttributesMatchValidation requestHeaders( + Map requestHeaders) { + this.requestHeaders = requestHeaders; + return this; + } + + public SecretRuleDataAttributesMatchValidation putRequestHeadersItem( + String key, String requestHeadersItem) { + if (this.requestHeaders == null) { + this.requestHeaders = new HashMap<>(); + } + this.requestHeaders.put(key, requestHeadersItem); + return this; + } + + /** + * The match_validation request_headers. + * + * @return requestHeaders + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUEST_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getRequestHeaders() { + return requestHeaders; + } + + public void setRequestHeaders(Map requestHeaders) { + this.requestHeaders = requestHeaders; + } + + public SecretRuleDataAttributesMatchValidation timeoutSeconds(Long timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * The match_validation timeout_seconds. minimum: 0 maximum: + * 1.8446744073709552e+19 + * + * @return timeoutSeconds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEOUT_SECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeoutSeconds() { + return timeoutSeconds; + } + + public void setTimeoutSeconds(Long timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + } + + public SecretRuleDataAttributesMatchValidation type(String type) { + this.type = type; + return this; + } + + /** + * The match_validation type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public SecretRuleDataAttributesMatchValidation validHttpStatusCode( + List validHttpStatusCode) { + this.validHttpStatusCode = validHttpStatusCode; + for (SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems item : + validHttpStatusCode) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SecretRuleDataAttributesMatchValidation addValidHttpStatusCodeItem( + SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems validHttpStatusCodeItem) { + if (this.validHttpStatusCode == null) { + this.validHttpStatusCode = new ArrayList<>(); + } + this.validHttpStatusCode.add(validHttpStatusCodeItem); + this.unparsed |= validHttpStatusCodeItem.unparsed; + return this; + } + + /** + * The match_validation valid_http_status_code. + * + * @return validHttpStatusCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID_HTTP_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List + getValidHttpStatusCode() { + return validHttpStatusCode; + } + + public void setValidHttpStatusCode( + List validHttpStatusCode) { + this.validHttpStatusCode = validHttpStatusCode; + } + + /** + * 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 SecretRuleDataAttributesMatchValidation + */ + @JsonAnySetter + public SecretRuleDataAttributesMatchValidation 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 SecretRuleDataAttributesMatchValidation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecretRuleDataAttributesMatchValidation secretRuleDataAttributesMatchValidation = + (SecretRuleDataAttributesMatchValidation) o; + return Objects.equals(this.endpoint, secretRuleDataAttributesMatchValidation.endpoint) + && Objects.equals(this.hosts, secretRuleDataAttributesMatchValidation.hosts) + && Objects.equals(this.httpMethod, secretRuleDataAttributesMatchValidation.httpMethod) + && Objects.equals( + this.invalidHttpStatusCode, + secretRuleDataAttributesMatchValidation.invalidHttpStatusCode) + && Objects.equals( + this.requestHeaders, secretRuleDataAttributesMatchValidation.requestHeaders) + && Objects.equals( + this.timeoutSeconds, secretRuleDataAttributesMatchValidation.timeoutSeconds) + && Objects.equals(this.type, secretRuleDataAttributesMatchValidation.type) + && Objects.equals( + this.validHttpStatusCode, secretRuleDataAttributesMatchValidation.validHttpStatusCode) + && Objects.equals( + this.additionalProperties, + secretRuleDataAttributesMatchValidation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + endpoint, + hosts, + httpMethod, + invalidHttpStatusCode, + requestHeaders, + timeoutSeconds, + type, + validHttpStatusCode, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecretRuleDataAttributesMatchValidation {\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" hosts: ").append(toIndentedString(hosts)).append("\n"); + sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); + sb.append(" invalidHttpStatusCode: ") + .append(toIndentedString(invalidHttpStatusCode)) + .append("\n"); + sb.append(" requestHeaders: ").append(toIndentedString(requestHeaders)).append("\n"); + sb.append(" timeoutSeconds: ").append(toIndentedString(timeoutSeconds)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" validHttpStatusCode: ") + .append(toIndentedString(validHttpStatusCode)) + .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/SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.java new file mode 100644 index 00000000000..412edd14954 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.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.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 SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems + * object. + */ +@JsonPropertyOrder({ + SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.JSON_PROPERTY_END, + SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.JSON_PROPERTY_START +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END = "end"; + private Long end; + + public static final String JSON_PROPERTY_START = "start"; + private Long start; + + public SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems end(Long end) { + this.end = end; + return this; + } + + /** + * The items end. minimum: 0 maximum: 1.8446744073709552e+19 + * + * @return end + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEnd() { + return end; + } + + public void setEnd(Long end) { + this.end = end; + } + + public SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems start(Long start) { + this.start = start; + return this; + } + + /** + * The items start. minimum: 0 maximum: 1.8446744073709552e+19 + * + * @return start + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStart() { + return start; + } + + public void setStart(Long start) { + this.start = start; + } + + /** + * 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 SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems + */ + @JsonAnySetter + public SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems 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 SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems + secretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems = + (SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems) o; + return Objects.equals( + this.end, secretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.end) + && Objects.equals( + this.start, secretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.start) + && Objects.equals( + this.additionalProperties, + secretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(end, start, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems {\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).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/SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.java new file mode 100644 index 00000000000..70117645ee2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.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.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 SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems + * object. + */ +@JsonPropertyOrder({ + SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.JSON_PROPERTY_END, + SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.JSON_PROPERTY_START +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END = "end"; + private Long end; + + public static final String JSON_PROPERTY_START = "start"; + private Long start; + + public SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems end(Long end) { + this.end = end; + return this; + } + + /** + * The items end. minimum: 0 maximum: 1.8446744073709552e+19 + * + * @return end + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEnd() { + return end; + } + + public void setEnd(Long end) { + this.end = end; + } + + public SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems start(Long start) { + this.start = start; + return this; + } + + /** + * The items start. minimum: 0 maximum: 1.8446744073709552e+19 + * + * @return start + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStart() { + return start; + } + + public void setStart(Long start) { + this.start = start; + } + + /** + * 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 SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems + */ + @JsonAnySetter + public SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems 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 SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems + secretRuleDataAttributesMatchValidationValidHttpStatusCodeItems = + (SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems) o; + return Objects.equals( + this.end, secretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.end) + && Objects.equals( + this.start, secretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.start) + && Objects.equals( + this.additionalProperties, + secretRuleDataAttributesMatchValidationValidHttpStatusCodeItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(end, start, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems {\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).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/SecretRuleDataType.java b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataType.java new file mode 100644 index 00000000000..fca476c4790 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecretRuleDataType.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** Secret rule resource type. */ +@JsonSerialize(using = SecretRuleDataType.SecretRuleDataTypeSerializer.class) +public class SecretRuleDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("secret_rule")); + + public static final SecretRuleDataType SECRET_RULE = new SecretRuleDataType("secret_rule"); + + SecretRuleDataType(String value) { + super(value, allowedValues); + } + + public static class SecretRuleDataTypeSerializer extends StdSerializer { + public SecretRuleDataTypeSerializer(Class t) { + super(t); + } + + public SecretRuleDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(SecretRuleDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SecretRuleDataType fromValue(String value) { + return new SecretRuleDataType(value); + } +} 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 f4eab41ff04..add99fc443b 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 @@ -5,13 +5,13 @@ Feature: Security Monitoring information. Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "SecurityMonitoring" API + Given an instance of "SecurityMonitoring" API @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Bad Request" response - Given operation "CancelHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "CancelHistoricalJob" enabled And new "CancelHistoricalJob" request And request contains "job_id" parameter with value "inva-lid" When the request is sent @@ -19,7 +19,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Conflict" response - Given operation "CancelHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "CancelHistoricalJob" enabled And new "CancelHistoricalJob" request And request contains "job_id" parameter from "REPLACE.ME" When the request is sent @@ -27,7 +29,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Not Found" response - Given operation "CancelHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "CancelHistoricalJob" enabled And new "CancelHistoricalJob" request And request contains "job_id" parameter with value "8e2a37fb-b0c8-4761-a7f0-0a8d6a98ba93" When the request is sent @@ -35,7 +39,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "OK" response - Given operation "CancelHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "CancelHistoricalJob" enabled And operation "RunHistoricalJob" enabled And new "CancelHistoricalJob" request And there is a valid "historical_job" in the system @@ -45,7 +51,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Change the related incidents of a security signal returns "Bad Request" response - Given new "EditSecurityMonitoringSignalIncidents" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalIncidents" request And request contains "signal_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"incident_ids": [2066]}}} When the request is sent @@ -53,7 +61,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Change the related incidents of a security signal returns "Not Found" response - Given new "EditSecurityMonitoringSignalIncidents" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalIncidents" request And request contains "signal_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"incident_ids": [2066]}}} When the request is sent @@ -61,7 +71,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Change the related incidents of a security signal returns "OK" response - Given new "EditSecurityMonitoringSignalIncidents" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalIncidents" request And request contains "signal_id" parameter with value "AQAAAYG1bl5K4HuUewAAAABBWUcxYmw1S0FBQmt2RmhRN0V4ZUVnQUE" And body with value {"data": {"attributes": {"incident_ids": [2066]}}} When the request is sent @@ -69,7 +81,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Change the triage state of a security signal returns "Bad Request" response - Given new "EditSecurityMonitoringSignalState" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalState" request And request contains "signal_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"archive_reason": "none", "state": "open"}, "type": "signal_metadata"}} When the request is sent @@ -77,7 +91,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Change the triage state of a security signal returns "Not Found" response - Given new "EditSecurityMonitoringSignalState" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalState" request And request contains "signal_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"archive_reason": "none", "state": "open"}, "type": "signal_metadata"}} When the request is sent @@ -85,7 +101,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Change the triage state of a security signal returns "OK" response - Given new "EditSecurityMonitoringSignalState" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalState" request And request contains "signal_id" parameter with value "AQAAAYG1bl5K4HuUewAAAABBWUcxYmw1S0FBQmt2RmhRN0V4ZUVnQUE" And body with value {"data": {"attributes": {"archive_reason": "none", "state": "open"}}} When the request is sent @@ -93,7 +111,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Convert a job result to a signal returns "Bad Request" response - Given operation "ConvertJobResultToSignal" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ConvertJobResultToSignal" enabled And new "ConvertJobResultToSignal" request And body with value {"data": {"attributes": {"jobResultIds": [""], "notifications": [""], "signalMessage": "A large number of failed login attempts.", "signalSeverity": "critical"}, "type": "historicalDetectionsJobResultSignalConversion"}} When the request is sent @@ -101,7 +121,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Convert a job result to a signal returns "Not Found" response - Given operation "ConvertJobResultToSignal" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ConvertJobResultToSignal" enabled And new "ConvertJobResultToSignal" request And body with value {"data": {"attributes": {"jobResultIds": [""], "notifications": [""], "signalMessage": "A large number of failed login attempts.", "signalSeverity": "critical"}, "type": "historicalDetectionsJobResultSignalConversion"}} When the request is sent @@ -109,7 +131,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Convert a job result to a signal returns "OK" response - Given operation "ConvertJobResultToSignal" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ConvertJobResultToSignal" enabled And new "ConvertJobResultToSignal" request And body with value {"data": {"attributes": {"jobResultIds": [""], "notifications": [""], "signalMessage": "A large number of failed login attempts.", "signalSeverity": "critical"}, "type": "historicalDetectionsJobResultSignalConversion"}} When the request is sent @@ -117,21 +141,27 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Convert a rule from JSON to Terraform returns "Bad Request" response - Given new "ConvertSecurityMonitoringRuleFromJSONToTerraform" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ConvertSecurityMonitoringRuleFromJSONToTerraform" request And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"} When the request is sent Then the response status is 400 Bad Request @skip @team:DataDog/k9-cloud-security-platform Scenario: Convert a rule from JSON to Terraform returns "Not Found" response - Given new "ConvertSecurityMonitoringRuleFromJSONToTerraform" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ConvertSecurityMonitoringRuleFromJSONToTerraform" request And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"} When the request is sent Then the response status is 404 Not Found @team:DataDog/k9-cloud-security-platform Scenario: Convert a rule from JSON to Terraform returns "OK" response - Given new "ConvertSecurityMonitoringRuleFromJSONToTerraform" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ConvertSecurityMonitoringRuleFromJSONToTerraform" request And body with value {"name":"_{{ unique_hash }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"} When the request is sent Then the response status is 200 OK @@ -139,21 +169,27 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Convert an existing rule from JSON to Terraform returns "Bad Request" response - Given new "ConvertExistingSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ConvertExistingSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @skip @team:DataDog/k9-cloud-security-platform Scenario: Convert an existing rule from JSON to Terraform returns "Not Found" response - Given new "ConvertExistingSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ConvertExistingSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/k9-cloud-security-platform Scenario: Convert an existing rule from JSON to Terraform returns "OK" response - Given new "ConvertExistingSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ConvertExistingSecurityMonitoringRule" request And there is a valid "security_rule_hash" in the system And request contains "rule_id" parameter from "security_rule_hash.id" When the request is sent @@ -162,7 +198,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a cloud_configuration rule returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"type":"cloud_configuration","name":"{{ unique }}_cloud","isEnabled":false,"cases":[{"status":"info","notifications":["channel"]}],"options":{"complianceRuleOptions":{"resourceType":"gcp_compute_disk","complexRule": false,"regoRule":{"policy":"package datadog\n\nimport data.datadog.output as dd_output\n\nimport future.keywords.contains\nimport future.keywords.if\nimport future.keywords.in\n\nmilliseconds_in_a_day := ((1000 * 60) * 60) * 24\n\neval(iam_service_account_key) = \"skip\" if {\n\tiam_service_account_key.disabled\n} else = \"pass\" if {\n\t(iam_service_account_key.resource_seen_at / milliseconds_in_a_day) - (iam_service_account_key.valid_after_time / milliseconds_in_a_day) <= 90\n} else = \"fail\"\n\n# This part remains unchanged for all rules\nresults contains result if {\n\tsome resource in input.resources[input.main_resource_type]\n\tresult := dd_output.format(resource, eval(resource))\n}\n","resourceTypes":["gcp_compute_disk"]}}},"message":"ddd","tags":["my:tag"],"complianceSignalOptions":{"userActivationStatus":true,"userGroupByFields":["@account_id"]},"filters":[{"action":"require","query":"resource_id:helo*"},{"action":"suppress","query":"control:helo*"}]} When the request is sent Then the response status is 200 OK @@ -173,14 +211,18 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Create a custom framework returns "Bad Request" response - Given new "CreateCustomFramework" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateCustomFramework" request And body with value {"data":{"type":"custom_framework","attributes":{"name":"name","handle":"","version":"10","icon_url":"test-url","requirements":[{"name":"requirement","controls":[{"name":"control","rules_id":["def-000-be9"]}]}]}}} When the request is sent Then the response status is 400 Bad Request @replay-only @skip-terraform-config @team:DataDog/k9-cloud-security-platform Scenario: Create a custom framework returns "Conflict" response - Given there is a valid "custom_framework" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "custom_framework" in the system And new "CreateCustomFramework" request And body with value {"data":{"type":"custom_framework","attributes":{"name":"name","handle":"create-framework-new","version":"10","icon_url":"test-url","requirements":[{"name":"requirement","controls":[{"name":"control","rules_id":["def-000-be9"]}]}]}}} When the request is sent @@ -188,21 +230,27 @@ Feature: Security Monitoring @replay-only @skip-terraform-config @team:DataDog/k9-cloud-security-platform Scenario: Create a custom framework returns "OK" response - Given new "CreateCustomFramework" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateCustomFramework" request And body with value {"data":{"type":"custom_framework","attributes":{"name":"name","handle":"create-framework-new","version":"10","icon_url":"test-url","requirements":[{"name":"requirement","controls":[{"name":"control","rules_id":["def-000-be9"]}]}]}}} When the request is sent Then the response status is 200 OK @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule returns "Bad Request" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}", "queries":[{"query":""}],"cases":[{"status":"info"}],"options":{},"message":"Test rule","tags":[],"isEnabled":true} When the request is sent Then the response status is 400 Bad Request @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection", "referenceTables":[{"tableName": "synthetics_test_reference_table_dont_delete", "columnName": "value", "logFieldPath":"testtag", "checkPresence":true, "ruleQueryName":"a"}]} When the request is sent Then the response status is 200 OK @@ -213,7 +261,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with detection method 'sequence_detection' returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}","type":"log_detection","isEnabled":true,"queries":[{"aggregation":"count","dataSource":"logs","distinctFields":[],"groupByFields":[],"hasOptionalGroupByFields":false,"name":"","query":"service:logs-rule-reducer source:paul test2"},{"aggregation":"count","dataSource":"logs","distinctFields":[],"groupByFields":[],"hasOptionalGroupByFields":false,"name":"","query":"service:logs-rule-reducer source:paul test1"}],"cases":[{"name":"","status":"info","notifications":[],"condition":"step_b > 0"}],"message":"Logs and signals asdf","options":{"detectionMethod":"sequence_detection","evaluationWindow":0,"keepAlive":300,"maxSignalDuration":600,"sequenceDetectionOptions":{"stepTransitions":[{"child":"step_b","evaluationWindow":900,"parent":"step_a"}],"steps":[{"condition":"a > 0","evaluationWindow":60,"name":"step_a"},{"condition":"b > 0","evaluationWindow":60,"name":"step_b"}]}},"tags":[]} When the request is sent Then the response status is 200 OK @@ -223,7 +273,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with detection method 'third_party' returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}","type":"log_detection","isEnabled":true,"thirdPartyCases":[{"query":"status:error","name":"high","status":"high"},{"query":"status:info","name":"low","status":"low"}],"queries":[],"cases":[],"message":"This is a third party rule","options":{"detectionMethod":"third_party","keepAlive":0,"maxSignalDuration":600,"thirdPartyRuleOptions":{"defaultStatus":"info","rootQueries":[{"query":"source:guardduty @details.alertType:*EC2*", "groupByFields":["instance-id"]},{"query":"source:guardduty", "groupByFields":[]}]}}} When the request is sent Then the response status is 200 OK @@ -234,7 +286,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with type 'application_security 'returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"type":"application_security","name":"{{unique}}_appsec_rule","queries":[{"query":"@appsec.security_activity:business_logic.users.login.failure","aggregation":"count","groupByFields":["service","@http.client_ip"],"distinctFields":[]}],"filters":[],"cases":[{"name":"","status":"info","notifications":[],"condition":"a > 100000","actions":[{"type":"block_ip","options":{"duration":900}}, {"type":"user_behavior","options":{"userBehaviorName":"behavior"}}, {"type":"flag_ip","options":{"flaggedIPType":"FLAGGED"}}]}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900,"detectionMethod":"threshold"},"isEnabled":true,"message":"Test rule","tags":[],"groupSignalsBy":["service"]} When the request is sent Then the response status is 200 OK @@ -244,7 +298,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with type 'impossible_travel' returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"queries":[{"aggregation":"geo_data","groupByFields":["@usr.id"],"distinctFields":[],"metric":"@network.client.geoip","query":"*"}],"cases":[{"name":"","status":"info","notifications":[]}],"hasExtendedTitle":true,"message":"test","isEnabled":true,"options":{"maxSignalDuration":86400,"evaluationWindow":900,"keepAlive":3600,"detectionMethod":"impossible_travel","impossibleTravelOptions":{"baselineUserLocations":false}},"name":"{{ unique }}","type":"log_detection","tags":[],"filters":[]} When the request is sent Then the response status is 200 OK @@ -255,7 +311,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with type 'signal_correlation' returns "OK" response - Given there is a valid "security_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "security_rule" in the system And there is a valid "security_rule_bis" in the system And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}_signal_rule", "queries":[{"ruleId":"{{ security_rule.id }}","aggregation":"event_count","correlatedByFields":["host"],"correlatedQueryIndex":1}, {"ruleId":"{{ security_rule_bis.id }}","aggregation":"event_count","correlatedByFields":["host"]}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0 && b > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test signal correlation rule","tags":[],"isEnabled":true, "type": "signal_correlation"} @@ -268,7 +326,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with type 'workload_security' returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type": "workload_security"} When the request is sent Then the response status is 200 OK @@ -279,35 +339,45 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Create a new signal-based notification rule returns "Bad Request" response - Given new "CreateSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSignalNotificationRule" request And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/cloud-security-posture-management Scenario: Create a new signal-based notification rule returns "Successfully created the notification rule." response - Given new "CreateSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSignalNotificationRule" request And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}} When the request is sent Then the response status is 201 Successfully created the notification rule. @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Create a new vulnerability-based notification rule returns "Bad Request" response - Given new "CreateVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateVulnerabilityNotificationRule" request And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/cloud-security-posture-management Scenario: Create a new vulnerability-based notification rule returns "Successfully created the notification rule." response - Given new "CreateVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateVulnerabilityNotificationRule" request And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}} When the request is sent Then the response status is 201 Successfully created the notification rule. @team:DataDog/k9-cloud-security-platform Scenario: Create a scheduled detection rule returns "OK" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"index":"main"}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection", "schedulingOptions": {"rrule": "FREQ=HOURLY;INTERVAL=2;", "start": "2025-06-18T12:00:00", "timezone": "Europe/Paris"}} When the request is sent Then the response status is 200 OK @@ -318,28 +388,36 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Create a scheduled rule without rrule returns "Bad Request" response - Given new "CreateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringRule" request And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"index":"main"}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection", "schedulingOptions": {"start": "2025-06-18T12:00:00", "timezone": "Europe/Paris"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a security filter returns "Bad Request" response - Given new "CreateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityFilter" request And body with value {"data": {"attributes": {"exclusion_filters": [{"name": "Exclude staging", "query": "source:staging"}], "filtered_data_type": "logs", "is_enabled": true, "name": "Custom security filter", "query": "service:api"}, "type": "security_filters"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a security filter returns "Conflict" response - Given new "CreateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityFilter" request And body with value {"data": {"attributes": {"exclusion_filters": [{"name": "Exclude staging", "query": "source:staging"}], "filtered_data_type": "logs", "is_enabled": true, "name": "Custom security filter", "query": "service:api"}, "type": "security_filters"}} When the request is sent Then the response status is 409 Conflict @team:DataDog/k9-cloud-security-platform Scenario: Create a security filter returns "OK" response - Given new "CreateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityFilter" request And body with value {"data": {"attributes": {"exclusion_filters": [{"name": "Exclude staging", "query": "source:staging"}], "filtered_data_type": "logs", "is_enabled": true, "name": "{{ unique }}", "query": "service:{{ unique_alnum }}"}, "type": "security_filters"}} When the request is sent Then the response status is 200 OK @@ -351,21 +429,27 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "Bad Request" response - Given new "CreateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringSuppression" request And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "Conflict" response - Given new "CreateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringSuppression" request And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 409 Conflict @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "OK" response - Given new "CreateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringSuppression" request And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK @@ -375,7 +459,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule with an exclusion query returns "OK" response - Given new "CreateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "CreateSecurityMonitoringSuppression" request And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK @@ -386,7 +472,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Delete a custom framework returns "Bad Request" response - Given new "DeleteCustomFramework" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteCustomFramework" request And request contains "handle" parameter with value "handle-does-not-exist" And request contains "version" parameter with value "version-does-not-exist" When the request is sent @@ -394,7 +482,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Delete a custom framework returns "OK" response - Given there is a valid "custom_framework" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "custom_framework" in the system And new "DeleteCustomFramework" request And request contains "handle" parameter with value "create-framework-new" And request contains "version" parameter with value "10" @@ -403,14 +493,18 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a non existing rule returns "Not Found" response - Given new "DeleteSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteSecurityMonitoringRule" request And request contains "rule_id" parameter with value "ThisRuleIdProbablyDoesntExist" When the request is sent Then the response status is 404 Not Found @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Delete a security filter returns "No Content" response - Given there is a valid "security_filter" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "security_filter" in the system And new "DeleteSecurityFilter" request And request contains "security_filter_id" parameter from "security_filter.data.id" When the request is sent @@ -418,28 +512,36 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a security filter returns "Not Found" response - Given new "DeleteSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteSecurityFilter" request And request contains "security_filter_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a security filter returns "OK" response - Given new "DeleteSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteSecurityFilter" request And request contains "security_filter_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 204 OK @team:DataDog/cloud-security-posture-management Scenario: Delete a signal-based notification rule returns "Not Found" response - Given new "DeleteSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteSignalNotificationRule" request And request contains "id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found @team:DataDog/cloud-security-posture-management Scenario: Delete a signal-based notification rule returns "Rule successfully deleted." response - Given there is a valid "valid_signal_notification_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "valid_signal_notification_rule" in the system And new "DeleteSignalNotificationRule" request And request contains "id" parameter from "valid_signal_notification_rule.data.id" When the request is sent @@ -447,14 +549,18 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a suppression rule returns "Not Found" response - Given new "DeleteSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteSecurityMonitoringSuppression" request And request contains "suppression_id" parameter with value "does-not-exist" When the request is sent Then the response status is 404 Not Found @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Delete a suppression rule returns "OK" response - Given there is a valid "suppression" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "suppression" in the system And new "DeleteSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "suppression.data.id" When the request is sent @@ -462,14 +568,18 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Delete a vulnerability-based notification rule returns "Not Found" response - Given new "DeleteVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteVulnerabilityNotificationRule" request And request contains "id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found @team:DataDog/cloud-security-posture-management Scenario: Delete a vulnerability-based notification rule returns "Rule successfully deleted." response - Given there is a valid "valid_vulnerability_notification_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "valid_vulnerability_notification_rule" in the system And new "DeleteVulnerabilityNotificationRule" request And request contains "id" parameter from "valid_vulnerability_notification_rule.data.id" When the request is sent @@ -477,7 +587,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Delete an existing job returns "Bad Request" response - Given operation "DeleteHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "DeleteHistoricalJob" enabled And new "DeleteHistoricalJob" request And request contains "job_id" parameter with value "inva-lid" When the request is sent @@ -485,7 +597,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete an existing job returns "Conflict" response - Given operation "DeleteHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "DeleteHistoricalJob" enabled And new "DeleteHistoricalJob" request And request contains "job_id" parameter from "REPLACE.ME" When the request is sent @@ -493,7 +607,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Delete an existing job returns "Not Found" response - Given operation "DeleteHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "DeleteHistoricalJob" enabled And new "DeleteHistoricalJob" request And request contains "job_id" parameter with value "8e2a37fb-b0c8-4761-a7f0-0a8d6a98ba93" When the request is sent @@ -501,7 +617,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete an existing job returns "OK" response - Given operation "DeleteHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "DeleteHistoricalJob" enabled And new "DeleteHistoricalJob" request And request contains "job_id" parameter from "REPLACE.ME" When the request is sent @@ -509,14 +627,18 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete an existing rule returns "Not Found" response - Given new "DeleteSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "DeleteSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Delete an existing rule returns "OK" response - Given there is a valid "security_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "security_rule" in the system And new "DeleteSecurityMonitoringRule" request And request contains "rule_id" parameter from "security_rule.id" When the request is sent @@ -524,7 +646,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response - Given operation "GetSBOM" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSBOM" enabled And new "GetSBOM" request And request contains "asset_type" parameter from "REPLACE.ME" And request contains "filter[asset_name]" parameter from "REPLACE.ME" @@ -533,7 +657,9 @@ Feature: Security Monitoring @team:DataDog/asm-vm Scenario: Get SBOM returns "Not found: asset not found" response - Given operation "GetSBOM" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSBOM" enabled And new "GetSBOM" request And request contains "asset_type" parameter with value "Host" And request contains "filter[asset_name]" parameter with value "unknown-host" @@ -542,7 +668,9 @@ Feature: Security Monitoring @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "OK" response - Given operation "GetSBOM" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSBOM" enabled And new "GetSBOM" request And request contains "asset_type" parameter with value "Repository" And request contains "filter[asset_name]" parameter with value "github.com/datadog/datadog-agent" @@ -551,7 +679,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Get a cloud configuration rule's details returns "OK" response - Given there is a valid "cloud_configuration_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "cloud_configuration_rule" in the system And new "GetSecurityMonitoringRule" request And request contains "rule_id" parameter from "cloud_configuration_rule.id" When the request is sent @@ -561,7 +691,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get a custom framework returns "Bad Request" response - Given new "GetCustomFramework" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetCustomFramework" request And request contains "handle" parameter with value "frame-does-not-exist" And request contains "version" parameter with value "frame-does-not-exist" When the request is sent @@ -569,7 +701,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Get a custom framework returns "OK" response - Given there is a valid "custom_framework" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "custom_framework" in the system And new "GetCustomFramework" request And request contains "handle" parameter with value "create-framework-new" And request contains "version" parameter with value "10" @@ -578,7 +712,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response - Given operation "GetFinding" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetFinding" enabled And new "GetFinding" request And request contains "finding_id" parameter from "REPLACE.ME" When the request is sent @@ -586,7 +722,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "Not Found: The requested finding cannot be found." response - Given operation "GetFinding" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetFinding" enabled And new "GetFinding" request And request contains "finding_id" parameter from "REPLACE.ME" When the request is sent @@ -594,7 +732,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "OK" response - Given operation "GetFinding" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetFinding" enabled And new "GetFinding" request And request contains "finding_id" parameter with value "AgAAAYd59gjghzF52gAAAAAAAAAYAAAAAEFZZDU5Z2pnQUFCRTRvV1lFeEo4SlFBQQAAACQAAAAAMDE4NzdhMDEtMDRiYS00NTZlLWFmMzMtNTIxNmNkNjVlNDMz" When the request is sent @@ -603,7 +743,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a hist signal's details returns "Bad Request" response - Given operation "GetSecurityMonitoringHistsignal" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSecurityMonitoringHistsignal" enabled And new "GetSecurityMonitoringHistsignal" request And request contains "histsignal_id" parameter from "REPLACE.ME" When the request is sent @@ -611,7 +753,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a hist signal's details returns "Not Found" response - Given operation "GetSecurityMonitoringHistsignal" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSecurityMonitoringHistsignal" enabled And new "GetSecurityMonitoringHistsignal" request And request contains "histsignal_id" parameter from "REPLACE.ME" When the request is sent @@ -619,7 +763,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a hist signal's details returns "OK" response - Given operation "GetSecurityMonitoringHistsignal" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSecurityMonitoringHistsignal" enabled And new "GetSecurityMonitoringHistsignal" request And request contains "histsignal_id" parameter from "REPLACE.ME" When the request is sent @@ -627,7 +773,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get a job's details returns "Bad Request" response - Given operation "GetHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetHistoricalJob" enabled And new "GetHistoricalJob" request And request contains "job_id" parameter with value "inva-lid" When the request is sent @@ -635,7 +783,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get a job's details returns "Not Found" response - Given operation "GetHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetHistoricalJob" enabled And new "GetHistoricalJob" request And request contains "job_id" parameter with value "8e2a37fb-b0c8-4761-a7f0-0a8d6a98ba93" When the request is sent @@ -643,7 +793,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get a job's details returns "OK" response - Given operation "GetHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetHistoricalJob" enabled And operation "RunHistoricalJob" enabled And new "GetHistoricalJob" request And there is a valid "historical_job" in the system @@ -653,7 +805,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a job's hist signals returns "Bad Request" response - Given operation "GetSecurityMonitoringHistsignalsByJobId" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSecurityMonitoringHistsignalsByJobId" enabled And new "GetSecurityMonitoringHistsignalsByJobId" request And request contains "job_id" parameter from "REPLACE.ME" When the request is sent @@ -661,7 +815,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a job's hist signals returns "Not Found" response - Given operation "GetSecurityMonitoringHistsignalsByJobId" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSecurityMonitoringHistsignalsByJobId" enabled And new "GetSecurityMonitoringHistsignalsByJobId" request And request contains "job_id" parameter from "REPLACE.ME" When the request is sent @@ -669,7 +825,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a job's hist signals returns "OK" response - Given operation "GetSecurityMonitoringHistsignalsByJobId" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetSecurityMonitoringHistsignalsByJobId" enabled And new "GetSecurityMonitoringHistsignalsByJobId" request And request contains "job_id" parameter from "REPLACE.ME" When the request is sent @@ -677,21 +835,27 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a list of security signals returns "Bad Request" response - Given new "SearchSecurityMonitoringSignals" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "SearchSecurityMonitoringSignals" request And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a list of security signals returns "OK" response - Given new "SearchSecurityMonitoringSignals" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "SearchSecurityMonitoringSignals" request And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 200 OK @replay-only @skip-validation @team:DataDog/k9-cloud-security-platform @with-pagination Scenario: Get a list of security signals returns "OK" response with pagination - Given new "SearchSecurityMonitoringSignals" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "SearchSecurityMonitoringSignals" request And body with value {"filter": {"from": "{{ timeISO("now-15m") }}", "query": "security:attack status:high", "to": "{{ timeISO("now") }}"}, "page": {"limit": 2}, "sort": "timestamp"} When the request with pagination is sent Then the response status is 200 OK @@ -699,19 +863,25 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a quick list of security signals returns "Bad Request" response - Given new "ListSecurityMonitoringSignals" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityMonitoringSignals" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a quick list of security signals returns "OK" response - Given new "ListSecurityMonitoringSignals" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityMonitoringSignals" request When the request is sent Then the response status is 200 OK @replay-only @skip-validation @team:DataDog/k9-cloud-security-platform @with-pagination Scenario: Get a quick list of security signals returns "OK" response with pagination - Given new "ListSecurityMonitoringSignals" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityMonitoringSignals" request And request contains "page[limit]" parameter with value 2 When the request with pagination is sent Then the response status is 200 OK @@ -719,14 +889,18 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get a rule's details returns "Not Found" response - Given new "GetSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityMonitoringRule" request And request contains "rule_id" parameter with value "abcde-12345" When the request is sent Then the response status is 404 Not Found @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Get a rule's details returns "OK" response - Given new "GetSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityMonitoringRule" request And there is a valid "security_rule" in the system And request contains "rule_id" parameter from "security_rule.id" When the request is sent @@ -736,7 +910,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a rule's version history returns "Bad Request" response - Given operation "GetRuleVersionHistory" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetRuleVersionHistory" enabled And new "GetRuleVersionHistory" request And request contains "rule_id" parameter from "REPLACE.ME" When the request is sent @@ -744,7 +920,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a rule's version history returns "Not Found" response - Given operation "GetRuleVersionHistory" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetRuleVersionHistory" enabled And new "GetRuleVersionHistory" request And request contains "rule_id" parameter from "REPLACE.ME" When the request is sent @@ -752,7 +930,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a rule's version history returns "OK" response - Given operation "GetRuleVersionHistory" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetRuleVersionHistory" enabled And new "GetRuleVersionHistory" request And request contains "rule_id" parameter from "REPLACE.ME" When the request is sent @@ -760,14 +940,18 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get a security filter returns "Not Found" response - Given new "GetSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityFilter" request And request contains "security_filter_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/k9-cloud-security-platform Scenario: Get a security filter returns "OK" response - Given there is a valid "security_filter" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "security_filter" in the system And new "GetSecurityFilter" request And request contains "security_filter_id" parameter from "security_filter.data.id" When the request is sent @@ -780,28 +964,36 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Get a signal's details returns "Not Found" response - Given new "GetSecurityMonitoringSignal" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityMonitoringSignal" request And request contains "signal_id" parameter with value "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptCL3QUEm3nt2" When the request is sent Then the response status is 404 Not Found @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Get a signal's details returns "OK" response - Given new "GetSecurityMonitoringSignal" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityMonitoringSignal" request And request contains "signal_id" parameter with value "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE" When the request is sent Then the response status is 200 OK @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Get a suppression rule returns "Not Found" response - Given new "GetSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityMonitoringSuppression" request And request contains "suppression_id" parameter with value "this-does-not-exist" When the request is sent Then the response status is 404 Not Found @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Get a suppression rule returns "OK" response - Given new "GetSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSecurityMonitoringSuppression" request And there is a valid "suppression" in the system And request contains "suppression_id" parameter from "suppression.data.id" When the request is sent @@ -811,7 +1003,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get all security filters returns "OK" response - Given new "ListSecurityFilters" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityFilters" request When the request is sent Then the response status is 200 OK And the response "data" has item with field "attributes.filtered_data_type" with value "logs" @@ -819,27 +1013,35 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Get all suppression rules returns "OK" response - Given new "ListSecurityMonitoringSuppressions" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityMonitoringSuppressions" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get details of a signal-based notification rule returns "Bad Request" response - Given new "GetSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSignalNotificationRule" request And request contains "id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @team:DataDog/cloud-security-posture-management Scenario: Get details of a signal-based notification rule returns "Not Found" response - Given new "GetSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSignalNotificationRule" request And request contains "id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found @team:DataDog/cloud-security-posture-management Scenario: Get details of a signal-based notification rule returns "Notification rule details." response - Given there is a valid "valid_signal_notification_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "valid_signal_notification_rule" in the system And new "GetSignalNotificationRule" request And request contains "id" parameter from "valid_signal_notification_rule.data.id" When the request is sent @@ -847,21 +1049,27 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get details of a vulnerability notification rule returns "Bad Request" response - Given new "GetVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetVulnerabilityNotificationRule" request And request contains "id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @team:DataDog/cloud-security-posture-management Scenario: Get details of a vulnerability notification rule returns "Not Found" response - Given new "GetVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetVulnerabilityNotificationRule" request And request contains "id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found @team:DataDog/cloud-security-posture-management Scenario: Get details of a vulnerability notification rule returns "Notification rule details." response - Given there is a valid "valid_vulnerability_notification_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "valid_vulnerability_notification_rule" in the system And new "GetVulnerabilityNotificationRule" request And request contains "id" parameter from "valid_vulnerability_notification_rule.data.id" When the request is sent @@ -869,7 +1077,9 @@ Feature: Security Monitoring @skip-go @skip-java @skip-ruby @team:DataDog/k9-cloud-security-platform Scenario: Get rule version history returns "OK" response - Given operation "GetRuleVersionHistory" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "GetRuleVersionHistory" enabled And new "GetRuleVersionHistory" request And there is a valid "security_rule" in the system And request contains "rule_id" parameter from "security_rule.id" @@ -882,14 +1092,18 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get suppressions affecting a specific rule returns "Not Found" response - Given new "GetSuppressionsAffectingRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSuppressionsAffectingRule" request And request contains "rule_id" parameter with value "aaa-bbb-ccc-ddd" When the request is sent Then the response status is 404 Not Found @team:DataDog/k9-cloud-security-platform Scenario: Get suppressions affecting a specific rule returns "OK" response - Given new "GetSuppressionsAffectingRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSuppressionsAffectingRule" request And there is a valid "security_rule" in the system And request contains "rule_id" parameter from "security_rule.id" When the request is sent @@ -897,42 +1111,54 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Get suppressions affecting future rule returns "Bad Request" response - Given new "GetSuppressionsAffectingFutureRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSuppressionsAffectingFutureRule" request And body with value {"invalid_key":"invalid_value"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/k9-cloud-security-platform Scenario: Get suppressions affecting future rule returns "OK" response - Given new "GetSuppressionsAffectingFutureRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "GetSuppressionsAffectingFutureRule" request And body from file "security_monitoring_future_rule_suppression_payload.json" When the request is sent Then the response status is 200 OK @team:DataDog/cloud-security-posture-management Scenario: Get the list of signal-based notification rules returns "The list of notification rules." response - Given there is a valid "valid_signal_notification_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "valid_signal_notification_rule" in the system And new "GetSignalNotificationRules" request When the request is sent Then the response status is 200 The list of notification rules. @team:DataDog/cloud-security-posture-management Scenario: Get the list of vulnerability notification rules returns "The list of notification rules." response - Given there is a valid "valid_vulnerability_notification_rule" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "valid_vulnerability_notification_rule" in the system And new "GetVulnerabilityNotificationRules" request When the request is sent Then the response status is 200 The list of notification rules. @generated @skip @team:DataDog/asm-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response - Given operation "ListAssetsSBOMs" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. @team:DataDog/asm-vm Scenario: List assets SBOMs returns "Not found: There is no request associated with the provided token." response - Given operation "ListAssetsSBOMs" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request And request contains "page[token]" parameter with value "unknown" And request contains "page[number]" parameter with value 1 @@ -941,14 +1167,18 @@ Feature: Security Monitoring @generated @skip @team:DataDog/asm-vm Scenario: List assets SBOMs returns "Not found: asset not found" response - Given operation "ListAssetsSBOMs" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request When the request is sent Then the response status is 404 Not found: asset not found @team:DataDog/asm-vm Scenario: List assets SBOMs returns "OK" response - Given operation "ListAssetsSBOMs" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListAssetsSBOMs" enabled And new "ListAssetsSBOMs" request And request contains "filter[package_name]" parameter with value "pandas" And request contains "filter[asset_type]" parameter with value "Service" @@ -957,21 +1187,27 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response - Given operation "ListFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListFindings" enabled And new "ListFindings" request When the request is sent Then the response status is 400 Bad Request: The server cannot process the request due to invalid syntax in the request. @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Not Found: The requested finding cannot be found." response - Given operation "ListFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListFindings" enabled And new "ListFindings" request When the request is sent Then the response status is 404 Not Found: The requested finding cannot be found. @replay-only @team:DataDog/cloud-security-posture-management Scenario: List findings returns "OK" response - Given operation "ListFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListFindings" enabled And new "ListFindings" request When the request is sent Then the response status is 200 OK @@ -979,7 +1215,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: List findings returns "OK" response with details - Given operation "ListFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListFindings" enabled And new "ListFindings" request And request contains "detailed_findings" parameter with value true When the request is sent @@ -987,14 +1225,18 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management @with-pagination Scenario: List findings returns "OK" response with pagination - Given operation "ListFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListFindings" enabled And new "ListFindings" request When the request with pagination is sent Then the response status is 200 OK @skip-terraform-config @team:DataDog/cloud-security-posture-management Scenario: List findings with detection_type query param returns "OK" response - Given operation "ListFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListFindings" enabled And new "ListFindings" request And request contains "filter[vulnerability_type]" parameter with value ["misconfiguration", "attack_path"] When the request is sent @@ -1002,35 +1244,45 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: List hist signals returns "Bad Request" response - Given operation "ListSecurityMonitoringHistsignals" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListSecurityMonitoringHistsignals" enabled And new "ListSecurityMonitoringHistsignals" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: List hist signals returns "Not Found" response - Given operation "ListSecurityMonitoringHistsignals" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListSecurityMonitoringHistsignals" enabled And new "ListSecurityMonitoringHistsignals" request When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: List hist signals returns "OK" response - Given operation "ListSecurityMonitoringHistsignals" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListSecurityMonitoringHistsignals" enabled And new "ListSecurityMonitoringHistsignals" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: List historical jobs returns "Bad Request" response - Given operation "ListHistoricalJobs" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListHistoricalJobs" enabled And new "ListHistoricalJobs" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/k9-cloud-security-platform Scenario: List historical jobs returns "OK" response - Given operation "ListHistoricalJobs" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListHistoricalJobs" enabled And operation "RunHistoricalJob" enabled And new "ListHistoricalJobs" request And there is a valid "historical_job" in the system @@ -1040,14 +1292,18 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: List resource filters returns "Bad Request" response - Given new "GetResourceEvaluationFilters" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And 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 + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And 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 @@ -1055,26 +1311,34 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: List rules returns "Bad Request" response - Given new "ListSecurityMonitoringRules" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityMonitoringRules" request When the request is sent Then the response status is 400 Bad Request @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: List rules returns "OK" response - Given new "ListSecurityMonitoringRules" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ListSecurityMonitoringRules" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/asm-vm Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response - Given operation "ListVulnerabilities" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListVulnerabilities" enabled And new "ListVulnerabilities" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. @team:DataDog/asm-vm Scenario: List vulnerabilities returns "Not found: There is no request associated with the provided token." response - Given operation "ListVulnerabilities" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListVulnerabilities" enabled And new "ListVulnerabilities" request And request contains "page[token]" parameter with value "unknown" And request contains "page[number]" parameter with value 1 @@ -1083,7 +1347,9 @@ Feature: Security Monitoring @team:DataDog/asm-vm Scenario: List vulnerabilities returns "OK" response - Given operation "ListVulnerabilities" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListVulnerabilities" enabled And new "ListVulnerabilities" request And request contains "filter[cvss.base.severity]" parameter with value "High" And request contains "filter[asset.type]" parameter with value "Service" @@ -1093,14 +1359,18 @@ Feature: Security Monitoring @generated @skip @team:DataDog/asm-vm Scenario: List vulnerable assets returns "Bad request: The server cannot process the request due to invalid syntax in the request." response - Given operation "ListVulnerableAssets" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListVulnerableAssets" enabled And new "ListVulnerableAssets" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. @team:DataDog/asm-vm Scenario: List vulnerable assets returns "Not found: There is no request associated with the provided token." response - Given operation "ListVulnerableAssets" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListVulnerableAssets" enabled And new "ListVulnerableAssets" request And request contains "page[token]" parameter with value "unknown" And request contains "page[number]" parameter with value 1 @@ -1109,7 +1379,9 @@ Feature: Security Monitoring @team:DataDog/asm-vm Scenario: List vulnerable assets returns "OK" response - Given operation "ListVulnerableAssets" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "ListVulnerableAssets" enabled And new "ListVulnerableAssets" request And request contains "filter[type]" parameter with value "Host" And request contains "filter[repository_url]" parameter with value "github.com/datadog/dd-go" @@ -1119,7 +1391,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Modify the triage assignee of a security signal returns "Bad Request" response - Given new "EditSecurityMonitoringSignalAssignee" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalAssignee" request And request contains "signal_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"assignee": {"name": null, "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}}}} When the request is sent @@ -1127,7 +1401,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Modify the triage assignee of a security signal returns "Not Found" response - Given new "EditSecurityMonitoringSignalAssignee" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalAssignee" request And request contains "signal_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"assignee": {"name": null, "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}}}} When the request is sent @@ -1135,7 +1411,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Modify the triage assignee of a security signal returns "OK" response - Given new "EditSecurityMonitoringSignalAssignee" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "EditSecurityMonitoringSignalAssignee" request And request contains "signal_id" parameter with value "AQAAAYG1bl5K4HuUewAAAABBWUcxYmw1S0FBQmt2RmhRN0V4ZUVnQUE" And body with value {"data": {"attributes": {"assignee": {"uuid": ""}}}} When the request is sent @@ -1143,7 +1421,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Mute or unmute a batch of findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response - Given operation "MuteFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "MuteFindings" enabled And new "MuteFindings" request And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings": [{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} When the request is sent @@ -1151,7 +1431,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Mute or unmute a batch of findings returns "Invalid Request: The server understands the request syntax but cannot process it due to invalid data." response - Given operation "MuteFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "MuteFindings" enabled And new "MuteFindings" request And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings": [{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} When the request is sent @@ -1159,7 +1441,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Mute or unmute a batch of findings returns "Not Found: The requested finding cannot be found." response - Given operation "MuteFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "MuteFindings" enabled And new "MuteFindings" request And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings": [{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} When the request is sent @@ -1167,7 +1451,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/cloud-security-posture-management Scenario: Mute or unmute a batch of findings returns "OK" response - Given operation "MuteFindings" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "MuteFindings" enabled And new "MuteFindings" request And body with value {"data": {"attributes": {"mute": {"expiration_date": 1778721573794, "muted": true, "reason": "ACCEPTED_RISK"}}, "id": "dbe5f567-192b-4404-b908-29b70e1c9f76", "meta": {"findings":[{"finding_id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw=="}]}, "type": "finding"}} When the request is sent @@ -1175,7 +1461,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Patch a signal-based notification rule returns "Bad Request" response - Given new "PatchSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchSignalNotificationRule" request And there is a valid "valid_signal_notification_rule" in the system And request contains "id" parameter from "valid_signal_notification_rule.data.id" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} @@ -1184,7 +1472,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Patch a signal-based notification rule returns "Not Found" response - Given new "PatchSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchSignalNotificationRule" request And request contains "id" parameter with value "000-000-000" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} When the request is sent @@ -1192,7 +1482,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Patch a signal-based notification rule returns "Notification rule successfully patched." response - Given new "PatchSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchSignalNotificationRule" request And there is a valid "valid_signal_notification_rule" in the system And request contains "id" parameter from "valid_signal_notification_rule.data.id" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} @@ -1201,7 +1493,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Patch a signal-based notification rule returns "The server cannot process the request because it contains invalid data." response - Given new "PatchSignalNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchSignalNotificationRule" request And request contains "id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} When the request is sent @@ -1209,7 +1503,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Patch a vulnerability-based notification rule returns "Bad Request" response - Given new "PatchVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchVulnerabilityNotificationRule" request And there is a valid "valid_vulnerability_notification_rule" in the system And request contains "id" parameter from "valid_vulnerability_notification_rule.data.id" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} @@ -1218,7 +1514,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Patch a vulnerability-based notification rule returns "Not Found" response - Given new "PatchVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchVulnerabilityNotificationRule" request And request contains "id" parameter with value "000-000-000" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} When the request is sent @@ -1226,7 +1524,9 @@ Feature: Security Monitoring @team:DataDog/cloud-security-posture-management Scenario: Patch a vulnerability-based notification rule returns "Notification rule successfully patched." response - Given new "PatchVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchVulnerabilityNotificationRule" request And there is a valid "valid_vulnerability_notification_rule" in the system And request contains "id" parameter from "valid_vulnerability_notification_rule.data.id" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} @@ -1235,15 +1535,34 @@ Feature: Security Monitoring @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Patch a vulnerability-based notification rule returns "The server cannot process the request because it contains invalid data." response - Given new "PatchVulnerabilityNotificationRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "PatchVulnerabilityNotificationRule" request And request contains "id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}} When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/asm-vm + Scenario: Returns list of Secrets rules returns "OK" response + Given operation "GetSecretsRules" enabled + And new "GetSecretsRules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/asm-vm + Scenario: Ruleset get multiple returns "OK" response + Given operation "ListMultipleRulesets" enabled + And new "ListMultipleRulesets" request + And body with value {"data": {"attributes": {"rulesets": []}, "type": "get_multiple_rulesets_request"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Run a historical job returns "Bad Request" response - Given operation "RunHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "RunHistoricalJob" enabled And new "RunHistoricalJob" request And body with value {"data":{"type":"historicalDetectionsJobCreate","attributes":{"jobDefinition":{"type":"log_detection","name":"Excessive number of failed attempts.","queries":[{"query":"source:non_existing_src_weekend","aggregation":"count","groupByFields":[],"distinctFields":[]}],"cases":[{"name":"Condition 1","status":"info","notifications":[],"condition":"a > 1"}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900},"message":"A large number of failed login attempts.","tags":[],"from":1730387522611,"to":1730391122611,"index":"non_existing_index"}}}} When the request is sent @@ -1251,7 +1570,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Run a historical job returns "Not Found" response - Given operation "RunHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "RunHistoricalJob" enabled And new "RunHistoricalJob" request And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}} When the request is sent @@ -1259,7 +1580,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Run a historical job returns "Status created" response - Given operation "RunHistoricalJob" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "RunHistoricalJob" enabled And new "RunHistoricalJob" request And body with value {"data":{"type":"historicalDetectionsJobCreate","attributes":{"jobDefinition":{"type":"log_detection","name":"Excessive number of failed attempts.","queries":[{"query":"source:non_existing_src_weekend","aggregation":"count","groupByFields":[],"distinctFields":[]}],"cases":[{"name":"Condition 1","status":"info","notifications":[],"condition":"a > 1"}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900},"message":"A large number of failed login attempts.","tags":[],"from":1730387522611,"to":1730387532611,"index":"main"}}}} When the request is sent @@ -1267,7 +1590,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Search hist signals returns "Bad Request" response - Given operation "SearchSecurityMonitoringHistsignals" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "SearchSecurityMonitoringHistsignals" enabled And new "SearchSecurityMonitoringHistsignals" request And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent @@ -1275,7 +1600,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Search hist signals returns "Not Found" response - Given operation "SearchSecurityMonitoringHistsignals" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "SearchSecurityMonitoringHistsignals" enabled And new "SearchSecurityMonitoringHistsignals" request And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent @@ -1283,7 +1610,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Search hist signals returns "OK" response - Given operation "SearchSecurityMonitoringHistsignals" enabled + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And operation "SearchSecurityMonitoringHistsignals" enabled And new "SearchSecurityMonitoringHistsignals" request And body with value {"filter": {"from": "2019-01-02T09:42:36.320Z", "query": "security:attack status:high", "to": "2019-01-03T09:42:36.320Z"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent @@ -1291,21 +1620,27 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Test a rule returns "Bad Request" response - Given new "TestSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "TestSecurityMonitoringRule" request And body with value {"rule": {"cases": [], "filters": [{"action": "require"}], "hasExtendedTitle": true, "isEnabled": true, "message": "", "name": "My security monitoring rule.", "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}, "thirdPartyRuleOptions": {"defaultNotifications": [], "defaultStatus": "critical", "rootQueries": [{"groupByFields": [], "query": "source:cloudtrail"}]}}, "queries": [], "tags": ["env:prod", "team:security"], "thirdPartyCases": [], "type": "application_security"}, "ruleQueryPayloads": [{"expectedResult": true, "index": 0, "payload": {"ddsource": "nginx", "ddtags": "env:staging,version:5.1", "hostname": "i-012345678", "message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", "service": "payment"}}]} When the request is sent Then the response status is 400 Bad Request @skip @team:DataDog/k9-cloud-security-platform Scenario: Test a rule returns "Not Found" response - Given new "TestSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "TestSecurityMonitoringRule" request And body with value {"rule": {"cases": [], "filters": [{"action": "require"}], "hasExtendedTitle": true, "isEnabled": true, "message": "", "name": "My security monitoring rule.", "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}, "thirdPartyRuleOptions": {"defaultNotifications": [], "defaultStatus": "critical", "rootQueries": [{"groupByFields": [], "query": "source:cloudtrail"}]}}, "queries": [], "tags": ["env:prod", "team:security"], "thirdPartyCases": [], "type": "application_security"}, "ruleQueryPayloads": [{"expectedResult": true, "index": 0, "payload": {"ddsource": "nginx", "ddtags": "env:staging,version:5.1", "hostname": "i-012345678", "message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", "service": "payment"}}]} When the request is sent Then the response status is 404 Not Found @skip-go @skip-java @skip-ruby @skip-typescript @team:DataDog/k9-cloud-security-platform Scenario: Test a rule returns "OK" response - Given new "TestSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "TestSecurityMonitoringRule" request And body with value {"rule": {"cases": [{"name": "","status": "info","notifications": [],"condition": "a > 0"}],"hasExtendedTitle": true,"isEnabled": true,"message": "My security monitoring rule message.","name": "My security monitoring rule.","options": {"decreaseCriticalityBasedOnEnv": false,"detectionMethod": "threshold","evaluationWindow": 0,"keepAlive": 0,"maxSignalDuration": 0},"queries": [{"query": "source:source_here","groupByFields": ["@userIdentity.assumed_role"],"distinctFields": [],"aggregation": "count","name": ""}],"tags": ["env:prod", "team:security"],"type": "log_detection"}, "ruleQueryPayloads": [{"expectedResult": true,"index": 0,"payload": {"ddsource": "source_here","ddtags": "env:staging,version:5.1","hostname": "i-012345678","message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World","service": "payment","userIdentity": {"assumed_role" : "fake assumed_role"}}}]} When the request is sent Then the response status is 200 OK @@ -1313,7 +1648,9 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Test an existing rule returns "Bad Request" response - Given new "TestExistingSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "TestExistingSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" And body with value {"ruleQueryPayloads": [{"expectedResult": true, "index": 0, "payload": {"ddsource": "nginx", "ddtags": "env:staging,version:5.1", "hostname": "i-012345678", "message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", "service": "payment"}}]} When the request is sent @@ -1321,7 +1658,9 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Test an existing rule returns "Not Found" response - Given new "TestExistingSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "TestExistingSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" And body with value {"ruleQueryPayloads": [{"expectedResult": true, "index": 0, "payload": {"ddsource": "nginx", "ddtags": "env:staging,version:5.1", "hostname": "i-012345678", "message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", "service": "payment"}}]} When the request is sent @@ -1329,7 +1668,9 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Test an existing rule returns "OK" response - Given new "TestExistingSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "TestExistingSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" And body with value {"ruleQueryPayloads": [{"expectedResult": true, "index": 0, "payload": {"ddsource": "nginx", "ddtags": "env:staging,version:5.1", "hostname": "i-012345678", "message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", "service": "payment"}}]} When the request is sent @@ -1337,7 +1678,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Update a cloud configuration rule's details returns "OK" response - Given new "UpdateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringRule" request And there is a valid "cloud_configuration_rule" in the system And request contains "rule_id" parameter from "cloud_configuration_rule.id" And body with value {"name":"{{ unique }}_cloud_updated","isEnabled":false,"cases":[{"status":"info","notifications":[]}],"options":{"complianceRuleOptions":{"resourceType":"gcp_compute_disk", "regoRule":{"policy":"package datadog\n\nimport data.datadog.output as dd_output\n\nimport future.keywords.contains\nimport future.keywords.if\nimport future.keywords.in\n\nmilliseconds_in_a_day := ((1000 * 60) * 60) * 24\n\neval(iam_service_account_key) = \"skip\" if {\n\tiam_service_account_key.disabled\n} else = \"pass\" if {\n\t(iam_service_account_key.resource_seen_at / milliseconds_in_a_day) - (iam_service_account_key.valid_after_time / milliseconds_in_a_day) <= 90\n} else = \"fail\"\n\n# This part remains unchanged for all rules\nresults contains result if {\n\tsome resource in input.resources[input.main_resource_type]\n\tresult := dd_output.format(resource, eval(resource))\n}\n","resourceTypes":["gcp_compute_disk"]}}},"message":"ddd","tags":[],"complianceSignalOptions":{"userActivationStatus":false,"userGroupByFields":[]}} @@ -1348,7 +1691,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Update a custom framework returns "Bad Request" response - Given new "UpdateCustomFramework" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateCustomFramework" request And request contains "handle" parameter with value "create-framework-new" And request contains "version" parameter with value "10" And body with value {"data": {"attributes": {"handle": "", "name": "", "requirements": [{"controls": [{"name": "", "rules_id": [""]}], "name": ""}], "version": ""}, "type": "custom_framework"}} @@ -1357,7 +1702,9 @@ Feature: Security Monitoring @replay-only @team:DataDog/k9-cloud-security-platform Scenario: Update a custom framework returns "OK" response - Given there is a valid "custom_framework" in the system + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And there is a valid "custom_framework" in the system And new "UpdateCustomFramework" request And request contains "handle" parameter with value "create-framework-new" And request contains "version" parameter with value "10" @@ -1367,7 +1714,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Bad Request" response - Given new "UpdateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityFilter" request And request contains "security_filter_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"exclusion_filters": [], "filtered_data_type": "logs", "is_enabled": true, "name": "Custom security filter", "query": "service:api", "version": 1}, "type": "security_filters"}} When the request is sent @@ -1375,7 +1724,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Concurrent Modification" response - Given new "UpdateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityFilter" request And request contains "security_filter_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"exclusion_filters": [], "filtered_data_type": "logs", "is_enabled": true, "name": "Custom security filter", "query": "service:api", "version": 1}, "type": "security_filters"}} When the request is sent @@ -1383,7 +1734,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Not Found" response - Given new "UpdateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityFilter" request And request contains "security_filter_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"exclusion_filters": [], "filtered_data_type": "logs", "is_enabled": true, "name": "Custom security filter", "query": "service:api", "version": 1}, "type": "security_filters"}} When the request is sent @@ -1391,7 +1744,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "OK" response - Given new "UpdateSecurityFilter" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityFilter" request And there is a valid "security_filter" in the system And request contains "security_filter_id" parameter from "security_filter.data.id" And body with value {"data": {"attributes": {"exclusion_filters": [], "filtered_data_type": "logs", "is_enabled": true, "name": "{{ unique }}", "query": "service:{{ unique_alnum }}", "version": 1}, "type": "security_filters"}} @@ -1403,7 +1758,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a suppression rule returns "Bad Request" response - Given new "UpdateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent @@ -1411,7 +1768,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a suppression rule returns "Concurrent Modification" response - Given new "UpdateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent @@ -1419,7 +1778,9 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a suppression rule returns "Not Found" response - Given new "UpdateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent @@ -1427,7 +1788,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Update a suppression rule returns "OK" response - Given new "UpdateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringSuppression" request And there is a valid "suppression" in the system And request contains "suppression_id" parameter from "suppression.data.id" And body with value {"data": {"attributes": {"suppression_query": "env:staging status:low"}, "type": "suppressions"}} @@ -1439,7 +1802,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Update an existing rule returns "Bad Request" response - Given new "UpdateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringRule" request And there is a valid "security_rule" in the system And request contains "rule_id" parameter from "security_rule.id" And body with value {"name":"{{ unique }}", "queries":[{"query":""}],"cases":[{"status":"info"}],"options":{},"message":"Test rule Bad","tags":[],"isEnabled":true} @@ -1448,7 +1813,9 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Update an existing rule returns "Not Found" response - Given new "UpdateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter with value "abcde-12345" And body with value {"name": "{{ unique }}-NotFound","queries": [{"query": "@test:true","aggregation": "count","groupByFields": [],"distinctFields": [],"metrics": []}],"filters": [],"cases": [{"name": "", "status": "info", "condition": "a > 0", "notifications": []}], "options": {"evaluationWindow": 900, "keepAlive": 3600, "maxSignalDuration": 86400}, "message": "Test rule", "tags": [], "isEnabled": true} When the request is sent @@ -1456,7 +1823,9 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Update an existing rule returns "OK" response - Given new "UpdateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "UpdateSecurityMonitoringRule" request And there is a valid "security_rule" in the system And request contains "rule_id" parameter from "security_rule.id" And body with value {"name": "{{ unique }}-Updated","queries": [{"query": "@test:true","aggregation": "count","groupByFields": [],"distinctFields": [],"metrics": []}],"filters": [],"cases": [{"name": "", "status": "info", "condition": "a > 0", "notifications": []}], "options": {"evaluationWindow": 900, "keepAlive": 3600, "maxSignalDuration": 86400}, "message": "Test rule", "tags": [], "isEnabled": true} @@ -1467,49 +1836,63 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Update resource filters returns "Bad Request" response - Given new "UpdateResourceEvaluationFilters" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And 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 + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And 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 + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ValidateSecurityMonitoringRule" request And body with value {"cases":[{"name":"","status":"info","notifications":[],"condition":"a > 0"}],"hasExtendedTitle":true,"isEnabled":true,"message":"My security monitoring rule","name":"My security monitoring rule","options":{"evaluationWindow":1800,"keepAlive":999999,"maxSignalDuration":1800,"detectionMethod":"threshold"},"queries":[{"query":"source:source_here","groupByFields":["@userIdentity.assumed_role"],"distinctFields":[],"aggregation":"count","name":""}],"tags":["env:prod","team:security"],"type":"log_detection"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/k9-cloud-security-platform Scenario: Validate a detection rule returns "OK" response - Given new "ValidateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ValidateSecurityMonitoringRule" request And body with value {"cases":[{"name":"","status":"info","notifications":[],"condition":"a > 0"}],"hasExtendedTitle":true,"isEnabled":true,"message":"My security monitoring rule","name":"My security monitoring rule","options":{"evaluationWindow":1800,"keepAlive":1800,"maxSignalDuration":1800,"detectionMethod":"threshold"},"queries":[{"query":"source:source_here","groupByFields":["@userIdentity.assumed_role"],"distinctFields":[],"aggregation":"count","name":""}],"tags":["env:prod","team:security"],"type":"log_detection"} When the request is sent Then the response status is 204 OK @team:DataDog/k9-cloud-security-platform Scenario: Validate a detection rule with detection method 'sequence_detection' returns "OK" response - Given new "ValidateSecurityMonitoringRule" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ValidateSecurityMonitoringRule" request And body with value {"cases":[{"name":"","status":"info","notifications":[],"condition":"step_b > 0"}],"hasExtendedTitle":true,"isEnabled":true,"message":"My security monitoring rule","name":"My security monitoring rule","options":{"evaluationWindow":0,"keepAlive":300,"maxSignalDuration":600,"detectionMethod":"sequence_detection","sequenceDetectionOptions":{"stepTransitions":[{"child":"step_b","evaluationWindow":900,"parent":"step_a"}],"steps":[{"condition":"a > 0","evaluationWindow":60,"name":"step_a"},{"condition":"b > 0","evaluationWindow":60,"name":"step_b"}]}},"queries":[{"query":"source:source_here","groupByFields":["@userIdentity.assumed_role"],"distinctFields":[],"aggregation":"count","name":""},{"query":"source:source_here2","groupByFields":[],"distinctFields":[],"aggregation":"count","name":""}],"tags":["env:prod","team:security"],"type":"log_detection"} When the request is sent Then the response status is 204 OK @team:DataDog/k9-cloud-security-platform Scenario: Validate a suppression rule returns "Bad Request" response - Given new "ValidateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ValidateSecurityMonitoringSuppression" request And body with value {"data": {"attributes": {"name" : "cold_harbour", "enabled": false, "rule_query":"rule:[A-Invalid", "data_exclusion_query": "not enough attributes"}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/k9-cloud-security-platform Scenario: Validate a suppression rule returns "OK" response - Given new "ValidateSecurityMonitoringSuppression" request + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And new "ValidateSecurityMonitoringSuppression" request And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail"}, "type": "suppressions"}} When the request is sent Then the response status is 204 OK 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 c4c269d3cab..3b918b525a6 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 @@ -3780,6 +3780,20 @@ "type": "safe" } }, + "ListMultipleRulesets": { + "tag": "Security Monitoring", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetSecretsRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": {