diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9b5a962d17..11779662d4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -94280,6 +94280,8 @@ components: type: array repository: $ref: "#/components/schemas/ScaRequestDataAttributesRepository" + scan_start_timestamp: + $ref: "#/components/schemas/ScaRequestDataAttributesScanStartTimestamp" service: description: The name of the service or application being analyzed. type: string @@ -94330,24 +94332,26 @@ components: type: array group: description: The group or organization namespace of the dependency (e.g., Maven group ID). + nullable: true type: string is_dev: description: Indicates whether this is a development-only dependency not used in production. type: boolean is_direct: description: Indicates whether this is a direct dependency (as opposed to a transitive one). + nullable: true type: boolean language: description: The programming language ecosystem of this dependency (e.g., java, python, javascript). type: string locations: - description: The list of source file locations where this dependency is declared. - items: - $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItems" - type: array + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocations" name: description: The name of the dependency package. type: string + opaque: + description: Indicates whether dependency details are intentionally opaque. + type: boolean package_manager: description: The package manager responsible for this dependency (e.g., maven, pip, npm). type: string @@ -94359,21 +94363,43 @@ components: items: $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems" type: array + requires_transitive_enrichment: + description: Indicates whether this dependency requires transitive dependency enrichment. + type: boolean + target_frameworks: + description: The target framework identifiers associated with this dependency. + items: + description: A target framework identifier. + type: string + type: array version: description: The version of the dependency. + nullable: true + type: string + version_constraint: + description: Indicates whether the version value represents a version constraint. + type: boolean + version_range: + description: The version range associated with this dependency when a manifest declares a range. type: string type: object + ScaRequestDataAttributesDependenciesItemsLocations: + description: The list of source file locations where this dependency is declared. + items: + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItems" + nullable: true + type: array ScaRequestDataAttributesDependenciesItemsLocationsItems: description: The source code location where a dependency is declared, including block, name, namespace, and version positions within the file. properties: block: $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition" name: - $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition" + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition" namespace: - $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition" + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition" version: - $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition" + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition" type: object ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition: description: A range within a file defined by a start and end position, along with the file name. @@ -94383,6 +94409,24 @@ components: file_name: description: The name or path of the file containing this location. type: string + role: + description: The semantic role associated with this file location. + type: string + start: + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition" + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition: + description: A nullable range within a file defined by a start and end position, along with the file name. + nullable: true + properties: + end: + $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition" + file_name: + description: The name or path of the file containing this location. + type: string + role: + description: The semantic role associated with this file location. + type: string start: $ref: "#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition" type: object @@ -94440,6 +94484,20 @@ components: description: The URL of the repository. type: string type: object + ScaRequestDataAttributesScanStartTimestamp: + description: The time when the SCA scan started. + nullable: true + properties: + nanos: + description: Non-negative fractions of a second at nanosecond resolution. + format: int32 + maximum: 2147483647 + type: integer + seconds: + description: Seconds of UTC time since Unix epoch. + format: int64 + type: integer + type: object ScaRequestDataAttributesVulnerabilitiesItems: description: A vulnerability entry from the Software Bill of Materials (SBOM), describing a known security issue and the components it affects. properties: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 56b4374ab4..e4ded2ed9e 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -40457,6 +40457,13 @@ datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_item :members: :show-inheritance: +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items\_locations\_items\_nullable\_file\_position module +------------------------------------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position + :members: + :show-inheritance: + datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items\_locations\_items\_position module -------------------------------------------------------------------------------------------------------------------- @@ -40492,6 +40499,13 @@ datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_repository module :members: :show-inheritance: +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_scan\_start\_timestamp module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_scan_start_timestamp + :members: + :show-inheritance: + datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_vulnerabilities\_items module ------------------------------------------------------------------------------------------- diff --git a/examples/v2/static-analysis/CreateSCAResult.py b/examples/v2/static-analysis/CreateSCAResult.py index 335cc60222..7762964235 100644 --- a/examples/v2/static-analysis/CreateSCAResult.py +++ b/examples/v2/static-analysis/CreateSCAResult.py @@ -17,6 +17,9 @@ from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_file_position import ( ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, ) +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, +) from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_position import ( ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, ) @@ -28,6 +31,9 @@ ScaRequestDataAttributesRelationsItems, ) from datadog_api_client.v2.model.sca_request_data_attributes_repository import ScaRequestDataAttributesRepository +from datadog_api_client.v2.model.sca_request_data_attributes_scan_start_timestamp import ( + ScaRequestDataAttributesScanStartTimestamp, +) from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( ScaRequestDataAttributesVulnerabilitiesItems, ) @@ -43,21 +49,23 @@ dependencies=[ ScaRequestDataAttributesDependenciesItems( exclusions=[], + group=None, + is_direct=None, locations=[ ScaRequestDataAttributesDependenciesItemsLocationsItems( block=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), ), - name=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + name=ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition( end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), ), - namespace=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + namespace=ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition( end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), ), - version=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + version=ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition( end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), ), @@ -66,6 +74,8 @@ reachable_symbol_properties=[ ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems(), ], + target_frameworks=[], + version=None, ), ], files=[ @@ -77,6 +87,7 @@ ), ], repository=ScaRequestDataAttributesRepository(), + scan_start_timestamp=ScaRequestDataAttributesScanStartTimestamp(), vulnerabilities=[ ScaRequestDataAttributesVulnerabilitiesItems( affects=[ diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes.py b/src/datadog_api_client/v2/model/sca_request_data_attributes.py index 0d8d420480..47f4f886cf 100644 --- a/src/datadog_api_client/v2/model/sca_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes.py @@ -8,6 +8,7 @@ from datadog_api_client.model_utils import ( ModelNormal, cached_property, + none_type, unset, UnsetType, ) @@ -23,6 +24,9 @@ ScaRequestDataAttributesRelationsItems, ) from datadog_api_client.v2.model.sca_request_data_attributes_repository import ScaRequestDataAttributesRepository + from datadog_api_client.v2.model.sca_request_data_attributes_scan_start_timestamp import ( + ScaRequestDataAttributesScanStartTimestamp, + ) from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( ScaRequestDataAttributesVulnerabilitiesItems, ) @@ -44,6 +48,9 @@ def openapi_types(_): from datadog_api_client.v2.model.sca_request_data_attributes_repository import ( ScaRequestDataAttributesRepository, ) + from datadog_api_client.v2.model.sca_request_data_attributes_scan_start_timestamp import ( + ScaRequestDataAttributesScanStartTimestamp, + ) from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( ScaRequestDataAttributesVulnerabilitiesItems, ) @@ -55,6 +62,7 @@ def openapi_types(_): "files": ([ScaRequestDataAttributesFilesItems],), "relations": ([ScaRequestDataAttributesRelationsItems],), "repository": (ScaRequestDataAttributesRepository,), + "scan_start_timestamp": (ScaRequestDataAttributesScanStartTimestamp,), "service": (str,), "tags": ({str: (str,)},), "vulnerabilities": ([ScaRequestDataAttributesVulnerabilitiesItems],), @@ -67,6 +75,7 @@ def openapi_types(_): "files": "files", "relations": "relations", "repository": "repository", + "scan_start_timestamp": "scan_start_timestamp", "service": "service", "tags": "tags", "vulnerabilities": "vulnerabilities", @@ -80,6 +89,7 @@ def __init__( files: Union[List[ScaRequestDataAttributesFilesItems], UnsetType] = unset, relations: Union[List[ScaRequestDataAttributesRelationsItems], UnsetType] = unset, repository: Union[ScaRequestDataAttributesRepository, UnsetType] = unset, + scan_start_timestamp: Union[ScaRequestDataAttributesScanStartTimestamp, none_type, UnsetType] = unset, service: Union[str, UnsetType] = unset, tags: Union[Dict[str, str], UnsetType] = unset, vulnerabilities: Union[List[ScaRequestDataAttributesVulnerabilitiesItems], UnsetType] = unset, @@ -106,6 +116,9 @@ def __init__( :param repository: Information about the source code repository being analyzed. :type repository: ScaRequestDataAttributesRepository, optional + :param scan_start_timestamp: The time when the SCA scan started. + :type scan_start_timestamp: ScaRequestDataAttributesScanStartTimestamp, none_type, optional + :param service: The name of the service or application being analyzed. :type service: str, optional @@ -127,6 +140,8 @@ def __init__( kwargs["relations"] = relations if repository is not unset: kwargs["repository"] = repository + if scan_start_timestamp is not unset: + kwargs["scan_start_timestamp"] = scan_start_timestamp if service is not unset: kwargs["service"] = service if tags is not unset: diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items.py index 964dfc00f7..beb325d15f 100644 --- a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items.py +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items.py @@ -8,6 +8,7 @@ from datadog_api_client.model_utils import ( ModelNormal, cached_property, + none_type, unset, UnsetType, ) @@ -34,16 +35,21 @@ def openapi_types(_): return { "exclusions": ([str],), - "group": (str,), + "group": (str, none_type), "is_dev": (bool,), - "is_direct": (bool,), + "is_direct": (bool, none_type), "language": (str,), "locations": ([ScaRequestDataAttributesDependenciesItemsLocationsItems],), "name": (str,), + "opaque": (bool,), "package_manager": (str,), "purl": (str,), "reachable_symbol_properties": ([ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems],), - "version": (str,), + "requires_transitive_enrichment": (bool,), + "target_frameworks": ([str],), + "version": (str, none_type), + "version_constraint": (bool,), + "version_range": (str,), } attribute_map = { @@ -54,27 +60,37 @@ def openapi_types(_): "language": "language", "locations": "locations", "name": "name", + "opaque": "opaque", "package_manager": "package_manager", "purl": "purl", "reachable_symbol_properties": "reachable_symbol_properties", + "requires_transitive_enrichment": "requires_transitive_enrichment", + "target_frameworks": "target_frameworks", "version": "version", + "version_constraint": "version_constraint", + "version_range": "version_range", } def __init__( self_, exclusions: Union[List[str], UnsetType] = unset, - group: Union[str, UnsetType] = unset, + group: Union[str, none_type, UnsetType] = unset, is_dev: Union[bool, UnsetType] = unset, - is_direct: Union[bool, UnsetType] = unset, + is_direct: Union[bool, none_type, UnsetType] = unset, language: Union[str, UnsetType] = unset, - locations: Union[List[ScaRequestDataAttributesDependenciesItemsLocationsItems], UnsetType] = unset, + locations: Union[List[ScaRequestDataAttributesDependenciesItemsLocationsItems], none_type, UnsetType] = unset, name: Union[str, UnsetType] = unset, + opaque: Union[bool, UnsetType] = unset, package_manager: Union[str, UnsetType] = unset, purl: Union[str, UnsetType] = unset, reachable_symbol_properties: Union[ List[ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems], UnsetType ] = unset, - version: Union[str, UnsetType] = unset, + requires_transitive_enrichment: Union[bool, UnsetType] = unset, + target_frameworks: Union[List[str], UnsetType] = unset, + version: Union[str, none_type, UnsetType] = unset, + version_constraint: Union[bool, UnsetType] = unset, + version_range: Union[str, UnsetType] = unset, **kwargs, ): """ @@ -84,23 +100,26 @@ def __init__( :type exclusions: [str], optional :param group: The group or organization namespace of the dependency (e.g., Maven group ID). - :type group: str, optional + :type group: str, none_type, optional :param is_dev: Indicates whether this is a development-only dependency not used in production. :type is_dev: bool, optional :param is_direct: Indicates whether this is a direct dependency (as opposed to a transitive one). - :type is_direct: bool, optional + :type is_direct: bool, none_type, optional :param language: The programming language ecosystem of this dependency (e.g., java, python, javascript). :type language: str, optional :param locations: The list of source file locations where this dependency is declared. - :type locations: [ScaRequestDataAttributesDependenciesItemsLocationsItems], optional + :type locations: [ScaRequestDataAttributesDependenciesItemsLocationsItems], none_type, optional :param name: The name of the dependency package. :type name: str, optional + :param opaque: Indicates whether dependency details are intentionally opaque. + :type opaque: bool, optional + :param package_manager: The package manager responsible for this dependency (e.g., maven, pip, npm). :type package_manager: str, optional @@ -110,8 +129,20 @@ def __init__( :param reachable_symbol_properties: Properties describing symbols from this dependency that are reachable in the application code. :type reachable_symbol_properties: [ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems], optional + :param requires_transitive_enrichment: Indicates whether this dependency requires transitive dependency enrichment. + :type requires_transitive_enrichment: bool, optional + + :param target_frameworks: The target framework identifiers associated with this dependency. + :type target_frameworks: [str], optional + :param version: The version of the dependency. - :type version: str, optional + :type version: str, none_type, optional + + :param version_constraint: Indicates whether the version value represents a version constraint. + :type version_constraint: bool, optional + + :param version_range: The version range associated with this dependency when a manifest declares a range. + :type version_range: str, optional """ if exclusions is not unset: kwargs["exclusions"] = exclusions @@ -127,12 +158,22 @@ def __init__( kwargs["locations"] = locations if name is not unset: kwargs["name"] = name + if opaque is not unset: + kwargs["opaque"] = opaque if package_manager is not unset: kwargs["package_manager"] = package_manager if purl is not unset: kwargs["purl"] = purl if reachable_symbol_properties is not unset: kwargs["reachable_symbol_properties"] = reachable_symbol_properties + if requires_transitive_enrichment is not unset: + kwargs["requires_transitive_enrichment"] = requires_transitive_enrichment + if target_frameworks is not unset: + kwargs["target_frameworks"] = target_frameworks if version is not unset: kwargs["version"] = version + if version_constraint is not unset: + kwargs["version_constraint"] = version_constraint + if version_range is not unset: + kwargs["version_range"] = version_range super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items.py index 70a7d4d568..a1a45089ba 100644 --- a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items.py +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items.py @@ -8,6 +8,7 @@ from datadog_api_client.model_utils import ( ModelNormal, cached_property, + none_type, unset, UnsetType, ) @@ -17,6 +18,9 @@ from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_file_position import ( ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, ) + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, + ) class ScaRequestDataAttributesDependenciesItemsLocationsItems(ModelNormal): @@ -25,12 +29,15 @@ def openapi_types(_): from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_file_position import ( ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, ) + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, + ) return { "block": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), - "name": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), - "namespace": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), - "version": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), + "name": (ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition,), + "namespace": (ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition,), + "version": (ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition,), } attribute_map = { @@ -43,9 +50,15 @@ def openapi_types(_): def __init__( self_, block: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, - name: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, - namespace: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, - version: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, + name: Union[ + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, none_type, UnsetType + ] = unset, + namespace: Union[ + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, none_type, UnsetType + ] = unset, + version: Union[ + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, none_type, UnsetType + ] = unset, **kwargs, ): """ @@ -54,14 +67,14 @@ def __init__( :param block: A range within a file defined by a start and end position, along with the file name. :type block: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional - :param name: A range within a file defined by a start and end position, along with the file name. - :type name: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + :param name: A nullable range within a file defined by a start and end position, along with the file name. + :type name: ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, none_type, optional - :param namespace: A range within a file defined by a start and end position, along with the file name. - :type namespace: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + :param namespace: A nullable range within a file defined by a start and end position, along with the file name. + :type namespace: ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, none_type, optional - :param version: A range within a file defined by a start and end position, along with the file name. - :type version: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + :param version: A nullable range within a file defined by a start and end position, along with the file name. + :type version: ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, none_type, optional """ if block is not unset: kwargs["block"] = block diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_file_position.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_file_position.py index 702d0569fb..3a1d83a946 100644 --- a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_file_position.py +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_file_position.py @@ -29,12 +29,14 @@ def openapi_types(_): return { "end": (ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition,), "file_name": (str,), + "role": (str,), "start": (ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition,), } attribute_map = { "end": "end", "file_name": "file_name", + "role": "role", "start": "start", } @@ -42,6 +44,7 @@ def __init__( self_, end: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, UnsetType] = unset, file_name: Union[str, UnsetType] = unset, + role: Union[str, UnsetType] = unset, start: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, UnsetType] = unset, **kwargs, ): @@ -54,6 +57,9 @@ def __init__( :param file_name: The name or path of the file containing this location. :type file_name: str, optional + :param role: The semantic role associated with this file location. + :type role: str, optional + :param start: A specific position (line and column) within a source file. :type start: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, optional """ @@ -61,6 +67,8 @@ def __init__( kwargs["end"] = end if file_name is not unset: kwargs["file_name"] = file_name + if role is not unset: + kwargs["role"] = role if start is not unset: kwargs["start"] = start super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position.py new file mode 100644 index 0000000000..2d955d1677 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position.py @@ -0,0 +1,76 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, + ) + + +class ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, + ) + + return { + "end": (ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition,), + "file_name": (str,), + "role": (str,), + "start": (ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition,), + } + + attribute_map = { + "end": "end", + "file_name": "file_name", + "role": "role", + "start": "start", + } + + def __init__( + self_, + end: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, UnsetType] = unset, + file_name: Union[str, UnsetType] = unset, + role: Union[str, UnsetType] = unset, + start: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, UnsetType] = unset, + **kwargs, + ): + """ + A nullable range within a file defined by a start and end position, along with the file name. + + :param end: A specific position (line and column) within a source file. + :type end: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, optional + + :param file_name: The name or path of the file containing this location. + :type file_name: str, optional + + :param role: The semantic role associated with this file location. + :type role: str, optional + + :param start: A specific position (line and column) within a source file. + :type start: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, optional + """ + if end is not unset: + kwargs["end"] = end + if file_name is not unset: + kwargs["file_name"] = file_name + if role is not unset: + kwargs["role"] = role + if start is not unset: + kwargs["start"] = start + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_scan_start_timestamp.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_scan_start_timestamp.py new file mode 100644 index 0000000000..a632bc7f4e --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_scan_start_timestamp.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ScaRequestDataAttributesScanStartTimestamp(ModelNormal): + validations = { + "nanos": { + "inclusive_maximum": 2147483647, + }, + } + _nullable = True + + @cached_property + def openapi_types(_): + return { + "nanos": (int,), + "seconds": (int,), + } + + attribute_map = { + "nanos": "nanos", + "seconds": "seconds", + } + + def __init__(self_, nanos: Union[int, UnsetType] = unset, seconds: Union[int, UnsetType] = unset, **kwargs): + """ + The time when the SCA scan started. + + :param nanos: Non-negative fractions of a second at nanosecond resolution. + :type nanos: int, optional + + :param seconds: Seconds of UTC time since Unix epoch. + :type seconds: int, optional + """ + if nanos is not unset: + kwargs["nanos"] = nanos + if seconds is not unset: + kwargs["seconds"] = seconds + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index b168aca54c..42dbac1142 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -8248,6 +8248,9 @@ from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_file_position import ( ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, ) +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_nullable_file_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition, +) from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_position import ( ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, ) @@ -8259,6 +8262,9 @@ ScaRequestDataAttributesRelationsItems, ) from datadog_api_client.v2.model.sca_request_data_attributes_repository import ScaRequestDataAttributesRepository +from datadog_api_client.v2.model.sca_request_data_attributes_scan_start_timestamp import ( + ScaRequestDataAttributesScanStartTimestamp, +) from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( ScaRequestDataAttributesVulnerabilitiesItems, ) @@ -16747,11 +16753,13 @@ "ScaRequestDataAttributesDependenciesItems", "ScaRequestDataAttributesDependenciesItemsLocationsItems", "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + "ScaRequestDataAttributesDependenciesItemsLocationsItemsNullableFilePosition", "ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition", "ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems", "ScaRequestDataAttributesFilesItems", "ScaRequestDataAttributesRelationsItems", "ScaRequestDataAttributesRepository", + "ScaRequestDataAttributesScanStartTimestamp", "ScaRequestDataAttributesVulnerabilitiesItems", "ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems", "ScaRequestDataType", diff --git a/tests/v2/features/static_analysis.feature b/tests/v2/features/static_analysis.feature index 5a662bc9c3..29355638dd 100644 --- a/tests/v2/features/static_analysis.feature +++ b/tests/v2/features/static_analysis.feature @@ -581,7 +581,7 @@ Feature: Static Analysis Scenario: Post dependencies for analysis returns "OK" response Given operation "CreateSCAResult" enabled And new "CreateSCAResult" request - And body with value {"data": {"attributes": {"commit": {}, "dependencies": [{"exclusions": [], "locations": [{"block": {"end": {}, "start": {}}, "name": {"end": {}, "start": {}}, "namespace": {"end": {}, "start": {}}, "version": {"end": {}, "start": {}}}], "reachable_symbol_properties": [{}]}], "files": [{}], "relations": [{"depends_on": []}], "repository": {}, "vulnerabilities": [{"affects": [{}]}]}, "type": "scarequests"}} + And body with value {"data": {"attributes": {"commit": {}, "dependencies": [{"exclusions": [], "group": null, "is_direct": null, "locations": [{"block": {"end": {}, "start": {}}, "name": {"end": {}, "start": {}}, "namespace": {"end": {}, "start": {}}, "version": {"end": {}, "start": {}}}], "reachable_symbol_properties": [{}], "target_frameworks": [], "version": null}], "files": [{}], "relations": [{"depends_on": []}], "repository": {}, "scan_start_timestamp": {}, "vulnerabilities": [{"affects": [{}]}]}, "type": "scarequests"}} When the request is sent Then the response status is 200 OK