From a3edfc3c0241271418a01f3ac35335734cda61f7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 16 Oct 2025 10:06:51 +0000 Subject: [PATCH] Regenerate client from commit 0050b10 of spec repo --- .generator/schemas/v2/openapi.yaml | 671 ++++++++++++------ .../ListScannedAssetsMetadata.java | 25 + .../com/datadog/api/client/ApiClient.java | 1 + .../client/v2/api/SecurityMonitoringApi.java | 381 +++++++++- .../api/client/v2/model/CloudAssetType.java | 56 ++ .../api/client/v2/model/SBOMFormat.java | 55 ++ .../client/v2/model/ScannedAssetMetadata.java | 176 +++++ .../v2/model/ScannedAssetMetadataAsset.java | 179 +++++ .../model/ScannedAssetMetadataAttributes.java | 212 ++++++ .../ScannedAssetMetadataLastSuccess.java | 211 ++++++ .../v2/model/ScannedAssetsMetadata.java | 212 ++++++ .../v2/model/VulnerabilityAdvisory.java | 200 ++++++ .../v2/model/VulnerabilityAttributes.java | 31 +- ..._Not_found_asset_not_found_response.freeze | 1 + ...ns_Not_found_asset_not_found_response.json | 36 + ...assets_metadata_returns_OK_response.freeze | 1 + ...d_assets_metadata_returns_OK_response.json | 28 + ...ed_with_the_provided_token_response.freeze | 2 +- ...ated_with_the_provided_token_response.json | 6 +- ...lnerable_assets_returns_OK_response.freeze | 2 +- ...vulnerable_assets_returns_OK_response.json | 4 +- .../client/v2/api/security_monitoring.feature | 23 + .../com/datadog/api/client/v2/api/undo.json | 18 +- 23 files changed, 2301 insertions(+), 230 deletions(-) create mode 100644 examples/v2/security-monitoring/ListScannedAssetsMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CloudAssetType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SBOMFormat.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAsset.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataLastSuccess.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ScannedAssetsMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/VulnerabilityAdvisory.java create mode 100644 src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9f43840f754..0d0a0d67f3d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9188,6 +9188,18 @@ components: required: - type type: object + CloudAssetType: + description: The cloud asset type + enum: + - Host + - HostImage + - Image + example: Host + type: string + x-enum-varnames: + - HOST + - HOST_IMAGE + - IMAGE CloudConfigurationComplianceRuleOptions: additionalProperties: {} description: 'Options for cloud_configuration rules. @@ -41130,6 +41142,16 @@ components: - MACHINE_LEARNING_MODEL - OPERATING_SYSTEM - PLATFORM + SBOMFormat: + description: The SBOM standard + enum: + - CycloneDX + - SPDX + example: CycloneDX + type: string + x-enum-varnames: + - CYCLONEDX + - SPDX SBOMMetadata: description: Provides additional information about a BOM. properties: @@ -41395,6 +41417,86 @@ components: type: $ref: '#/components/schemas/ScalarFormulaResponseType' type: object + ScannedAssetMetadata: + description: The metadata of a scanned asset. + properties: + attributes: + $ref: '#/components/schemas/ScannedAssetMetadataAttributes' + id: + description: The ID of the scanned asset metadata. + example: Host|i-0fc7edef1ab26d7ef + type: string + required: + - id + - attributes + type: object + ScannedAssetMetadataAsset: + description: The asset of a scanned asset metadata. + properties: + name: + description: The name of the asset. + example: i-0fc7edef1ab26d7ef + type: string + type: + $ref: '#/components/schemas/CloudAssetType' + required: + - type + - name + type: object + ScannedAssetMetadataAttributes: + description: The attributes of a scanned asset metadata. + properties: + asset: + $ref: '#/components/schemas/ScannedAssetMetadataAsset' + first_success_timestamp: + description: The timestamp when the scan of the asset was performed for + the first time. + example: '2025-07-08T07:24:53Z' + type: string + last_success: + $ref: '#/components/schemas/ScannedAssetMetadataLastSuccess' + required: + - asset + - last_success + - first_success_timestamp + type: object + ScannedAssetMetadataLastSuccess: + description: Metadata for the last successful scan of an asset. + properties: + env: + description: The environment of the last success scan of the asset. + example: prod + type: string + origin: + description: The list of origins of the last success scan of the asset. + example: + - production + items: + example: production + type: string + type: array + timestamp: + description: The timestamp of the last success scan of the asset. + example: '2025-07-08T07:24:53Z' + type: string + required: + - timestamp + type: object + ScannedAssetsMetadata: + description: The expected response schema when listing scanned assets metadata. + properties: + data: + description: List of scanned assets metadata. + items: + $ref: '#/components/schemas/ScannedAssetMetadata' + type: array + links: + $ref: '#/components/schemas/Links' + meta: + $ref: '#/components/schemas/Metadata' + required: + - data + type: object Schedule: description: Top-level container for a schedule object, including both the `data` payload and any related `included` resources (such as teams, layers, or members). @@ -51590,9 +51692,29 @@ components: - attributes - relationships type: object + VulnerabilityAdvisory: + description: Advisory associated with the vulnerability. + properties: + id: + description: Vulnerability advisory ID. + example: TRIVY-CVE-2023-0615 + type: string + last_modification_date: + description: Vulnerability advisory last modification date. + example: 2024-09-19 21:23:08+00:00 + type: string + publish_date: + description: Vulnerability advisory publish date. + example: 2024-09-19 21:23:08+00:00 + type: string + required: + - id + type: object VulnerabilityAttributes: description: The JSON:API attributes of the vulnerability. properties: + advisory: + $ref: '#/components/schemas/VulnerabilityAdvisory' advisory_id: description: Vulnerability advisory ID. example: TRIVY-CVE-2023-0615 @@ -71238,194 +71360,6 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/security/assets: - get: - description: 'Get a list of vulnerable assets. - - - ### Pagination - - - Please review the [Pagination section for the "List Vulnerabilities"](#pagination) - endpoint. - - - ### Filtering - - - Please review the [Filtering section for the "List Vulnerabilities"](#filtering) - endpoint. - - - ### Metadata - - - Please review the [Metadata section for the "List Vulnerabilities"](#metadata) - endpoint.' - operationId: ListVulnerableAssets - 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 or greater - than `1` - example: 1 - in: query - name: page[number] - required: false - schema: - format: int64 - minimum: 1 - type: integer - - description: Filter by name. - example: datadog-agent - in: query - name: filter[name] - required: false - schema: - type: string - - description: Filter by type. - example: Host - in: query - name: filter[type] - required: false - schema: - $ref: '#/components/schemas/AssetType' - - description: Filter by the first version of the asset since it has been vulnerable. - example: v1.15.1 - in: query - name: filter[version.first] - required: false - schema: - type: string - - description: Filter by the last detected version of the asset. - example: v1.15.1 - in: query - name: filter[version.last] - required: false - schema: - type: string - - description: Filter by the repository url associated to the asset. - example: github.com/DataDog/datadog-agent.git - in: query - name: filter[repository_url] - required: false - schema: - type: string - - description: Filter whether the asset is in production or not. - example: false - in: query - name: filter[risks.in_production] - required: false - schema: - type: boolean - - description: Filter whether the asset (Service) is under attack or not. - example: false - in: query - name: filter[risks.under_attack] - required: false - schema: - type: boolean - - description: Filter whether the asset (Host) is publicly accessible or not. - example: false - in: query - name: filter[risks.is_publicly_accessible] - required: false - schema: - type: boolean - - description: Filter whether the asset (Host) has privileged access or not. - example: false - in: query - name: filter[risks.has_privileged_access] - required: false - schema: - type: boolean - - description: Filter whether the asset (Host) has access to sensitive data - or not. - example: false - in: query - name: filter[risks.has_access_to_sensitive_data] - required: false - schema: - type: boolean - - description: Filter by environment. - example: staging - in: query - name: filter[environments] - 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 - name: filter[arch] - required: false - schema: - type: string - - description: Filter by operating system name. - example: ubuntu - in: query - name: filter[operating_system.name] - required: false - schema: - type: string - - description: Filter by operating system version. - example: '24.04' - in: query - name: filter[operating_system.version] - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListVulnerableAssetsResponse' - 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: There is no request associated with the provided - token.' - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List vulnerable assets - 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/cloud_workload/policy/download: get: description: 'The download endpoint generates a Workload Protection policy file @@ -71610,6 +71544,13 @@ paths: required: false schema: type: string + - description: The standard of the SBOM. + example: CycloneDX + in: query + name: ext:format + required: false + schema: + $ref: '#/components/schemas/SBOMFormat' responses: '200': content: @@ -71647,6 +71588,120 @@ paths: 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/scanned-assets-metadata: + get: + description: "Get a list of security scanned assets metadata for an organization.\n\n### + Pagination\n\nFor the \"List Vulnerabilities\" endpoint, see the [Pagination + section](#pagination).\n\n### Filtering\n\nFor the \"List Vulnerabilities\" + endpoint, see the [Filtering section](#filtering).\n\n### Metadata\n\n For + the \"List Vulnerabilities\" endpoint, see the [Metadata section](#metadata).\n\n### + Related endpoints\n\nThis endpoint returns additional metadata for cloud resources + that is not available from the standard resource endpoints. To access a richer + dataset, call this endpoint together with the relevant resource endpoint(s) + and merge (join) their results using the resource identifier.\n\n**Hosts**\n\nTo + enrich host data, join the response from the [Hosts](https://docs.datadoghq.com/api/latest/hosts/) + endpoint with the response from the scanned-assets-metadata endpoint on the + following key fields:\n\n| ENDPOINT | JOIN KEY | TYPE |\n| --- | --- | --- + |\n| [/api/v1/hosts](https://docs.datadoghq.com/api/latest/hosts/) | host_list.host_name + | string |\n| /api/v2/security/scanned-assets-metadata | data.attributes.asset.name + | string |\n\n**Host Images**\n\nTo enrich host image data, join the response + from the [Hosts](https://docs.datadoghq.com/api/latest/hosts/) endpoint with + the response from the scanned-assets-metadata endpoint on the following key + fields:\n\n| ENDPOINT | JOIN KEY | TYPE |\n| --- | --- | --- |\n| [/api/v1/hosts](https://docs.datadoghq.com/api/latest/hosts/) + | host_list.tags_by_source[\"Amazon Web Services\"][\"image\"] | string |\n| + /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string + |\n\n**Container Images**\n\nTo enrich container image data, join the response + from the [Container Images](https://docs.datadoghq.com/api/latest/container-images/) + endpoint with the response from the scanned-assets-metadata endpoint on the + following key fields:\n\n| ENDPOINT | JOIN KEY | TYPE |\n| --- | --- | --- + |\n| [/api/v2/container_images](https://docs.datadoghq.com/api/latest/container-images/) + | `data.attributes.name`@`data.attributes.repo_digest` | string |\n| /api/v2/security/scanned-assets-metadata + | data.attributes.asset.name | string |" + operationId: ListScannedAssetsMetadata + 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 scanned asset. + example: Host + in: query + name: filter[asset.type] + required: false + schema: + $ref: '#/components/schemas/CloudAssetType' + - description: The name of the scanned asset. + example: i-0fc7edef1ab26d7ef + in: query + name: filter[asset.name] + required: false + schema: + type: string + - description: The origin of last success scan. + example: agent + in: query + name: filter[last_success.origin] + required: false + schema: + type: string + - description: The environment of last success scan. + example: prod + in: query + name: filter[last_success.env] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ScannedAssetsMetadata' + 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: [] + summary: List scanned assets metadata + 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/signals/notification_rules: get: description: Returns the list of notification rules for security signals. @@ -71837,27 +71892,34 @@ paths: consider a request to be the first request when there is no `page[token]` parameter.\n\nThe response of this first request contains the newly created token in the `links` section.\n\nThis token can then be used in the subsequent - paginated requests.\n\n#### Subsequent requests\n\nAny request containing + paginated requests.\n\n*Note: The first request may take longer to complete + than subsequent requests.*\n\n#### Subsequent requests\n\nAny request containing valid `page[token]` and `page[number]` parameters will be considered a subsequent request.\n\nIf the `token` is invalid, a `404` response will be returned.\n\nIf - the page `number` is invalid, a `400` response will be returned.\n\n### Filtering\n\nThe - request can include some filter parameters to filter the data to be retrieved. - The format of the filter parameters follows the [JSON:API format](https://jsonapi.org/format/#fetching-filtering): - `filter[$prop_name]`, where `prop_name` is the property name in the entity - being filtered by.\n\nAll filters can include multiple values, where data - will be filtered with an OR clause: `filter[title]=Title1,Title2` will filter - all vulnerabilities where title is equal to `Title1` OR `Title2`.\n\nString - filters are case sensitive.\n\nBoolean filters accept `true` or `false` as - values.\n\nNumber filters must include an operator as a second filter input: - `filter[$prop_name][$operator]`. For example, for the vulnerabilities endpoint: - `filter[cvss.base.score][lte]=8`.\n\nAvailable operators are: `eq` (==), `lt` - (<), `lte` (<=), `gt` (>) and `gte` (>=).\n\n### Metadata\n\nFollowing [JSON:API - format](https://jsonapi.org/format/#document-meta), object including non-standard - meta-information.\n\nThis endpoint includes the meta member in the response. - For more details on each of the properties included in this section, check - the endpoints response tables.\n\n```JSON\n{\n \"data\": [...],\n \"meta\": - {\n \"total\": 1500,\n \"count\": 18732,\n \"token\": \"some_token\"\n - \ },\n \"links\": {...}\n}\n```" + the page `number` is invalid, a `400` response will be returned.\n\nThe returned + `token` is valid for all requests in the pagination sequence. To send paginated + requests in parallel, reuse the same `token` and change only the `page[number]` + parameter.\n\n### Filtering\n\nThe request can include some filter parameters + to filter the data to be retrieved. The format of the filter parameters follows + the [JSON:API format](https://jsonapi.org/format/#fetching-filtering): `filter[$prop_name]`, + where `prop_name` is the property name in the entity being filtered by.\n\nAll + filters can include multiple values, where data will be filtered with an OR + clause: `filter[title]=Title1,Title2` will filter all vulnerabilities where + title is equal to `Title1` OR `Title2`.\n\nString filters are case sensitive.\n\nBoolean + filters accept `true` or `false` as values.\n\nNumber filters must include + an operator as a second filter input: `filter[$prop_name][$operator]`. For + example, for the vulnerabilities endpoint: `filter[cvss.base.score][lte]=8`.\n\nAvailable + operators are: `eq` (==), `lt` (<), `lte` (<=), `gt` (>) and `gte` (>=).\n\n### + Metadata\n\nFollowing [JSON:API format](https://jsonapi.org/format/#document-meta), + object including non-standard meta-information.\n\nThis endpoint includes + the meta member in the response. For more details on each of the properties + included in this section, check the endpoints response tables.\n\n```JSON\n{\n + \ \"data\": [...],\n \"meta\": {\n \"total\": 1500,\n \"count\": 18732,\n + \ \"token\": \"some_token\"\n },\n \"links\": {...}\n}\n```\n### Extensions\n\nRequests + may include extensions to modify the behavior of the requested endpoint. The + filter parameters follow the [JSON:API format](https://jsonapi.org/extensions/#extensions) + format: `ext:$extension_name`, where `extension_name` is the name of the modifier + that is being applied.\n\nExtensions can only include one value: `ext:modifier=value`." operationId: ListVulnerabilities parameters: - description: Its value must come from the `links` section of the response @@ -71963,9 +72025,9 @@ paths: schema: type: string - description: Filter by advisory ID. - example: TRIVY-CVE-2023-0615 + example: CVE-2023-0615 in: query - name: filter[advisory_id] + name: filter[advisory.id] required: false schema: type: string @@ -72065,7 +72127,8 @@ paths: required: false schema: type: string - - description: Filter by asset name. + - description: Filter by asset name. This field supports the usage of wildcards + (*). example: datadog-agent in: query name: filter[asset.name] @@ -72380,6 +72443,194 @@ paths: operator: OR permissions: - security_monitoring_notification_profiles_write + /api/v2/security/vulnerable-assets: + get: + description: 'Get a list of vulnerable assets. + + + ### Pagination + + + Please review the [Pagination section for the "List Vulnerabilities"](#pagination) + endpoint. + + + ### Filtering + + + Please review the [Filtering section for the "List Vulnerabilities"](#filtering) + endpoint. + + + ### Metadata + + + Please review the [Metadata section for the "List Vulnerabilities"](#metadata) + endpoint.' + operationId: ListVulnerableAssets + 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 or greater + than `1` + example: 1 + in: query + name: page[number] + required: false + schema: + format: int64 + minimum: 1 + type: integer + - description: Filter by name. This field supports the usage of wildcards (*). + example: datadog-agent + in: query + name: filter[name] + required: false + schema: + type: string + - description: Filter by type. + example: Host + in: query + name: filter[type] + required: false + schema: + $ref: '#/components/schemas/AssetType' + - description: Filter by the first version of the asset since it has been vulnerable. + example: v1.15.1 + in: query + name: filter[version.first] + required: false + schema: + type: string + - description: Filter by the last detected version of the asset. + example: v1.15.1 + in: query + name: filter[version.last] + required: false + schema: + type: string + - description: Filter by the repository url associated to the asset. + example: github.com/DataDog/datadog-agent.git + in: query + name: filter[repository_url] + required: false + schema: + type: string + - description: Filter whether the asset is in production or not. + example: false + in: query + name: filter[risks.in_production] + required: false + schema: + type: boolean + - description: Filter whether the asset (Service) is under attack or not. + example: false + in: query + name: filter[risks.under_attack] + required: false + schema: + type: boolean + - description: Filter whether the asset (Host) is publicly accessible or not. + example: false + in: query + name: filter[risks.is_publicly_accessible] + required: false + schema: + type: boolean + - description: Filter whether the asset (Host) has privileged access or not. + example: false + in: query + name: filter[risks.has_privileged_access] + required: false + schema: + type: boolean + - description: Filter whether the asset (Host) has access to sensitive data + or not. + example: false + in: query + name: filter[risks.has_access_to_sensitive_data] + required: false + schema: + type: boolean + - description: Filter by environment. + example: staging + in: query + name: filter[environments] + 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 + name: filter[arch] + required: false + schema: + type: string + - description: Filter by operating system name. + example: ubuntu + in: query + name: filter[operating_system.name] + required: false + schema: + type: string + - description: Filter by operating system version. + example: '24.04' + in: query + name: filter[operating_system.version] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListVulnerableAssetsResponse' + 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: There is no request associated with the provided + token.' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List vulnerable assets + 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_monitoring/cloud_workload_security/agent_rules: get: description: 'Get the list of agent rules. diff --git a/examples/v2/security-monitoring/ListScannedAssetsMetadata.java b/examples/v2/security-monitoring/ListScannedAssetsMetadata.java new file mode 100644 index 00000000000..02a7df89a3b --- /dev/null +++ b/examples/v2/security-monitoring/ListScannedAssetsMetadata.java @@ -0,0 +1,25 @@ +// List scanned assets metadata returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ScannedAssetsMetadata; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listScannedAssetsMetadata", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + ScannedAssetsMetadata result = apiInstance.listScannedAssetsMetadata(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#listScannedAssetsMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 089349ea92e..4eb99152084 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -704,6 +704,7 @@ public class ApiClient { put("v2.listAssetsSBOMs", false); put("v2.listFindings", false); put("v2.listHistoricalJobs", false); + put("v2.listScannedAssetsMetadata", false); put("v2.listSecurityMonitoringHistsignals", false); put("v2.listVulnerabilities", false); put("v2.listVulnerableAssets", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 7ccf094aeaf..7bdb7d5e833 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 @@ -8,6 +8,7 @@ import com.datadog.api.client.v2.model.AssetType; import com.datadog.api.client.v2.model.BulkMuteFindingsRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsResponse; +import com.datadog.api.client.v2.model.CloudAssetType; import com.datadog.api.client.v2.model.ConvertJobResultsToSignalsRequest; import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest; import com.datadog.api.client.v2.model.CreateCustomFrameworkResponse; @@ -33,6 +34,8 @@ 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.SBOMFormat; +import com.datadog.api.client.v2.model.ScannedAssetsMetadata; import com.datadog.api.client.v2.model.SecurityFilterCreateRequest; import com.datadog.api.client.v2.model.SecurityFilterResponse; import com.datadog.api.client.v2.model.SecurityFilterUpdateRequest; @@ -4029,6 +4032,7 @@ public ApiResponse getRuleVersionHistoryWithHttpI /** Manage optional parameters to getSBOM. */ public static class GetSBOMOptionalParameters { private String filterRepoDigest; + private SBOMFormat extFormat; /** * Set filterRepoDigest. @@ -4041,6 +4045,17 @@ public GetSBOMOptionalParameters filterRepoDigest(String filterRepoDigest) { this.filterRepoDigest = filterRepoDigest; return this; } + + /** + * Set extFormat. + * + * @param extFormat The standard of the SBOM. (optional) + * @return GetSBOMOptionalParameters + */ + public GetSBOMOptionalParameters extFormat(SBOMFormat extFormat) { + this.extFormat = extFormat; + return this; + } } /** @@ -4155,6 +4170,7 @@ public ApiResponse getSBOMWithHttpInfo( 400, "Missing the required parameter 'filterAssetName' when calling getSBOM"); } String filterRepoDigest = parameters.filterRepoDigest; + SBOMFormat extFormat = parameters.extFormat; // create path and map variables String localVarPath = "/api/v2/security/sboms/{asset_type}" @@ -4167,6 +4183,7 @@ public ApiResponse getSBOMWithHttpInfo( apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat)); Invocation.Builder builder = apiClient.createBuilder( @@ -4229,6 +4246,7 @@ public CompletableFuture> getSBOMWithHttpInfoAsync( return result; } String filterRepoDigest = parameters.filterRepoDigest; + SBOMFormat extFormat = parameters.extFormat; // create path and map variables String localVarPath = "/api/v2/security/sboms/{asset_type}" @@ -4241,6 +4259,7 @@ public CompletableFuture> getSBOMWithHttpInfoAsync( apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat)); Invocation.Builder builder; try { @@ -7211,6 +7230,340 @@ public ApiResponse listHistoricalJobsWithHttpInfo( new GenericType() {}); } + /** Manage optional parameters to listScannedAssetsMetadata. */ + public static class ListScannedAssetsMetadataOptionalParameters { + private String pageToken; + private Long pageNumber; + private CloudAssetType filterAssetType; + private String filterAssetName; + private String filterLastSuccessOrigin; + private String filterLastSuccessEnv; + + /** + * 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 ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters 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 ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterAssetType. + * + * @param filterAssetType The type of the scanned asset. (optional) + * @return ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters filterAssetType( + CloudAssetType filterAssetType) { + this.filterAssetType = filterAssetType; + return this; + } + + /** + * Set filterAssetName. + * + * @param filterAssetName The name of the scanned asset. (optional) + * @return ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters filterAssetName(String filterAssetName) { + this.filterAssetName = filterAssetName; + return this; + } + + /** + * Set filterLastSuccessOrigin. + * + * @param filterLastSuccessOrigin The origin of last success scan. (optional) + * @return ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters filterLastSuccessOrigin( + String filterLastSuccessOrigin) { + this.filterLastSuccessOrigin = filterLastSuccessOrigin; + return this; + } + + /** + * Set filterLastSuccessEnv. + * + * @param filterLastSuccessEnv The environment of last success scan. (optional) + * @return ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters filterLastSuccessEnv( + String filterLastSuccessEnv) { + this.filterLastSuccessEnv = filterLastSuccessEnv; + return this; + } + } + + /** + * List scanned assets metadata. + * + *

See {@link #listScannedAssetsMetadataWithHttpInfo}. + * + * @return ScannedAssetsMetadata + * @throws ApiException if fails to make API call + */ + public ScannedAssetsMetadata listScannedAssetsMetadata() throws ApiException { + return listScannedAssetsMetadataWithHttpInfo(new ListScannedAssetsMetadataOptionalParameters()) + .getData(); + } + + /** + * List scanned assets metadata. + * + *

See {@link #listScannedAssetsMetadataWithHttpInfoAsync}. + * + * @return CompletableFuture<ScannedAssetsMetadata> + */ + public CompletableFuture listScannedAssetsMetadataAsync() { + return listScannedAssetsMetadataWithHttpInfoAsync( + new ListScannedAssetsMetadataOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List scanned assets metadata. + * + *

See {@link #listScannedAssetsMetadataWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ScannedAssetsMetadata + * @throws ApiException if fails to make API call + */ + public ScannedAssetsMetadata listScannedAssetsMetadata( + ListScannedAssetsMetadataOptionalParameters parameters) throws ApiException { + return listScannedAssetsMetadataWithHttpInfo(parameters).getData(); + } + + /** + * List scanned assets metadata. + * + *

See {@link #listScannedAssetsMetadataWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ScannedAssetsMetadata> + */ + public CompletableFuture listScannedAssetsMetadataAsync( + ListScannedAssetsMetadataOptionalParameters parameters) { + return listScannedAssetsMetadataWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of security scanned assets metadata for an organization. + * + *

Pagination

+ * + *

For the "List Vulnerabilities" endpoint, see the Pagination + * section. + * + *

Filtering

+ * + *

For the "List Vulnerabilities" endpoint, see the Filtering section. + * + *

Metadata

+ * + *

For the "List Vulnerabilities" endpoint, see the Metadata section. + * + *

Related endpoints

+ * + *

This endpoint returns additional metadata for cloud resources that is not available from the + * standard resource endpoints. To access a richer dataset, call this endpoint together with the + * relevant resource endpoint(s) and merge (join) their results using the resource identifier. + * + *

Hosts + * + *

To enrich host data, join the response from the Hosts endpoint with the response from + * the scanned-assets-metadata endpoint on the following key fields: + * + *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v1/hosts | host_list.host_name | + * string | | /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + *

Host Images + * + *

To enrich host image data, join the response from the Hosts endpoint with the response from + * the scanned-assets-metadata endpoint on the following key fields: + * + *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v1/hosts | + * host_list.tags_by_source["Amazon Web Services"]["image"] | string | | + * /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + *

Container Images + * + *

To enrich container image data, join the response from the Container Images endpoint + * with the response from the scanned-assets-metadata endpoint on the following key fields: + * + *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v2/container_images | + * data.attributes.name@data.attributes.repo_digest | string | | + * /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ScannedAssetsMetadata> + * @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 listScannedAssetsMetadataWithHttpInfo( + ListScannedAssetsMetadataOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listScannedAssetsMetadata"; + 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; + CloudAssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterLastSuccessOrigin = parameters.filterLastSuccessOrigin; + String filterLastSuccessEnv = parameters.filterLastSuccessEnv; + // create path and map variables + String localVarPath = "/api/v2/security/scanned-assets-metadata"; + + 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[last_success.origin]", filterLastSuccessOrigin)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[last_success.env]", filterLastSuccessEnv)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listScannedAssetsMetadata", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List scanned assets metadata. + * + *

See {@link #listScannedAssetsMetadataWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ScannedAssetsMetadata>> + */ + public CompletableFuture> + listScannedAssetsMetadataWithHttpInfoAsync( + ListScannedAssetsMetadataOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listScannedAssetsMetadata"; + 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; + CloudAssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterLastSuccessOrigin = parameters.filterLastSuccessOrigin; + String filterLastSuccessEnv = parameters.filterLastSuccessEnv; + // create path and map variables + String localVarPath = "/api/v2/security/scanned-assets-metadata"; + + 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[last_success.origin]", filterLastSuccessOrigin)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[last_success.env]", filterLastSuccessEnv)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listScannedAssetsMetadata", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"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() {}); + } + /** * Get all security filters. * @@ -8650,7 +9003,8 @@ public ListVulnerabilitiesOptionalParameters filterOrigin(String filterOrigin) { /** * Set filterAssetName. * - * @param filterAssetName Filter by asset name. (optional) + * @param filterAssetName Filter by asset name. This field supports the usage of wildcards (*). + * (optional) * @return ListVulnerabilitiesOptionalParameters */ public ListVulnerabilitiesOptionalParameters filterAssetName(String filterAssetName) { @@ -8938,6 +9292,8 @@ public CompletableFuture listVulnerabilitiesAsync( * *

This token can then be used in the subsequent paginated requests. * + *

Note: The first request may take longer to complete than subsequent requests. + * *

Subsequent requests

* *

Any request containing valid page[token] and page[number] @@ -8947,6 +9303,10 @@ public CompletableFuture listVulnerabilitiesAsync( * *

If the page number is invalid, a 400 response will be returned. * + *

The returned token is valid for all requests in the pagination sequence. To + * send paginated requests in parallel, reuse the same token and change only the + * page[number] parameter. + * *

Filtering

* *

The request can include some filter parameters to filter the data to be retrieved. The @@ -8989,6 +9349,15 @@ public CompletableFuture listVulnerabilitiesAsync( * "links": {...} * } * + *

Extensions

+ * + *

Requests may include extensions to modify the behavior of the requested endpoint. The filter + * parameters follow the JSON:API format + * format: ext:$extension_name, where extension_name is the name of the + * modifier that is being applied. + * + *

Extensions can only include one value: ext:modifier=value. + * * @param parameters Optional parameters for the request. * @return ApiResponse<ListVulnerabilitiesResponse> * @throws ApiException if fails to make API call @@ -9085,7 +9454,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId)); + apiClient.parameterToPairs("", "filter[advisory.id]", filterAdvisoryId)); localVarQueryParams.addAll( apiClient.parameterToPairs( "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); @@ -9271,7 +9640,7 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( localVarQueryParams.addAll( apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId)); + apiClient.parameterToPairs("", "filter[advisory.id]", filterAdvisoryId)); localVarQueryParams.addAll( apiClient.parameterToPairs( "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); @@ -9418,7 +9787,7 @@ public ListVulnerableAssetsOptionalParameters pageNumber(Long pageNumber) { /** * Set filterName. * - * @param filterName Filter by name. (optional) + * @param filterName Filter by name. This field supports the usage of wildcards (*). (optional) * @return ListVulnerableAssetsOptionalParameters */ public ListVulnerableAssetsOptionalParameters filterName(String filterName) { @@ -9711,7 +10080,7 @@ public ApiResponse listVulnerableAssetsWithHttpInf String filterOperatingSystemName = parameters.filterOperatingSystemName; String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; // create path and map variables - String localVarPath = "/api/v2/security/assets"; + String localVarPath = "/api/v2/security/vulnerable-assets"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -9809,7 +10178,7 @@ public ApiResponse listVulnerableAssetsWithHttpInf String filterOperatingSystemName = parameters.filterOperatingSystemName; String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; // create path and map variables - String localVarPath = "/api/v2/security/assets"; + String localVarPath = "/api/v2/security/vulnerable-assets"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); diff --git a/src/main/java/com/datadog/api/client/v2/model/CloudAssetType.java b/src/main/java/com/datadog/api/client/v2/model/CloudAssetType.java new file mode 100644 index 00000000000..d80947e6832 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CloudAssetType.java @@ -0,0 +1,56 @@ +/* + * 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 cloud asset type */ +@JsonSerialize(using = CloudAssetType.CloudAssetTypeSerializer.class) +public class CloudAssetType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("Host", "HostImage", "Image")); + + public static final CloudAssetType HOST = new CloudAssetType("Host"); + public static final CloudAssetType HOST_IMAGE = new CloudAssetType("HostImage"); + public static final CloudAssetType IMAGE = new CloudAssetType("Image"); + + CloudAssetType(String value) { + super(value, allowedValues); + } + + public static class CloudAssetTypeSerializer extends StdSerializer { + public CloudAssetTypeSerializer(Class t) { + super(t); + } + + public CloudAssetTypeSerializer() { + this(null); + } + + @Override + public void serialize(CloudAssetType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudAssetType fromValue(String value) { + return new CloudAssetType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SBOMFormat.java b/src/main/java/com/datadog/api/client/v2/model/SBOMFormat.java new file mode 100644 index 00000000000..5fa81b81372 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SBOMFormat.java @@ -0,0 +1,55 @@ +/* + * 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 standard */ +@JsonSerialize(using = SBOMFormat.SBOMFormatSerializer.class) +public class SBOMFormat extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("CycloneDX", "SPDX")); + + public static final SBOMFormat CYCLONEDX = new SBOMFormat("CycloneDX"); + public static final SBOMFormat SPDX = new SBOMFormat("SPDX"); + + SBOMFormat(String value) { + super(value, allowedValues); + } + + public static class SBOMFormatSerializer extends StdSerializer { + public SBOMFormatSerializer(Class t) { + super(t); + } + + public SBOMFormatSerializer() { + this(null); + } + + @Override + public void serialize(SBOMFormat value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SBOMFormat fromValue(String value) { + return new SBOMFormat(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadata.java b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadata.java new file mode 100644 index 00000000000..22306caba6b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadata.java @@ -0,0 +1,176 @@ +/* + * 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 metadata of a scanned asset. */ +@JsonPropertyOrder({ + ScannedAssetMetadata.JSON_PROPERTY_ATTRIBUTES, + ScannedAssetMetadata.JSON_PROPERTY_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScannedAssetMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ScannedAssetMetadataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public ScannedAssetMetadata() {} + + @JsonCreator + public ScannedAssetMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ScannedAssetMetadataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + } + + public ScannedAssetMetadata attributes(ScannedAssetMetadataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a scanned asset metadata. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScannedAssetMetadataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ScannedAssetMetadataAttributes attributes) { + this.attributes = attributes; + } + + public ScannedAssetMetadata id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the scanned asset metadata. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * 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 ScannedAssetMetadata + */ + @JsonAnySetter + public ScannedAssetMetadata 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 ScannedAssetMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScannedAssetMetadata scannedAssetMetadata = (ScannedAssetMetadata) o; + return Objects.equals(this.attributes, scannedAssetMetadata.attributes) + && Objects.equals(this.id, scannedAssetMetadata.id) + && Objects.equals(this.additionalProperties, scannedAssetMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScannedAssetMetadata {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/ScannedAssetMetadataAsset.java b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAsset.java new file mode 100644 index 00000000000..e435e650f4c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAsset.java @@ -0,0 +1,179 @@ +/* + * 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 asset of a scanned asset metadata. */ +@JsonPropertyOrder({ + ScannedAssetMetadataAsset.JSON_PROPERTY_NAME, + ScannedAssetMetadataAsset.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScannedAssetMetadataAsset { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CloudAssetType type; + + public ScannedAssetMetadataAsset() {} + + @JsonCreator + public ScannedAssetMetadataAsset( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CloudAssetType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ScannedAssetMetadataAsset name(String name) { + this.name = name; + return this; + } + + /** + * The name of the asset. + * + * @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 ScannedAssetMetadataAsset type(CloudAssetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The cloud asset type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudAssetType getType() { + return type; + } + + public void setType(CloudAssetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScannedAssetMetadataAsset + */ + @JsonAnySetter + public ScannedAssetMetadataAsset 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 ScannedAssetMetadataAsset object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScannedAssetMetadataAsset scannedAssetMetadataAsset = (ScannedAssetMetadataAsset) o; + return Objects.equals(this.name, scannedAssetMetadataAsset.name) + && Objects.equals(this.type, scannedAssetMetadataAsset.type) + && Objects.equals( + this.additionalProperties, scannedAssetMetadataAsset.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScannedAssetMetadataAsset {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAttributes.java new file mode 100644 index 00000000000..33a3a74fdf3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataAttributes.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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a scanned asset metadata. */ +@JsonPropertyOrder({ + ScannedAssetMetadataAttributes.JSON_PROPERTY_ASSET, + ScannedAssetMetadataAttributes.JSON_PROPERTY_FIRST_SUCCESS_TIMESTAMP, + ScannedAssetMetadataAttributes.JSON_PROPERTY_LAST_SUCCESS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScannedAssetMetadataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSET = "asset"; + private ScannedAssetMetadataAsset asset; + + public static final String JSON_PROPERTY_FIRST_SUCCESS_TIMESTAMP = "first_success_timestamp"; + private String firstSuccessTimestamp; + + public static final String JSON_PROPERTY_LAST_SUCCESS = "last_success"; + private ScannedAssetMetadataLastSuccess lastSuccess; + + public ScannedAssetMetadataAttributes() {} + + @JsonCreator + public ScannedAssetMetadataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ASSET) ScannedAssetMetadataAsset asset, + @JsonProperty(required = true, value = JSON_PROPERTY_FIRST_SUCCESS_TIMESTAMP) + String firstSuccessTimestamp, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_SUCCESS) + ScannedAssetMetadataLastSuccess lastSuccess) { + this.asset = asset; + this.unparsed |= asset.unparsed; + this.firstSuccessTimestamp = firstSuccessTimestamp; + this.lastSuccess = lastSuccess; + this.unparsed |= lastSuccess.unparsed; + } + + public ScannedAssetMetadataAttributes asset(ScannedAssetMetadataAsset asset) { + this.asset = asset; + this.unparsed |= asset.unparsed; + return this; + } + + /** + * The asset of a scanned asset metadata. + * + * @return asset + */ + @JsonProperty(JSON_PROPERTY_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScannedAssetMetadataAsset getAsset() { + return asset; + } + + public void setAsset(ScannedAssetMetadataAsset asset) { + this.asset = asset; + } + + public ScannedAssetMetadataAttributes firstSuccessTimestamp(String firstSuccessTimestamp) { + this.firstSuccessTimestamp = firstSuccessTimestamp; + return this; + } + + /** + * The timestamp when the scan of the asset was performed for the first time. + * + * @return firstSuccessTimestamp + */ + @JsonProperty(JSON_PROPERTY_FIRST_SUCCESS_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFirstSuccessTimestamp() { + return firstSuccessTimestamp; + } + + public void setFirstSuccessTimestamp(String firstSuccessTimestamp) { + this.firstSuccessTimestamp = firstSuccessTimestamp; + } + + public ScannedAssetMetadataAttributes lastSuccess(ScannedAssetMetadataLastSuccess lastSuccess) { + this.lastSuccess = lastSuccess; + this.unparsed |= lastSuccess.unparsed; + return this; + } + + /** + * Metadata for the last successful scan of an asset. + * + * @return lastSuccess + */ + @JsonProperty(JSON_PROPERTY_LAST_SUCCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScannedAssetMetadataLastSuccess getLastSuccess() { + return lastSuccess; + } + + public void setLastSuccess(ScannedAssetMetadataLastSuccess lastSuccess) { + this.lastSuccess = lastSuccess; + } + + /** + * 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 ScannedAssetMetadataAttributes + */ + @JsonAnySetter + public ScannedAssetMetadataAttributes 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 ScannedAssetMetadataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScannedAssetMetadataAttributes scannedAssetMetadataAttributes = + (ScannedAssetMetadataAttributes) o; + return Objects.equals(this.asset, scannedAssetMetadataAttributes.asset) + && Objects.equals( + this.firstSuccessTimestamp, scannedAssetMetadataAttributes.firstSuccessTimestamp) + && Objects.equals(this.lastSuccess, scannedAssetMetadataAttributes.lastSuccess) + && Objects.equals( + this.additionalProperties, scannedAssetMetadataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(asset, firstSuccessTimestamp, lastSuccess, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScannedAssetMetadataAttributes {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" firstSuccessTimestamp: ") + .append(toIndentedString(firstSuccessTimestamp)) + .append("\n"); + sb.append(" lastSuccess: ").append(toIndentedString(lastSuccess)).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/ScannedAssetMetadataLastSuccess.java b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataLastSuccess.java new file mode 100644 index 00000000000..2c593924bf3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetMetadataLastSuccess.java @@ -0,0 +1,211 @@ +/* + * 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; + +/** Metadata for the last successful scan of an asset. */ +@JsonPropertyOrder({ + ScannedAssetMetadataLastSuccess.JSON_PROPERTY_ENV, + ScannedAssetMetadataLastSuccess.JSON_PROPERTY_ORIGIN, + ScannedAssetMetadataLastSuccess.JSON_PROPERTY_TIMESTAMP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScannedAssetMetadataLastSuccess { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_ORIGIN = "origin"; + private List origin = null; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private String timestamp; + + public ScannedAssetMetadataLastSuccess() {} + + @JsonCreator + public ScannedAssetMetadataLastSuccess( + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP) String timestamp) { + this.timestamp = timestamp; + } + + public ScannedAssetMetadataLastSuccess env(String env) { + this.env = env; + return this; + } + + /** + * The environment of the last success scan of the asset. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public ScannedAssetMetadataLastSuccess origin(List origin) { + this.origin = origin; + return this; + } + + public ScannedAssetMetadataLastSuccess addOriginItem(String originItem) { + if (this.origin == null) { + this.origin = new ArrayList<>(); + } + this.origin.add(originItem); + return this; + } + + /** + * The list of origins of the last success scan of the asset. + * + * @return origin + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOrigin() { + return origin; + } + + public void setOrigin(List origin) { + this.origin = origin; + } + + public ScannedAssetMetadataLastSuccess timestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * The timestamp of the last success scan of the asset. + * + * @return timestamp + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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. + */ + 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 ScannedAssetMetadataLastSuccess + */ + @JsonAnySetter + public ScannedAssetMetadataLastSuccess 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 ScannedAssetMetadataLastSuccess object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScannedAssetMetadataLastSuccess scannedAssetMetadataLastSuccess = + (ScannedAssetMetadataLastSuccess) o; + return Objects.equals(this.env, scannedAssetMetadataLastSuccess.env) + && Objects.equals(this.origin, scannedAssetMetadataLastSuccess.origin) + && Objects.equals(this.timestamp, scannedAssetMetadataLastSuccess.timestamp) + && Objects.equals( + this.additionalProperties, scannedAssetMetadataLastSuccess.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(env, origin, timestamp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScannedAssetMetadataLastSuccess {\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).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/ScannedAssetsMetadata.java b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetsMetadata.java new file mode 100644 index 00000000000..7d8053448ee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScannedAssetsMetadata.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 scanned assets metadata. */ +@JsonPropertyOrder({ + ScannedAssetsMetadata.JSON_PROPERTY_DATA, + ScannedAssetsMetadata.JSON_PROPERTY_LINKS, + ScannedAssetsMetadata.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScannedAssetsMetadata { + @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 ScannedAssetsMetadata() {} + + @JsonCreator + public ScannedAssetsMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ScannedAssetsMetadata data(List data) { + this.data = data; + for (ScannedAssetMetadata item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ScannedAssetsMetadata addDataItem(ScannedAssetMetadata dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of scanned assets metadata. + * + * @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 ScannedAssetsMetadata 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 ScannedAssetsMetadata 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 ScannedAssetsMetadata + */ + @JsonAnySetter + public ScannedAssetsMetadata 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 ScannedAssetsMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScannedAssetsMetadata scannedAssetsMetadata = (ScannedAssetsMetadata) o; + return Objects.equals(this.data, scannedAssetsMetadata.data) + && Objects.equals(this.links, scannedAssetsMetadata.links) + && Objects.equals(this.meta, scannedAssetsMetadata.meta) + && Objects.equals(this.additionalProperties, scannedAssetsMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScannedAssetsMetadata {\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/VulnerabilityAdvisory.java b/src/main/java/com/datadog/api/client/v2/model/VulnerabilityAdvisory.java new file mode 100644 index 00000000000..285ec05bf6b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/VulnerabilityAdvisory.java @@ -0,0 +1,200 @@ +/* + * 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; + +/** Advisory associated with the vulnerability. */ +@JsonPropertyOrder({ + VulnerabilityAdvisory.JSON_PROPERTY_ID, + VulnerabilityAdvisory.JSON_PROPERTY_LAST_MODIFICATION_DATE, + VulnerabilityAdvisory.JSON_PROPERTY_PUBLISH_DATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class VulnerabilityAdvisory { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_LAST_MODIFICATION_DATE = "last_modification_date"; + private String lastModificationDate; + + public static final String JSON_PROPERTY_PUBLISH_DATE = "publish_date"; + private String publishDate; + + public VulnerabilityAdvisory() {} + + @JsonCreator + public VulnerabilityAdvisory(@JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.id = id; + } + + public VulnerabilityAdvisory id(String id) { + this.id = id; + return this; + } + + /** + * Vulnerability advisory ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public VulnerabilityAdvisory lastModificationDate(String lastModificationDate) { + this.lastModificationDate = lastModificationDate; + return this; + } + + /** + * Vulnerability advisory last modification date. + * + * @return lastModificationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFICATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastModificationDate() { + return lastModificationDate; + } + + public void setLastModificationDate(String lastModificationDate) { + this.lastModificationDate = lastModificationDate; + } + + public VulnerabilityAdvisory publishDate(String publishDate) { + this.publishDate = publishDate; + return this; + } + + /** + * Vulnerability advisory publish date. + * + * @return publishDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLISH_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublishDate() { + return publishDate; + } + + public void setPublishDate(String publishDate) { + this.publishDate = publishDate; + } + + /** + * 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 VulnerabilityAdvisory + */ + @JsonAnySetter + public VulnerabilityAdvisory 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 VulnerabilityAdvisory object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VulnerabilityAdvisory vulnerabilityAdvisory = (VulnerabilityAdvisory) o; + return Objects.equals(this.id, vulnerabilityAdvisory.id) + && Objects.equals(this.lastModificationDate, vulnerabilityAdvisory.lastModificationDate) + && Objects.equals(this.publishDate, vulnerabilityAdvisory.publishDate) + && Objects.equals(this.additionalProperties, vulnerabilityAdvisory.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, lastModificationDate, publishDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VulnerabilityAdvisory {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastModificationDate: ") + .append(toIndentedString(lastModificationDate)) + .append("\n"); + sb.append(" publishDate: ").append(toIndentedString(publishDate)).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 bb1c40dd5aa..e7abd3673e2 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 @@ -21,6 +21,7 @@ /** The JSON:API attributes of the vulnerability. */ @JsonPropertyOrder({ + VulnerabilityAttributes.JSON_PROPERTY_ADVISORY, VulnerabilityAttributes.JSON_PROPERTY_ADVISORY_ID, VulnerabilityAttributes.JSON_PROPERTY_CODE_LOCATION, VulnerabilityAttributes.JSON_PROPERTY_CVE_LIST, @@ -47,6 +48,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class VulnerabilityAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ADVISORY = "advisory"; + private VulnerabilityAdvisory advisory; + public static final String JSON_PROPERTY_ADVISORY_ID = "advisory_id"; private String advisoryId; @@ -152,6 +156,28 @@ public VulnerabilityAttributes( this.unparsed |= !type.isValid(); } + public VulnerabilityAttributes advisory(VulnerabilityAdvisory advisory) { + this.advisory = advisory; + this.unparsed |= advisory.unparsed; + return this; + } + + /** + * Advisory associated with the vulnerability. + * + * @return advisory + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADVISORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public VulnerabilityAdvisory getAdvisory() { + return advisory; + } + + public void setAdvisory(VulnerabilityAdvisory advisory) { + this.advisory = advisory; + } + public VulnerabilityAttributes advisoryId(String advisoryId) { this.advisoryId = advisoryId; return this; @@ -686,7 +712,8 @@ public boolean equals(Object o) { return false; } VulnerabilityAttributes vulnerabilityAttributes = (VulnerabilityAttributes) o; - return Objects.equals(this.advisoryId, vulnerabilityAttributes.advisoryId) + return Objects.equals(this.advisory, vulnerabilityAttributes.advisory) + && Objects.equals(this.advisoryId, vulnerabilityAttributes.advisoryId) && Objects.equals(this.codeLocation, vulnerabilityAttributes.codeLocation) && Objects.equals(this.cveList, vulnerabilityAttributes.cveList) && Objects.equals(this.cvss, vulnerabilityAttributes.cvss) @@ -713,6 +740,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + advisory, advisoryId, codeLocation, cveList, @@ -741,6 +769,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class VulnerabilityAttributes {\n"); + sb.append(" advisory: ").append(toIndentedString(advisory)).append("\n"); sb.append(" advisoryId: ").append(toIndentedString(advisoryId)).append("\n"); sb.append(" codeLocation: ").append(toIndentedString(codeLocation)).append("\n"); sb.append(" cveList: ").append(toIndentedString(cveList)).append("\n"); diff --git a/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.freeze b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.freeze new file mode 100644 index 00000000000..69589f13912 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.freeze @@ -0,0 +1 @@ +2025-10-15T08:41:14.545Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.json b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.json new file mode 100644 index 00000000000..9d33299fc3f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_Not_found_asset_not_found_response.json @@ -0,0 +1,36 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/scanned-assets-metadata", + "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": "62e25434-3c98-aa74-afed-678d589a7636" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.freeze new file mode 100644 index 00000000000..98659e71883 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-15T08:42:14.735Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.json new file mode 100644 index 00000000000..c645f276ed5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_scanned_assets_metadata_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/scanned-assets-metadata", + "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": "df97e37b-ed67-9b44-c331-0ea3c5e9a0bf" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze index 7b1371734cd..f78ea7dd7b7 100644 --- a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze +++ b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.freeze @@ -1 +1 @@ -2025-01-31T12:04:52.159Z \ No newline at end of file +2025-10-14T13:43:32.350Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json index 6f9dd0f115d..7146c682427 100644 --- a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json +++ b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_Not_found_There_is_no_request_associated_with_the_provided_token_response.json @@ -3,7 +3,7 @@ "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/security/assets", + "path": "/api/v2/security/vulnerable-assets", "queryStringParameters": { "page[token]": [ "unknown" @@ -16,7 +16,7 @@ "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"rpc error: code = Internal desc = no cached result set found for queryID: unknown\"}]}", + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Unexpected internal error\"}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -31,6 +31,6 @@ "timeToLive": { "unlimited": true }, - "id": "c6d229b3-cd79-6e5e-593c-6ebc987186ec" + "id": "9910b6cc-2c33-c037-1794-ef62062d3ec2" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.freeze index 2131f54a8a2..ecb5cae4f92 100644 --- a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-31T12:05:04.773Z \ No newline at end of file +2025-10-14T13:43:52.800Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.json index 240d856ba26..1adf3b188c4 100644 --- a/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_vulnerable_assets_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/security/assets", + "path": "/api/v2/security/vulnerable-assets", "queryStringParameters": { "filter[type]": [ "Host" @@ -34,6 +34,6 @@ "timeToLive": { "unlimited": true }, - "id": "8b691c92-3faa-0d44-ea73-715eceb660c3" + "id": "e8a64c25-6dc3-4b44-16b3-c26a580df140" } ] \ 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 c83348e6898..8e5e22baade 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 @@ -1065,6 +1065,29 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/asm-vm + Scenario: List scanned assets metadata returns "Bad request: The server cannot process the request due to invalid syntax in the request." response + Given operation "ListScannedAssetsMetadata" enabled + And new "ListScannedAssetsMetadata" 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 scanned assets metadata returns "Not found: asset not found" response + Given operation "ListScannedAssetsMetadata" enabled + And new "ListScannedAssetsMetadata" 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: asset not found + + @team:DataDog/asm-vm + Scenario: List scanned assets metadata returns "OK" response + Given operation "ListScannedAssetsMetadata" enabled + And new "ListScannedAssetsMetadata" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/asm-vm Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListVulnerabilities" enabled 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 76bc60f80eb..6e05ad8acd5 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 @@ -3223,12 +3223,6 @@ "type": "idempotent" } }, - "ListVulnerableAssets": { - "tag": "Security Monitoring", - "undo": { - "type": "safe" - } - }, "DownloadCloudWorkloadPolicyFile": { "tag": "CSM Threats", "undo": { @@ -3247,6 +3241,12 @@ "type": "safe" } }, + "ListScannedAssetsMetadata": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetSignalNotificationRules": { "tag": "Security Monitoring", "undo": { @@ -3327,6 +3327,12 @@ "type": "idempotent" } }, + "ListVulnerableAssets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": {