From d25cb5153bbd064950aa7298bde2f80de00e4b24 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 10 Jul 2025 19:45:05 +0000 Subject: [PATCH] Regenerate client from commit fb5c5947 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 298 ++++++++++++++ .../security-monitoring/ListAssetsSBOMs.java | 31 ++ .../com/datadog/api/client/ApiClient.java | 1 + .../client/v2/api/SecurityMonitoringApi.java | 385 ++++++++++++++++++ .../api/client/v2/model/AssetAttributes.java | 45 +- .../v2/model/ListAssetsSBOMsResponse.java | 212 ++++++++++ .../api/client/v2/model/SBOMAttributes.java | 47 ++- .../api/client/v2/model/SBOMComponent.java | 113 ++++- .../v2/model/SBOMComponentDependency.java | 174 ++++++++ .../client/v2/model/SBOMComponentLicense.java | 146 +++++++ .../v2/model/SBOMComponentLicenseLicense.java | 144 +++++++ .../v2/model/SBOMComponentLicenseType.java | 80 ++++ .../v2/model/SBOMComponentProperty.java | 173 ++++++++ .../v2/model/SBOMComponentSupplier.java | 143 +++++++ .../api/client/v2/model/SBOMMetadata.java | 76 +++- .../client/v2/model/SBOMMetadataAuthor.java | 135 ++++++ .../v2/model/VulnerabilityAttributes.java | 34 ++ ...ed_with_the_provided_token_response.freeze | 1 + ...ated_with_the_provided_token_response.json | 36 ++ ...st_assets_SBOMs_returns_OK_response.freeze | 1 + ...List_assets_SBOMs_returns_OK_response.json | 36 ++ .../client/v2/api/security_monitoring.feature | 32 ++ .../com/datadog/api/client/v2/api/undo.json | 6 + 24 files changed, 2347 insertions(+), 10 deletions(-) create mode 100644 examples/v2/security-monitoring/ListAssetsSBOMs.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListAssetsSBOMsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMComponentDependency.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicense.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicenseLicense.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicenseType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMComponentProperty.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMComponentSupplier.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMMetadataAuthor.java create mode 100644 src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.json diff --git a/.apigentools-info b/.apigentools-info index 826b8852272..700a120faa5 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-07-09 16:47:18.281866", - "spec_repo_commit": "d0906173" + "regenerated": "2025-07-10 19:43:03.929124", + "spec_repo_commit": "fb5c5947" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-07-09 16:47:18.298039", - "spec_repo_commit": "d0906173" + "regenerated": "2025-07-10 19:43:03.945439", + "spec_repo_commit": "fb5c5947" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8ab2278d000..5f2203d9697 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3575,6 +3575,14 @@ components: $ref: '#/components/schemas/AssetOperatingSystem' risks: $ref: '#/components/schemas/AssetRisks' + teams: + description: List of teams that own the asset. + example: + - compute + items: + example: compute + type: string + type: array type: $ref: '#/components/schemas/AssetType' version: @@ -20340,6 +20348,21 @@ components: format: int64 type: integer type: object + ListAssetsSBOMsResponse: + description: The expected response schema when listing assets SBOMs. + properties: + data: + description: List of assets SBOMs. + items: + $ref: '#/components/schemas/SBOM' + type: array + links: + $ref: '#/components/schemas/Links' + meta: + $ref: '#/components/schemas/Metadata' + required: + - data + type: object ListDevicesResponse: description: List devices response. properties: @@ -32395,6 +32418,11 @@ components: items: $ref: '#/components/schemas/SBOMComponent' type: array + dependencies: + description: List of dependencies between components of the SBOM. + items: + $ref: '#/components/schemas/SBOMComponentDependency' + type: array metadata: $ref: '#/components/schemas/SBOMMetadata' serialNumber: @@ -32418,6 +32446,7 @@ components: - metadata - serialNumber - version + - dependencies type: object SBOMComponent: description: Software or hardware component. @@ -32427,16 +32456,28 @@ components: elsewhere in the BOM. example: pkg:golang/google.golang.org/grpc@1.68.1 type: string + licenses: + description: The software licenses of the SBOM component. + items: + $ref: '#/components/schemas/SBOMComponentLicense' + type: array name: description: The name of the component. This will often be a shortened, single name of the component. example: google.golang.org/grpc type: string + properties: + description: The custom properties of the component of the SBOM. + items: + $ref: '#/components/schemas/SBOMComponentProperty' + type: array purl: description: Specifies the package-url (purl). The purl, if specified, MUST be valid and conform to the [specification](https://github.com/package-url/purl-spec). example: pkg:golang/google.golang.org/grpc@1.68.1 type: string + supplier: + $ref: '#/components/schemas/SBOMComponentSupplier' type: $ref: '#/components/schemas/SBOMComponentType' version: @@ -32447,6 +32488,89 @@ components: - type - name - version + - supplier + type: object + SBOMComponentDependency: + description: The dependencies of a component of the SBOM. + properties: + dependsOn: + description: The components that are dependencies of the ref component. + items: + example: pkg:golang/google.golang.org/grpc@1.68.1 + type: string + required: + - ref + - dependsOn + type: array + ref: + description: The identifier for the related component. + example: Repository|github.com/datadog/datadog-agent + type: string + type: object + SBOMComponentLicense: + description: The software license of the component of the SBOM. + properties: + license: + $ref: '#/components/schemas/SBOMComponentLicenseLicense' + required: + - license + type: object + SBOMComponentLicenseLicense: + description: The software license of the component of the SBOM. + properties: + name: + description: The name of the software license of the component of the SBOM. + example: MIT + type: string + required: + - name + type: object + SBOMComponentLicenseType: + description: The SBOM component license type. + enum: + - network_strong_copyleft + - non_standard_copyleft + - other_non_free + - other_non_standard + - permissive + - public_domain + - strong_copyleft + - weak_copyleft + example: application + type: string + x-enum-varnames: + - NETWORK_STRONG_COPYLEFT + - NON_STANDARD_COPYLEFT + - OTHER_NON_FREE + - OTHER_NON_STANDARD + - PERMISSIVE + - PUBLIC_DOMAIN + - STRONG_COPYLEFT + - WEAK_COPYLEFT + SBOMComponentProperty: + description: The custom property of the component of the SBOM. + properties: + name: + description: The name of the custom property of the component of the SBOM. + example: license_type + type: string + value: + description: The value of the custom property of the component of the SBOM. + example: permissive + type: string + required: + - name + - value + type: object + SBOMComponentSupplier: + description: The supplier of the component. + properties: + name: + description: Identifier of the supplier of the component. + example: https://go.dev + type: string + required: + - name type: object SBOMComponentType: description: The SBOM component type @@ -32481,8 +32605,25 @@ components: SBOMMetadata: description: Provides additional information about a BOM. properties: + authors: + description: List of authors of the SBOM. + items: + $ref: '#/components/schemas/SBOMMetadataAuthor' + type: array component: $ref: '#/components/schemas/SBOMMetadataComponent' + timestamp: + description: The timestamp of the SBOM creation. + example: '2025-07-08T07:24:53Z' + type: string + type: object + SBOMMetadataAuthor: + description: Author of the SBOM. + properties: + name: + description: The identifier of the Author of the SBOM. + example: Datadog, Inc. + type: string type: object SBOMMetadataComponent: description: The component that the BOM describes. @@ -41438,6 +41579,14 @@ components: type: string library: $ref: '#/components/schemas/Library' + origin: + description: Vulnerability origin. + example: + - agentless-scanner + items: + example: agentless-scanner + type: string + type: array remediations: description: List of remediations. items: @@ -41477,6 +41626,7 @@ components: - exposure_time - remediations - fix_available + - origin type: object VulnerabilityCvss: description: Vulnerability severities. @@ -58257,6 +58407,13 @@ paths: required: false schema: type: string + - description: Filter by teams. + example: compute + in: query + name: filter[teams] + required: false + schema: + type: string - description: Filter by architecture. example: arm64 in: query @@ -58350,6 +58507,133 @@ paths: operator: OR permissions: - security_monitoring_cws_agent_rules_read + /api/v2/security/sboms: + get: + description: 'Get a list of assets SBOMs for an organization. + + + ### Pagination + + + Please review the [Pagination section](#pagination) for the "List Vulnerabilities" + endpoint. + + + ### Filtering + + + Please review the [Filtering section](#filtering) for the "List Vulnerabilities" + endpoint. + + + ### Metadata + + + Please review the [Metadata section](#metadata) for the "List Vulnerabilities" + endpoint.' + operationId: ListAssetsSBOMs + parameters: + - description: Its value must come from the `links` section of the response + of the first request. Do not manually edit it. + example: b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + in: query + name: page[token] + required: false + schema: + type: string + - description: The page number to be retrieved. It should be equal to or greater + than 1. + example: 1 + in: query + name: page[number] + required: false + schema: + format: int64 + minimum: 1 + type: integer + - description: The type of the assets for the SBOM request. + example: Repository + in: query + name: filter[asset_type] + required: false + schema: + $ref: '#/components/schemas/AssetType' + - description: The name of the asset for the SBOM request. + example: github.com/datadog/datadog-agent + in: query + name: filter[asset_name] + required: false + schema: + type: string + - description: The name of the component that is a dependency of an asset. + example: opentelemetry-api + in: query + name: filter[package_name] + required: false + schema: + type: string + - description: The version of the component that is a dependency of an asset. + example: 1.33.1 + in: query + name: filter[package_version] + required: false + schema: + type: string + - description: The software license name of the component that is a dependency + of an asset. + example: Apache-2.0 + in: query + name: filter[license_name] + required: false + schema: + type: string + - description: The software license type of the component that is a dependency + of an asset. + example: network_strong_copyleft + in: query + name: filter[license_type] + required: false + schema: + $ref: '#/components/schemas/SBOMComponentLicenseType' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListAssetsSBOMsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Bad request: The server cannot process the request due to + invalid syntax in the request.' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Forbidden: Access denied' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Not found: asset not found' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - appsec_vm_read + summary: List assets SBOMs + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint is a private preview. + + If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security/sboms/{asset_type}: get: description: 'Get a single SBOM related to an asset by its type and name. @@ -58841,6 +59125,13 @@ paths: required: false schema: type: string + - description: Filter by origin. + example: agentless-scanner + in: query + name: filter[origin] + required: false + schema: + type: string - description: Filter by asset name. example: datadog-agent in: query @@ -58920,6 +59211,13 @@ paths: required: false schema: type: string + - description: Filter by asset teams. + example: compute + in: query + name: filter[asset.teams] + required: false + schema: + type: string - description: Filter by asset architecture. example: arm64 in: query diff --git a/examples/v2/security-monitoring/ListAssetsSBOMs.java b/examples/v2/security-monitoring/ListAssetsSBOMs.java new file mode 100644 index 00000000000..78fa32cd531 --- /dev/null +++ b/examples/v2/security-monitoring/ListAssetsSBOMs.java @@ -0,0 +1,31 @@ +// List assets SBOMs returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListAssetsSBOMsOptionalParameters; +import com.datadog.api.client.v2.model.AssetType; +import com.datadog.api.client.v2.model.ListAssetsSBOMsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listAssetsSBOMs", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + ListAssetsSBOMsResponse result = + apiInstance.listAssetsSBOMs( + new ListAssetsSBOMsOptionalParameters() + .filterPackageName("pandas") + .filterAssetType(AssetType.SERVICE)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#listAssetsSBOMs"); + 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 943cfefd206..4c5af28e02e 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -695,6 +695,7 @@ public class ApiClient { put("v2.getHistoricalJob", false); put("v2.getRuleVersionHistory", false); put("v2.getSBOM", false); + put("v2.listAssetsSBOMs", false); put("v2.listFindings", false); put("v2.listHistoricalJobs", false); put("v2.listVulnerabilities", 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 fe8b08d1f11..284e7124560 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 @@ -24,6 +24,7 @@ import com.datadog.api.client.v2.model.GetSBOMResponse; import com.datadog.api.client.v2.model.HistoricalJobResponse; import com.datadog.api.client.v2.model.JobCreateResponse; +import com.datadog.api.client.v2.model.ListAssetsSBOMsResponse; import com.datadog.api.client.v2.model.ListFindingsResponse; import com.datadog.api.client.v2.model.ListHistoricalJobsResponse; import com.datadog.api.client.v2.model.ListVulnerabilitiesResponse; @@ -31,6 +32,7 @@ import com.datadog.api.client.v2.model.NotificationRuleResponse; 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.SecurityFilterCreateRequest; import com.datadog.api.client.v2.model.SecurityFilterResponse; import com.datadog.api.client.v2.model.SecurityFilterUpdateRequest; @@ -5329,6 +5331,339 @@ public ApiResponse getVulnerabilityNotificationRulesWithHttpInfo() throw new GenericType() {}); } + /** Manage optional parameters to listAssetsSBOMs. */ + public static class ListAssetsSBOMsOptionalParameters { + private String pageToken; + private Long pageNumber; + private AssetType filterAssetType; + private String filterAssetName; + private String filterPackageName; + private String filterPackageVersion; + private String filterLicenseName; + private SBOMComponentLicenseType filterLicenseType; + + /** + * Set pageToken. + * + * @param pageToken Its value must come from the links section of the response of + * the first request. Do not manually edit it. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber The page number to be retrieved. It should be equal to or greater than 1. + * (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterAssetType. + * + * @param filterAssetType The type of the assets for the SBOM request. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterAssetType(AssetType filterAssetType) { + this.filterAssetType = filterAssetType; + return this; + } + + /** + * Set filterAssetName. + * + * @param filterAssetName The name of the asset for the SBOM request. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterAssetName(String filterAssetName) { + this.filterAssetName = filterAssetName; + return this; + } + + /** + * Set filterPackageName. + * + * @param filterPackageName The name of the component that is a dependency of an asset. + * (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterPackageName(String filterPackageName) { + this.filterPackageName = filterPackageName; + return this; + } + + /** + * Set filterPackageVersion. + * + * @param filterPackageVersion The version of the component that is a dependency of an asset. + * (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterPackageVersion(String filterPackageVersion) { + this.filterPackageVersion = filterPackageVersion; + return this; + } + + /** + * Set filterLicenseName. + * + * @param filterLicenseName The software license name of the component that is a dependency of + * an asset. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterLicenseName(String filterLicenseName) { + this.filterLicenseName = filterLicenseName; + return this; + } + + /** + * Set filterLicenseType. + * + * @param filterLicenseType The software license type of the component that is a dependency of + * an asset. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterLicenseType( + SBOMComponentLicenseType filterLicenseType) { + this.filterLicenseType = filterLicenseType; + return this; + } + } + + /** + * List assets SBOMs. + * + *

See {@link #listAssetsSBOMsWithHttpInfo}. + * + * @return ListAssetsSBOMsResponse + * @throws ApiException if fails to make API call + */ + public ListAssetsSBOMsResponse listAssetsSBOMs() throws ApiException { + return listAssetsSBOMsWithHttpInfo(new ListAssetsSBOMsOptionalParameters()).getData(); + } + + /** + * List assets SBOMs. + * + *

See {@link #listAssetsSBOMsWithHttpInfoAsync}. + * + * @return CompletableFuture<ListAssetsSBOMsResponse> + */ + public CompletableFuture listAssetsSBOMsAsync() { + return listAssetsSBOMsWithHttpInfoAsync(new ListAssetsSBOMsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List assets SBOMs. + * + *

See {@link #listAssetsSBOMsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListAssetsSBOMsResponse + * @throws ApiException if fails to make API call + */ + public ListAssetsSBOMsResponse listAssetsSBOMs(ListAssetsSBOMsOptionalParameters parameters) + throws ApiException { + return listAssetsSBOMsWithHttpInfo(parameters).getData(); + } + + /** + * List assets SBOMs. + * + *

See {@link #listAssetsSBOMsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListAssetsSBOMsResponse> + */ + public CompletableFuture listAssetsSBOMsAsync( + ListAssetsSBOMsOptionalParameters parameters) { + return listAssetsSBOMsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of assets SBOMs for an organization. + * + *

Pagination

+ * + *

Please review the Pagination section for the "List + * Vulnerabilities" endpoint. + * + *

Filtering

+ * + *

Please review the Filtering section for the "List Vulnerabilities" + * endpoint. + * + *

Metadata

+ * + *

Please review the Metadata section for the "List Vulnerabilities" + * endpoint. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListAssetsSBOMsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
+ */ + public ApiResponse listAssetsSBOMsWithHttpInfo( + ListAssetsSBOMsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listAssetsSBOMs"; + 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; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + AssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterPackageName = parameters.filterPackageName; + String filterPackageVersion = parameters.filterPackageVersion; + String filterLicenseName = parameters.filterLicenseName; + SBOMComponentLicenseType filterLicenseType = parameters.filterLicenseType; + // create path and map variables + String localVarPath = "/api/v2/security/sboms"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_name]", filterPackageName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_version]", filterPackageVersion)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_name]", filterLicenseName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_type]", filterLicenseType)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listAssetsSBOMs", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List assets SBOMs. + * + *

See {@link #listAssetsSBOMsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListAssetsSBOMsResponse>> + */ + public CompletableFuture> listAssetsSBOMsWithHttpInfoAsync( + ListAssetsSBOMsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listAssetsSBOMs"; + 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; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + AssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterPackageName = parameters.filterPackageName; + String filterPackageVersion = parameters.filterPackageVersion; + String filterLicenseName = parameters.filterLicenseName; + SBOMComponentLicenseType filterLicenseType = parameters.filterLicenseType; + // create path and map variables + String localVarPath = "/api/v2/security/sboms"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_name]", filterPackageName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_version]", filterPackageVersion)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_name]", filterLicenseName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_type]", filterLicenseType)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listAssetsSBOMs", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to listFindings. */ public static class ListFindingsOptionalParameters { private Long pageLimit; @@ -6855,6 +7190,7 @@ public static class ListVulnerabilitiesOptionalParameters { private String filterCodeLocationMethod; private Boolean filterFixAvailable; private String filterRepoDigests; + private String filterOrigin; private String filterAssetName; private AssetType filterAssetType; private String filterAssetVersionFirst; @@ -6866,6 +7202,7 @@ public static class ListVulnerabilitiesOptionalParameters { private Boolean filterAssetRisksHasPrivilegedAccess; private Boolean filterAssetRisksHasAccessToSensitiveData; private String filterAssetEnvironments; + private String filterAssetTeams; private String filterAssetArch; private String filterAssetOperatingSystemName; private String filterAssetOperatingSystemVersion; @@ -7176,6 +7513,17 @@ public ListVulnerabilitiesOptionalParameters filterRepoDigests(String filterRepo return this; } + /** + * Set filterOrigin. + * + * @param filterOrigin Filter by origin. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterOrigin(String filterOrigin) { + this.filterOrigin = filterOrigin; + return this; + } + /** * Set filterAssetName. * @@ -7314,6 +7662,17 @@ public ListVulnerabilitiesOptionalParameters filterAssetEnvironments( return this; } + /** + * Set filterAssetTeams. + * + * @param filterAssetTeams Filter by asset teams. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetTeams(String filterAssetTeams) { + this.filterAssetTeams = filterAssetTeams; + return this; + } + /** * Set filterAssetArch. * @@ -7557,6 +7916,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( String filterCodeLocationMethod = parameters.filterCodeLocationMethod; Boolean filterFixAvailable = parameters.filterFixAvailable; String filterRepoDigests = parameters.filterRepoDigests; + String filterOrigin = parameters.filterOrigin; String filterAssetName = parameters.filterAssetName; AssetType filterAssetType = parameters.filterAssetType; String filterAssetVersionFirst = parameters.filterAssetVersionFirst; @@ -7569,6 +7929,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( Boolean filterAssetRisksHasAccessToSensitiveData = parameters.filterAssetRisksHasAccessToSensitiveData; String filterAssetEnvironments = parameters.filterAssetEnvironments; + String filterAssetTeams = parameters.filterAssetTeams; String filterAssetArch = parameters.filterAssetArch; String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; @@ -7630,6 +7991,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[origin]", filterOrigin)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); localVarQueryParams.addAll( @@ -7661,6 +8023,8 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( filterAssetRisksHasAccessToSensitiveData)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.teams]", filterAssetTeams)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); localVarQueryParams.addAll( @@ -7738,6 +8102,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( String filterCodeLocationMethod = parameters.filterCodeLocationMethod; Boolean filterFixAvailable = parameters.filterFixAvailable; String filterRepoDigests = parameters.filterRepoDigests; + String filterOrigin = parameters.filterOrigin; String filterAssetName = parameters.filterAssetName; AssetType filterAssetType = parameters.filterAssetType; String filterAssetVersionFirst = parameters.filterAssetVersionFirst; @@ -7750,6 +8115,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( Boolean filterAssetRisksHasAccessToSensitiveData = parameters.filterAssetRisksHasAccessToSensitiveData; String filterAssetEnvironments = parameters.filterAssetEnvironments; + String filterAssetTeams = parameters.filterAssetTeams; String filterAssetArch = parameters.filterAssetArch; String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; @@ -7811,6 +8177,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[origin]", filterOrigin)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); localVarQueryParams.addAll( @@ -7842,6 +8209,8 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( filterAssetRisksHasAccessToSensitiveData)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.teams]", filterAssetTeams)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); localVarQueryParams.addAll( @@ -7894,6 +8263,7 @@ public static class ListVulnerableAssetsOptionalParameters { private Boolean filterRisksHasPrivilegedAccess; private Boolean filterRisksHasAccessToSensitiveData; private String filterEnvironments; + private String filterTeams; private String filterArch; private String filterOperatingSystemName; private String filterOperatingSystemVersion; @@ -8053,6 +8423,17 @@ public ListVulnerableAssetsOptionalParameters filterEnvironments(String filterEn return this; } + /** + * Set filterTeams. + * + * @param filterTeams Filter by teams. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterTeams(String filterTeams) { + this.filterTeams = filterTeams; + return this; + } + /** * Set filterArch. * @@ -8202,6 +8583,7 @@ public ApiResponse listVulnerableAssetsWithHttpInf Boolean filterRisksHasPrivilegedAccess = parameters.filterRisksHasPrivilegedAccess; Boolean filterRisksHasAccessToSensitiveData = parameters.filterRisksHasAccessToSensitiveData; String filterEnvironments = parameters.filterEnvironments; + String filterTeams = parameters.filterTeams; String filterArch = parameters.filterArch; String filterOperatingSystemName = parameters.filterOperatingSystemName; String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; @@ -8236,6 +8618,7 @@ public ApiResponse listVulnerableAssetsWithHttpInf "", "filter[risks.has_access_to_sensitive_data]", filterRisksHasAccessToSensitiveData)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[environments]", filterEnvironments)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[teams]", filterTeams)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[arch]", filterArch)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[operating_system.name]", filterOperatingSystemName)); @@ -8298,6 +8681,7 @@ public ApiResponse listVulnerableAssetsWithHttpInf Boolean filterRisksHasPrivilegedAccess = parameters.filterRisksHasPrivilegedAccess; Boolean filterRisksHasAccessToSensitiveData = parameters.filterRisksHasAccessToSensitiveData; String filterEnvironments = parameters.filterEnvironments; + String filterTeams = parameters.filterTeams; String filterArch = parameters.filterArch; String filterOperatingSystemName = parameters.filterOperatingSystemName; String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; @@ -8332,6 +8716,7 @@ public ApiResponse listVulnerableAssetsWithHttpInf "", "filter[risks.has_access_to_sensitive_data]", filterRisksHasAccessToSensitiveData)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[environments]", filterEnvironments)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[teams]", filterTeams)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[arch]", filterArch)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[operating_system.name]", filterOperatingSystemName)); diff --git a/src/main/java/com/datadog/api/client/v2/model/AssetAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AssetAttributes.java index 209d8fa1dea..6c93808d8f5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AssetAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/AssetAttributes.java @@ -26,6 +26,7 @@ AssetAttributes.JSON_PROPERTY_NAME, AssetAttributes.JSON_PROPERTY_OPERATING_SYSTEM, AssetAttributes.JSON_PROPERTY_RISKS, + AssetAttributes.JSON_PROPERTY_TEAMS, AssetAttributes.JSON_PROPERTY_TYPE, AssetAttributes.JSON_PROPERTY_VERSION }) @@ -48,6 +49,9 @@ public class AssetAttributes { public static final String JSON_PROPERTY_RISKS = "risks"; private AssetRisks risks; + public static final String JSON_PROPERTY_TEAMS = "teams"; + private List teams = null; + public static final String JSON_PROPERTY_TYPE = "type"; private AssetType type; @@ -179,6 +183,35 @@ public void setRisks(AssetRisks risks) { this.risks = risks; } + public AssetAttributes teams(List teams) { + this.teams = teams; + return this; + } + + public AssetAttributes addTeamsItem(String teamsItem) { + if (this.teams == null) { + this.teams = new ArrayList<>(); + } + this.teams.add(teamsItem); + return this; + } + + /** + * List of teams that own the asset. + * + * @return teams + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTeams() { + return teams; + } + + public void setTeams(List teams) { + this.teams = teams; + } + public AssetAttributes type(AssetType type) { this.type = type; this.unparsed |= !type.isValid(); @@ -286,6 +319,7 @@ public boolean equals(Object o) { && Objects.equals(this.name, assetAttributes.name) && Objects.equals(this.operatingSystem, assetAttributes.operatingSystem) && Objects.equals(this.risks, assetAttributes.risks) + && Objects.equals(this.teams, assetAttributes.teams) && Objects.equals(this.type, assetAttributes.type) && Objects.equals(this.version, assetAttributes.version) && Objects.equals(this.additionalProperties, assetAttributes.additionalProperties); @@ -294,7 +328,15 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - arch, environments, name, operatingSystem, risks, type, version, additionalProperties); + arch, + environments, + name, + operatingSystem, + risks, + teams, + type, + version, + additionalProperties); } @Override @@ -306,6 +348,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); sb.append(" risks: ").append(toIndentedString(risks)).append("\n"); + sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/ListAssetsSBOMsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListAssetsSBOMsResponse.java new file mode 100644 index 00000000000..260860b6efc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListAssetsSBOMsResponse.java @@ -0,0 +1,212 @@ +/* + * 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 expected response schema when listing assets SBOMs. */ +@JsonPropertyOrder({ + ListAssetsSBOMsResponse.JSON_PROPERTY_DATA, + ListAssetsSBOMsResponse.JSON_PROPERTY_LINKS, + ListAssetsSBOMsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListAssetsSBOMsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private Links links; + + public static final String JSON_PROPERTY_META = "meta"; + private Metadata meta; + + public ListAssetsSBOMsResponse() {} + + @JsonCreator + public ListAssetsSBOMsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ListAssetsSBOMsResponse data(List data) { + this.data = data; + for (SBOM item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListAssetsSBOMsResponse addDataItem(SBOM dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of assets SBOMs. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListAssetsSBOMsResponse links(Links links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * The JSON:API links related to pagination. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Links getLinks() { + return links; + } + + public void setLinks(Links links) { + this.links = links; + } + + public ListAssetsSBOMsResponse meta(Metadata meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * The metadata related to this request. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Metadata getMeta() { + return meta; + } + + public void setMeta(Metadata meta) { + this.meta = meta; + } + + /** + * 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 ListAssetsSBOMsResponse + */ + @JsonAnySetter + public ListAssetsSBOMsResponse 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 ListAssetsSBOMsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAssetsSBOMsResponse listAssetsSboMsResponse = (ListAssetsSBOMsResponse) o; + return Objects.equals(this.data, listAssetsSboMsResponse.data) + && Objects.equals(this.links, listAssetsSboMsResponse.links) + && Objects.equals(this.meta, listAssetsSboMsResponse.meta) + && Objects.equals(this.additionalProperties, listAssetsSboMsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAssetsSBOMsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/SBOMAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SBOMAttributes.java index 09c4c73325b..60708da5f4e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SBOMAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMAttributes.java @@ -23,6 +23,7 @@ @JsonPropertyOrder({ SBOMAttributes.JSON_PROPERTY_BOM_FORMAT, SBOMAttributes.JSON_PROPERTY_COMPONENTS, + SBOMAttributes.JSON_PROPERTY_DEPENDENCIES, SBOMAttributes.JSON_PROPERTY_METADATA, SBOMAttributes.JSON_PROPERTY_SERIAL_NUMBER, SBOMAttributes.JSON_PROPERTY_SPEC_VERSION, @@ -38,6 +39,9 @@ public class SBOMAttributes { public static final String JSON_PROPERTY_COMPONENTS = "components"; private List components = new ArrayList<>(); + public static final String JSON_PROPERTY_DEPENDENCIES = "dependencies"; + private List dependencies = new ArrayList<>(); + public static final String JSON_PROPERTY_METADATA = "metadata"; private SBOMMetadata metadata; @@ -57,12 +61,15 @@ public SBOMAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_BOM_FORMAT) String bomFormat, @JsonProperty(required = true, value = JSON_PROPERTY_COMPONENTS) List components, + @JsonProperty(required = true, value = JSON_PROPERTY_DEPENDENCIES) + List dependencies, @JsonProperty(required = true, value = JSON_PROPERTY_METADATA) SBOMMetadata metadata, @JsonProperty(required = true, value = JSON_PROPERTY_SERIAL_NUMBER) String serialNumber, @JsonProperty(required = true, value = JSON_PROPERTY_SPEC_VERSION) SpecVersion specVersion, @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) Long version) { this.bomFormat = bomFormat; this.components = components; + this.dependencies = dependencies; this.metadata = metadata; this.unparsed |= metadata.unparsed; this.serialNumber = serialNumber; @@ -122,6 +129,35 @@ public void setComponents(List components) { this.components = components; } + public SBOMAttributes dependencies(List dependencies) { + this.dependencies = dependencies; + for (SBOMComponentDependency item : dependencies) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SBOMAttributes addDependenciesItem(SBOMComponentDependency dependenciesItem) { + this.dependencies.add(dependenciesItem); + this.unparsed |= dependenciesItem.unparsed; + return this; + } + + /** + * List of dependencies between components of the SBOM. + * + * @return dependencies + */ + @JsonProperty(JSON_PROPERTY_DEPENDENCIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDependencies() { + return dependencies; + } + + public void setDependencies(List dependencies) { + this.dependencies = dependencies; + } + public SBOMAttributes metadata(SBOMMetadata metadata) { this.metadata = metadata; this.unparsed |= metadata.unparsed; @@ -267,6 +303,7 @@ public boolean equals(Object o) { SBOMAttributes sbomAttributes = (SBOMAttributes) o; return Objects.equals(this.bomFormat, sbomAttributes.bomFormat) && Objects.equals(this.components, sbomAttributes.components) + && Objects.equals(this.dependencies, sbomAttributes.dependencies) && Objects.equals(this.metadata, sbomAttributes.metadata) && Objects.equals(this.serialNumber, sbomAttributes.serialNumber) && Objects.equals(this.specVersion, sbomAttributes.specVersion) @@ -277,7 +314,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - bomFormat, components, metadata, serialNumber, specVersion, version, additionalProperties); + bomFormat, + components, + dependencies, + metadata, + serialNumber, + specVersion, + version, + additionalProperties); } @Override @@ -286,6 +330,7 @@ public String toString() { sb.append("class SBOMAttributes {\n"); sb.append(" bomFormat: ").append(toIndentedString(bomFormat)).append("\n"); sb.append(" components: ").append(toIndentedString(components)).append("\n"); + sb.append(" dependencies: ").append(toIndentedString(dependencies)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); sb.append(" specVersion: ").append(toIndentedString(specVersion)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SBOMComponent.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponent.java index 80b14232a86..b5f07f8d92e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SBOMComponent.java +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponent.java @@ -13,15 +13,20 @@ 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; /** Software or hardware component. */ @JsonPropertyOrder({ SBOMComponent.JSON_PROPERTY_BOM_REF, + SBOMComponent.JSON_PROPERTY_LICENSES, SBOMComponent.JSON_PROPERTY_NAME, + SBOMComponent.JSON_PROPERTY_PROPERTIES, SBOMComponent.JSON_PROPERTY_PURL, + SBOMComponent.JSON_PROPERTY_SUPPLIER, SBOMComponent.JSON_PROPERTY_TYPE, SBOMComponent.JSON_PROPERTY_VERSION }) @@ -32,12 +37,21 @@ public class SBOMComponent { public static final String JSON_PROPERTY_BOM_REF = "bom-ref"; private String bomRef; + public static final String JSON_PROPERTY_LICENSES = "licenses"; + private List licenses = null; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + private List properties = null; + public static final String JSON_PROPERTY_PURL = "purl"; private String purl; + public static final String JSON_PROPERTY_SUPPLIER = "supplier"; + private SBOMComponentSupplier supplier; + public static final String JSON_PROPERTY_TYPE = "type"; private SBOMComponentType type; @@ -49,9 +63,12 @@ public SBOMComponent() {} @JsonCreator public SBOMComponent( @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SUPPLIER) SBOMComponentSupplier supplier, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SBOMComponentType type, @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) String version) { this.name = name; + this.supplier = supplier; + this.unparsed |= supplier.unparsed; this.type = type; this.unparsed |= !type.isValid(); this.version = version; @@ -78,6 +95,39 @@ public void setBomRef(String bomRef) { this.bomRef = bomRef; } + public SBOMComponent licenses(List licenses) { + this.licenses = licenses; + for (SBOMComponentLicense item : licenses) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SBOMComponent addLicensesItem(SBOMComponentLicense licensesItem) { + if (this.licenses == null) { + this.licenses = new ArrayList<>(); + } + this.licenses.add(licensesItem); + this.unparsed |= licensesItem.unparsed; + return this; + } + + /** + * The software licenses of the SBOM component. + * + * @return licenses + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LICENSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLicenses() { + return licenses; + } + + public void setLicenses(List licenses) { + this.licenses = licenses; + } + public SBOMComponent name(String name) { this.name = name; return this; @@ -98,6 +148,39 @@ public void setName(String name) { this.name = name; } + public SBOMComponent properties(List properties) { + this.properties = properties; + for (SBOMComponentProperty item : properties) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SBOMComponent addPropertiesItem(SBOMComponentProperty propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + this.unparsed |= propertiesItem.unparsed; + return this; + } + + /** + * The custom properties of the component of the SBOM. + * + * @return properties + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProperties() { + return properties; + } + + public void setProperties(List properties) { + this.properties = properties; + } + public SBOMComponent purl(String purl) { this.purl = purl; return this; @@ -120,6 +203,27 @@ public void setPurl(String purl) { this.purl = purl; } + public SBOMComponent supplier(SBOMComponentSupplier supplier) { + this.supplier = supplier; + this.unparsed |= supplier.unparsed; + return this; + } + + /** + * The supplier of the component. + * + * @return supplier + */ + @JsonProperty(JSON_PROPERTY_SUPPLIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SBOMComponentSupplier getSupplier() { + return supplier; + } + + public void setSupplier(SBOMComponentSupplier supplier) { + this.supplier = supplier; + } + public SBOMComponent type(SBOMComponentType type) { this.type = type; this.unparsed |= !type.isValid(); @@ -221,8 +325,11 @@ public boolean equals(Object o) { } SBOMComponent sbomComponent = (SBOMComponent) o; return Objects.equals(this.bomRef, sbomComponent.bomRef) + && Objects.equals(this.licenses, sbomComponent.licenses) && Objects.equals(this.name, sbomComponent.name) + && Objects.equals(this.properties, sbomComponent.properties) && Objects.equals(this.purl, sbomComponent.purl) + && Objects.equals(this.supplier, sbomComponent.supplier) && Objects.equals(this.type, sbomComponent.type) && Objects.equals(this.version, sbomComponent.version) && Objects.equals(this.additionalProperties, sbomComponent.additionalProperties); @@ -230,7 +337,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(bomRef, name, purl, type, version, additionalProperties); + return Objects.hash( + bomRef, licenses, name, properties, purl, supplier, type, version, additionalProperties); } @Override @@ -238,8 +346,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SBOMComponent {\n"); sb.append(" bomRef: ").append(toIndentedString(bomRef)).append("\n"); + sb.append(" licenses: ").append(toIndentedString(licenses)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append(" purl: ").append(toIndentedString(purl)).append("\n"); + sb.append(" supplier: ").append(toIndentedString(supplier)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/SBOMComponentDependency.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentDependency.java new file mode 100644 index 00000000000..80141714ee9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentDependency.java @@ -0,0 +1,174 @@ +/* + * 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 dependencies of a component of the SBOM. */ +@JsonPropertyOrder({ + SBOMComponentDependency.JSON_PROPERTY_DEPENDS_ON, + SBOMComponentDependency.JSON_PROPERTY_REF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SBOMComponentDependency { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEPENDS_ON = "dependsOn"; + private List dependsOn = null; + + public static final String JSON_PROPERTY_REF = "ref"; + private String ref; + + public SBOMComponentDependency dependsOn(List dependsOn) { + this.dependsOn = dependsOn; + return this; + } + + public SBOMComponentDependency addDependsOnItem(String dependsOnItem) { + if (this.dependsOn == null) { + this.dependsOn = new ArrayList<>(); + } + this.dependsOn.add(dependsOnItem); + return this; + } + + /** + * The components that are dependencies of the ref component. + * + * @return dependsOn + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEPENDS_ON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDependsOn() { + return dependsOn; + } + + public void setDependsOn(List dependsOn) { + this.dependsOn = dependsOn; + } + + public SBOMComponentDependency ref(String ref) { + this.ref = ref; + return this; + } + + /** + * The identifier for the related component. + * + * @return ref + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + /** + * 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 SBOMComponentDependency + */ + @JsonAnySetter + public SBOMComponentDependency 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 SBOMComponentDependency object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SBOMComponentDependency sbomComponentDependency = (SBOMComponentDependency) o; + return Objects.equals(this.dependsOn, sbomComponentDependency.dependsOn) + && Objects.equals(this.ref, sbomComponentDependency.ref) + && Objects.equals(this.additionalProperties, sbomComponentDependency.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dependsOn, ref, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SBOMComponentDependency {\n"); + sb.append(" dependsOn: ").append(toIndentedString(dependsOn)).append("\n"); + sb.append(" ref: ").append(toIndentedString(ref)).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/SBOMComponentLicense.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicense.java new file mode 100644 index 00000000000..288087306e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicense.java @@ -0,0 +1,146 @@ +/* + * 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 software license of the component of the SBOM. */ +@JsonPropertyOrder({SBOMComponentLicense.JSON_PROPERTY_LICENSE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SBOMComponentLicense { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LICENSE = "license"; + private SBOMComponentLicenseLicense license; + + public SBOMComponentLicense() {} + + @JsonCreator + public SBOMComponentLicense( + @JsonProperty(required = true, value = JSON_PROPERTY_LICENSE) + SBOMComponentLicenseLicense license) { + this.license = license; + this.unparsed |= license.unparsed; + } + + public SBOMComponentLicense license(SBOMComponentLicenseLicense license) { + this.license = license; + this.unparsed |= license.unparsed; + return this; + } + + /** + * The software license of the component of the SBOM. + * + * @return license + */ + @JsonProperty(JSON_PROPERTY_LICENSE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SBOMComponentLicenseLicense getLicense() { + return license; + } + + public void setLicense(SBOMComponentLicenseLicense license) { + this.license = license; + } + + /** + * 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 SBOMComponentLicense + */ + @JsonAnySetter + public SBOMComponentLicense 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 SBOMComponentLicense object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SBOMComponentLicense sbomComponentLicense = (SBOMComponentLicense) o; + return Objects.equals(this.license, sbomComponentLicense.license) + && Objects.equals(this.additionalProperties, sbomComponentLicense.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(license, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SBOMComponentLicense {\n"); + sb.append(" license: ").append(toIndentedString(license)).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/SBOMComponentLicenseLicense.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicenseLicense.java new file mode 100644 index 00000000000..834e45d26c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicenseLicense.java @@ -0,0 +1,144 @@ +/* + * 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 software license of the component of the SBOM. */ +@JsonPropertyOrder({SBOMComponentLicenseLicense.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SBOMComponentLicenseLicense { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SBOMComponentLicenseLicense() {} + + @JsonCreator + public SBOMComponentLicenseLicense( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public SBOMComponentLicenseLicense name(String name) { + this.name = name; + return this; + } + + /** + * The name of the software license of the component of the SBOM. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SBOMComponentLicenseLicense + */ + @JsonAnySetter + public SBOMComponentLicenseLicense 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 SBOMComponentLicenseLicense object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SBOMComponentLicenseLicense sbomComponentLicenseLicense = (SBOMComponentLicenseLicense) o; + return Objects.equals(this.name, sbomComponentLicenseLicense.name) + && Objects.equals( + this.additionalProperties, sbomComponentLicenseLicense.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SBOMComponentLicenseLicense {\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/SBOMComponentLicenseType.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicenseType.java new file mode 100644 index 00000000000..a9f91041687 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentLicenseType.java @@ -0,0 +1,80 @@ +/* + * 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; + +/** The SBOM component license type. */ +@JsonSerialize(using = SBOMComponentLicenseType.SBOMComponentLicenseTypeSerializer.class) +public class SBOMComponentLicenseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "network_strong_copyleft", + "non_standard_copyleft", + "other_non_free", + "other_non_standard", + "permissive", + "public_domain", + "strong_copyleft", + "weak_copyleft")); + + public static final SBOMComponentLicenseType NETWORK_STRONG_COPYLEFT = + new SBOMComponentLicenseType("network_strong_copyleft"); + public static final SBOMComponentLicenseType NON_STANDARD_COPYLEFT = + new SBOMComponentLicenseType("non_standard_copyleft"); + public static final SBOMComponentLicenseType OTHER_NON_FREE = + new SBOMComponentLicenseType("other_non_free"); + public static final SBOMComponentLicenseType OTHER_NON_STANDARD = + new SBOMComponentLicenseType("other_non_standard"); + public static final SBOMComponentLicenseType PERMISSIVE = + new SBOMComponentLicenseType("permissive"); + public static final SBOMComponentLicenseType PUBLIC_DOMAIN = + new SBOMComponentLicenseType("public_domain"); + public static final SBOMComponentLicenseType STRONG_COPYLEFT = + new SBOMComponentLicenseType("strong_copyleft"); + public static final SBOMComponentLicenseType WEAK_COPYLEFT = + new SBOMComponentLicenseType("weak_copyleft"); + + SBOMComponentLicenseType(String value) { + super(value, allowedValues); + } + + public static class SBOMComponentLicenseTypeSerializer + extends StdSerializer { + public SBOMComponentLicenseTypeSerializer(Class t) { + super(t); + } + + public SBOMComponentLicenseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SBOMComponentLicenseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SBOMComponentLicenseType fromValue(String value) { + return new SBOMComponentLicenseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SBOMComponentProperty.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentProperty.java new file mode 100644 index 00000000000..71f05988488 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentProperty.java @@ -0,0 +1,173 @@ +/* + * 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 custom property of the component of the SBOM. */ +@JsonPropertyOrder({ + SBOMComponentProperty.JSON_PROPERTY_NAME, + SBOMComponentProperty.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SBOMComponentProperty { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SBOMComponentProperty() {} + + @JsonCreator + public SBOMComponentProperty( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.name = name; + this.value = value; + } + + public SBOMComponentProperty name(String name) { + this.name = name; + return this; + } + + /** + * The name of the custom property of the component of the SBOM. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SBOMComponentProperty value(String value) { + this.value = value; + return this; + } + + /** + * The value of the custom property of the component of the SBOM. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * 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 SBOMComponentProperty + */ + @JsonAnySetter + public SBOMComponentProperty 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 SBOMComponentProperty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SBOMComponentProperty sbomComponentProperty = (SBOMComponentProperty) o; + return Objects.equals(this.name, sbomComponentProperty.name) + && Objects.equals(this.value, sbomComponentProperty.value) + && Objects.equals(this.additionalProperties, sbomComponentProperty.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SBOMComponentProperty {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/SBOMComponentSupplier.java b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentSupplier.java new file mode 100644 index 00000000000..c5ba03ed8c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMComponentSupplier.java @@ -0,0 +1,143 @@ +/* + * 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 supplier of the component. */ +@JsonPropertyOrder({SBOMComponentSupplier.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SBOMComponentSupplier { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SBOMComponentSupplier() {} + + @JsonCreator + public SBOMComponentSupplier( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public SBOMComponentSupplier name(String name) { + this.name = name; + return this; + } + + /** + * Identifier of the supplier of the component. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SBOMComponentSupplier + */ + @JsonAnySetter + public SBOMComponentSupplier 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 SBOMComponentSupplier object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SBOMComponentSupplier sbomComponentSupplier = (SBOMComponentSupplier) o; + return Objects.equals(this.name, sbomComponentSupplier.name) + && Objects.equals(this.additionalProperties, sbomComponentSupplier.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SBOMComponentSupplier {\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/SBOMMetadata.java b/src/main/java/com/datadog/api/client/v2/model/SBOMMetadata.java index 048bea46911..5862b9276c8 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SBOMMetadata.java +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMMetadata.java @@ -12,19 +12,64 @@ 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; /** Provides additional information about a BOM. */ -@JsonPropertyOrder({SBOMMetadata.JSON_PROPERTY_COMPONENT}) +@JsonPropertyOrder({ + SBOMMetadata.JSON_PROPERTY_AUTHORS, + SBOMMetadata.JSON_PROPERTY_COMPONENT, + SBOMMetadata.JSON_PROPERTY_TIMESTAMP +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class SBOMMetadata { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHORS = "authors"; + private List authors = null; + public static final String JSON_PROPERTY_COMPONENT = "component"; private SBOMMetadataComponent component; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private String timestamp; + + public SBOMMetadata authors(List authors) { + this.authors = authors; + for (SBOMMetadataAuthor item : authors) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SBOMMetadata addAuthorsItem(SBOMMetadataAuthor authorsItem) { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + this.authors.add(authorsItem); + this.unparsed |= authorsItem.unparsed; + return this; + } + + /** + * List of authors of the SBOM. + * + * @return authors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAuthors() { + return authors; + } + + public void setAuthors(List authors) { + this.authors = authors; + } + public SBOMMetadata component(SBOMMetadataComponent component) { this.component = component; this.unparsed |= component.unparsed; @@ -47,6 +92,27 @@ public void setComponent(SBOMMetadataComponent component) { this.component = component; } + public SBOMMetadata timestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * The timestamp of the SBOM creation. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -103,20 +169,24 @@ public boolean equals(Object o) { return false; } SBOMMetadata sbomMetadata = (SBOMMetadata) o; - return Objects.equals(this.component, sbomMetadata.component) + return Objects.equals(this.authors, sbomMetadata.authors) + && Objects.equals(this.component, sbomMetadata.component) + && Objects.equals(this.timestamp, sbomMetadata.timestamp) && Objects.equals(this.additionalProperties, sbomMetadata.additionalProperties); } @Override public int hashCode() { - return Objects.hash(component, additionalProperties); + return Objects.hash(authors, component, timestamp, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SBOMMetadata {\n"); + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); sb.append(" component: ").append(toIndentedString(component)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SBOMMetadataAuthor.java b/src/main/java/com/datadog/api/client/v2/model/SBOMMetadataAuthor.java new file mode 100644 index 00000000000..4625a42b7db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMMetadataAuthor.java @@ -0,0 +1,135 @@ +/* + * 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; + +/** Author of the SBOM. */ +@JsonPropertyOrder({SBOMMetadataAuthor.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SBOMMetadataAuthor { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SBOMMetadataAuthor name(String name) { + this.name = name; + return this; + } + + /** + * The identifier of the Author of the SBOM. + * + * @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 SBOMMetadataAuthor + */ + @JsonAnySetter + public SBOMMetadataAuthor 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 SBOMMetadataAuthor object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SBOMMetadataAuthor sbomMetadataAuthor = (SBOMMetadataAuthor) o; + return Objects.equals(this.name, sbomMetadataAuthor.name) + && Objects.equals(this.additionalProperties, sbomMetadataAuthor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SBOMMetadataAuthor {\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/VulnerabilityAttributes.java b/src/main/java/com/datadog/api/client/v2/model/VulnerabilityAttributes.java index 2c7f6b4bacc..bb1c40dd5aa 100644 --- a/src/main/java/com/datadog/api/client/v2/model/VulnerabilityAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/VulnerabilityAttributes.java @@ -34,6 +34,7 @@ VulnerabilityAttributes.JSON_PROPERTY_LANGUAGE, VulnerabilityAttributes.JSON_PROPERTY_LAST_DETECTION, VulnerabilityAttributes.JSON_PROPERTY_LIBRARY, + VulnerabilityAttributes.JSON_PROPERTY_ORIGIN, VulnerabilityAttributes.JSON_PROPERTY_REMEDIATIONS, VulnerabilityAttributes.JSON_PROPERTY_REPO_DIGESTS, VulnerabilityAttributes.JSON_PROPERTY_RISKS, @@ -85,6 +86,9 @@ public class VulnerabilityAttributes { public static final String JSON_PROPERTY_LIBRARY = "library"; private Library library; + public static final String JSON_PROPERTY_ORIGIN = "origin"; + private List origin = new ArrayList<>(); + public static final String JSON_PROPERTY_REMEDIATIONS = "remediations"; private List remediations = new ArrayList<>(); @@ -118,6 +122,7 @@ public VulnerabilityAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_FIX_AVAILABLE) Boolean fixAvailable, @JsonProperty(required = true, value = JSON_PROPERTY_LANGUAGE) String language, @JsonProperty(required = true, value = JSON_PROPERTY_LAST_DETECTION) String lastDetection, + @JsonProperty(required = true, value = JSON_PROPERTY_ORIGIN) List origin, @JsonProperty(required = true, value = JSON_PROPERTY_REMEDIATIONS) List remediations, @JsonProperty(required = true, value = JSON_PROPERTY_RISKS) VulnerabilityRisks risks, @@ -134,6 +139,7 @@ public VulnerabilityAttributes( this.fixAvailable = fixAvailable; this.language = language; this.lastDetection = lastDetection; + this.origin = origin; this.remediations = remediations; this.risks = risks; this.unparsed |= risks.unparsed; @@ -427,6 +433,31 @@ public void setLibrary(Library library) { this.library = library; } + public VulnerabilityAttributes origin(List origin) { + this.origin = origin; + return this; + } + + public VulnerabilityAttributes addOriginItem(String originItem) { + this.origin.add(originItem); + return this; + } + + /** + * Vulnerability origin. + * + * @return origin + */ + @JsonProperty(JSON_PROPERTY_ORIGIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getOrigin() { + return origin; + } + + public void setOrigin(List origin) { + this.origin = origin; + } + public VulnerabilityAttributes remediations(List remediations) { this.remediations = remediations; for (Remediation item : remediations) { @@ -668,6 +699,7 @@ public boolean equals(Object o) { && Objects.equals(this.language, vulnerabilityAttributes.language) && Objects.equals(this.lastDetection, vulnerabilityAttributes.lastDetection) && Objects.equals(this.library, vulnerabilityAttributes.library) + && Objects.equals(this.origin, vulnerabilityAttributes.origin) && Objects.equals(this.remediations, vulnerabilityAttributes.remediations) && Objects.equals(this.repoDigests, vulnerabilityAttributes.repoDigests) && Objects.equals(this.risks, vulnerabilityAttributes.risks) @@ -694,6 +726,7 @@ public int hashCode() { language, lastDetection, library, + origin, remediations, repoDigests, risks, @@ -723,6 +756,7 @@ public String toString() { sb.append(" language: ").append(toIndentedString(language)).append("\n"); sb.append(" lastDetection: ").append(toIndentedString(lastDetection)).append("\n"); sb.append(" library: ").append(toIndentedString(library)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); sb.append(" remediations: ").append(toIndentedString(remediations)).append("\n"); sb.append(" repoDigests: ").append(toIndentedString(repoDigests)).append("\n"); sb.append(" risks: ").append(toIndentedString(risks)).append("\n"); diff --git a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze new file mode 100644 index 00000000000..69173438991 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze @@ -0,0 +1 @@ +2025-07-10T10:13:27.247Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json new file mode 100644 index 00000000000..e73a3b66be6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json @@ -0,0 +1,36 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/sboms", + "queryStringParameters": { + "page[token]": [ + "unknown" + ], + "page[number]": [ + "1" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Unexpected internal error\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5eb3b8f5-3dd3-195c-e37e-46f12fa2d7a1" + } +] \ 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 new file mode 100644 index 00000000000..c142d99dc72 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-07-10T10:11:37.540Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.json new file mode 100644 index 00000000000..483e683ea83 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_assets_SBOMs_returns_OK_response.json @@ -0,0 +1,36 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/sboms", + "queryStringParameters": { + "filter[package_name]": [ + "pandas" + ], + "filter[asset_type]": [ + "Service" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "67c98f91-9484-e27e-305e-0345c9286a17" + } +] \ 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 21524e249a1..1ec6ed14e58 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 @@ -818,6 +818,38 @@ Feature: Security Monitoring 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 + 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 + And new "ListAssetsSBOMs" request + And request contains "page[token]" parameter with value "unknown" + And request contains "page[number]" parameter with value 1 + When the request is sent + Then the response status is 404 Not found: There is no request associated with the provided token. + + @generated @skip @team:DataDog/asm-vm + Scenario: List assets SBOMs returns "Not found: asset not found" response + Given 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 + And new "ListAssetsSBOMs" request + And request contains "filter[package_name]" parameter with value "pandas" + And request contains "filter[asset_type]" parameter with value "Service" + When the request is sent + Then the response status is 200 OK + @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 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 b93f6b777af..5b4f718bb95 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 @@ -2730,6 +2730,12 @@ "type": "safe" } }, + "ListAssetsSBOMs": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetSBOM": { "tag": "Security Monitoring", "undo": {