diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3661bf3fc2f..03da13c5f2c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -10502,6 +10502,7 @@ components: - Host - HostImage - Image + - ServerlessFunction example: Repository type: string x-enum-varnames: @@ -10510,6 +10511,7 @@ components: - HOST - HOSTIMAGE - IMAGE + - SERVERLESSFUNCTION AssetVersion: description: Asset version. properties: @@ -175616,6 +175618,11 @@ paths: description: |- Get a list of assets SBOMs for an organization. + The `filter[asset_type]` parameter is required for initial requests (when no `page[token]` is provided). + Subsequent pages encode the asset type in the pagination token, so `filter[asset_type]` is not required + for paginated requests. Mixing infrastructure asset types (`Host`, `HostImage`, `Image`, `ServerlessFunction`) + with code asset types (`Repository`, `Service`) in the same request is not supported and returns a 400 error. + ### Pagination Please review the [Pagination section](#pagination) for the "List Vulnerabilities" endpoint. @@ -175645,7 +175652,8 @@ paths: format: int64 minimum: 1 type: integer - - description: The type of the assets for the SBOM request. + - description: >- + The type of the assets for the SBOM request. Required for initial requests (when no `page[token]` is provided). Infrastructure types (`Host`, `HostImage`, `Image`, `ServerlessFunction`) and code types (`Repository`, `Service`) cannot be mixed in the same request. example: Repository in: query name: filter[asset_type] 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 2a8f29c2eb3..84b06178913 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 @@ -16679,7 +16679,11 @@ public ListAssetsSBOMsOptionalParameters pageNumber(Long pageNumber) { /** * Set filterAssetType. * - * @param filterAssetType The type of the assets for the SBOM request. (optional) + * @param filterAssetType The type of the assets for the SBOM request. Required for initial + * requests (when no page[token] is provided). Infrastructure types (Host + * , HostImage, Image, ServerlessFunction) and + * code types (Repository, Service) cannot be mixed in the same + * request. (optional) * @return ListAssetsSBOMsOptionalParameters */ public ListAssetsSBOMsOptionalParameters filterAssetType(AssetType filterAssetType) { @@ -16809,6 +16813,13 @@ public CompletableFuture listAssetsSBOMsAsync( /** * Get a list of assets SBOMs for an organization. * + *

The filter[asset_type] parameter is required for initial requests (when no + * page[token] is provided). Subsequent pages encode the asset type in the pagination + * token, so filter[asset_type] is not required for paginated requests. Mixing + * infrastructure asset types (Host, HostImage, Image, + * ServerlessFunction) with code asset types (Repository, Service + * ) in the same request is not supported and returns a 400 error. + * *

Pagination

* *

Please review the Pagination section for the "List diff --git a/src/main/java/com/datadog/api/client/v2/model/AssetType.java b/src/main/java/com/datadog/api/client/v2/model/AssetType.java index fc45e7edc23..317e6137ebb 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AssetType.java +++ b/src/main/java/com/datadog/api/client/v2/model/AssetType.java @@ -23,13 +23,16 @@ public class AssetType extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("Repository", "Service", "Host", "HostImage", "Image")); + new HashSet( + Arrays.asList( + "Repository", "Service", "Host", "HostImage", "Image", "ServerlessFunction")); public static final AssetType REPOSITORY = new AssetType("Repository"); public static final AssetType SERVICE = new AssetType("Service"); public static final AssetType HOST = new AssetType("Host"); public static final AssetType HOSTIMAGE = new AssetType("HostImage"); public static final AssetType IMAGE = new AssetType("Image"); + public static final AssetType SERVERLESSFUNCTION = new AssetType("ServerlessFunction"); AssetType(String value) { super(value, allowedValues); diff --git a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.freeze b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.freeze index 70b6759f511..bc955ea3db3 100644 --- a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.freeze +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.freeze @@ -1 +1 @@ -2026-07-06T19:25:16.964Z \ No newline at end of file +2026-07-07T14:35:06.517Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.json b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.json index 3ce150dc393..bf15c31e721 100644 --- a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.json +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Bad_request_Invalid_pagination_token_response.json @@ -6,7 +6,7 @@ "path": "/api/v2/security/sboms", "queryStringParameters": { "page[token]": [ - "unknown" + "SERVICE:unknown" ], "page[number]": [ "1" @@ -16,7 +16,7 @@ "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad request: asset_type\",\"detail\":\"asset_type filter is required\"}]}", + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Unexpected internal error\"}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -31,6 +31,6 @@ "timeToLive": { "unlimited": true }, - "id": "5eb3b8f5-3dd3-195c-e37e-46f12fa2d7a1" + "id": "ba0ed496-453c-e8e1-0a23-16ea3ab92b2f" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.freeze index a502bb4f89a..982d9d76508 100644 --- a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-20T08:27:19.760Z \ No newline at end of file +2026-07-07T14:35:10.638Z \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index c204c1d587f..3183e333ceb 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 @@ -2369,7 +2369,7 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Bad request: Invalid pagination token." response Given new "ListAssetsSBOMs" request - And request contains "page[token]" parameter with value "unknown" + And request contains "page[token]" parameter with value "SERVICE:unknown" And request contains "page[number]" parameter with value 1 When the request is sent Then the response status is 400 Bad request: Invalid pagination token.