From 81b4b0add3ebcf44d7258a84870c524e5038a316 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Jun 2026 08:36:21 +0000 Subject: [PATCH] Regenerate client from commit 665c663 of spec repo --- .generator/schemas/v2/openapi.yaml | 342 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 98 +++++ examples/v2/static-analysis/CreateSCAScan.py | 41 +++ examples/v2/static-analysis/GetSCAScan.py | 16 + .../v2/static-analysis/ListSCALicenses.py | 14 + src/datadog_api_client/configuration.py | 3 + .../v2/api/static_analysis_api.py | 102 ++++++ .../v2/model/licenses_list_response.py | 40 ++ .../v2/model/licenses_list_response_data.py | 58 +++ .../licenses_list_response_data_attributes.py | 44 +++ ...response_data_attributes_licenses_items.py | 45 +++ .../model/licenses_list_response_data_type.py | 35 ++ .../v2/model/mcp_scan_request.py | 40 ++ .../v2/model/mcp_scan_request_data.py | 63 ++++ .../model/mcp_scan_request_data_attributes.py | 62 ++++ ...request_data_attributes_libraries_items.py | 77 ++++ .../v2/model/mcp_scan_request_data_type.py | 35 ++ .../v2/model/mcp_scan_request_response.py | 40 ++ .../model/mcp_scan_request_response_data.py | 60 +++ ...p_scan_request_response_data_attributes.py | 33 ++ .../mcp_scan_request_response_data_type.py | 35 ++ src/datadog_api_client/v2/models/__init__.py | 32 ++ tests/v2/features/static_analysis.feature | 39 ++ tests/v2/features/undo.json | 18 + 24 files changed, 1372 insertions(+) create mode 100644 examples/v2/static-analysis/CreateSCAScan.py create mode 100644 examples/v2/static-analysis/GetSCAScan.py create mode 100644 examples/v2/static-analysis/ListSCALicenses.py create mode 100644 src/datadog_api_client/v2/model/licenses_list_response.py create mode 100644 src/datadog_api_client/v2/model/licenses_list_response_data.py create mode 100644 src/datadog_api_client/v2/model/licenses_list_response_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/licenses_list_response_data_attributes_licenses_items.py create mode 100644 src/datadog_api_client/v2/model/licenses_list_response_data_type.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_data.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_data_attributes_libraries_items.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_data_type.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_response.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_response_data.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_response_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/mcp_scan_request_response_data_type.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b2e0e022c9..13af445bce 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -48991,6 +48991,72 @@ components: required: - name type: object + LicensesListResponse: + description: The top-level response object returned by the licenses list endpoint, containing the array of supported SPDX licenses. + properties: + data: + $ref: "#/components/schemas/LicensesListResponseData" + required: + - data + type: object + LicensesListResponseData: + description: The data object in a licenses list response, containing the list of SPDX licenses. + properties: + attributes: + $ref: "#/components/schemas/LicensesListResponseDataAttributes" + id: + description: The unique identifier for this licenses list response. + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + type: + $ref: "#/components/schemas/LicensesListResponseDataType" + required: + - id + - type + - attributes + type: object + LicensesListResponseDataAttributes: + description: The attributes of the licenses list response, containing the array of SPDX licenses. + properties: + licenses: + $ref: "#/components/schemas/LicensesListResponseDataAttributesLicenses" + required: + - licenses + type: object + LicensesListResponseDataAttributesLicenses: + description: The list of SPDX licenses returned by the API. + items: + $ref: "#/components/schemas/LicensesListResponseDataAttributesLicensesItems" + type: array + LicensesListResponseDataAttributesLicensesItems: + description: An SPDX license entry returned by the licenses list endpoint. + properties: + display_name: + description: The human-readable name of the license. + example: MIT License + type: string + identifier: + description: The SPDX identifier of the license. + example: MIT + type: string + short_name: + description: The short name of the license, typically matching the SPDX identifier. + example: MIT + type: string + required: + - display_name + - identifier + - short_name + type: object + LicensesListResponseDataType: + default: licenserequest + description: The type identifier for license list responses. + enum: + - licenserequest + example: licenserequest + type: string + x-enum-varnames: + - LICENSEREQUEST Links: description: The JSON:API links related to pagination. properties: @@ -51675,6 +51741,144 @@ components: type: string x-enum-varnames: - MANAGED_ORGS + McpScanRequest: + description: The top-level request object for submitting an MCP SCA dependency scan. + properties: + data: + $ref: "#/components/schemas/McpScanRequestData" + required: + - data + type: object + McpScanRequestData: + description: The data object in an MCP SCA scan request, containing the scan attributes and request type. + properties: + attributes: + $ref: "#/components/schemas/McpScanRequestDataAttributes" + id: + description: An optional identifier for this scan request. + type: string + type: + $ref: "#/components/schemas/McpScanRequestDataType" + required: + - type + - attributes + type: object + McpScanRequestDataAttributes: + description: The attributes of an MCP SCA scan request, describing the libraries to scan and their context. + properties: + commit_hash: + description: The commit hash of the source code being scanned. + example: 0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc + type: string + libraries: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibraries" + resource_name: + description: The name of the resource (typically the repository or project name) being scanned. + example: my-org/my-repo + type: string + required: + - resource_name + - commit_hash + - libraries + type: object + McpScanRequestDataAttributesLibraries: + description: The list of libraries to scan for vulnerabilities. + items: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibrariesItems" + type: array + McpScanRequestDataAttributesLibrariesItems: + description: A library declaration to include in the dependency scan. + properties: + exclusions: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibrariesItemsExclusions" + is_dev: + description: Whether this library is a development-only dependency. + example: false + type: boolean + is_direct: + description: Whether this library is a direct (rather than transitive) dependency. + example: true + type: boolean + package_manager: + description: The package manager that produced this library entry (for example, `npm`, `pip`, `nuget`). + example: nuget + type: string + purl: + description: The Package URL (PURL) uniquely identifying the library and its version. + example: pkg:nuget/Newtonsoft.Json@13.0.1 + type: string + target_frameworks: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibrariesItemsTargetFrameworks" + required: + - purl + - is_dev + - is_direct + - package_manager + type: object + McpScanRequestDataAttributesLibrariesItemsExclusions: + description: The list of dependency PURLs to exclude when resolving transitive dependencies for this library. + items: + description: A dependency PURL to exclude. + type: string + type: array + McpScanRequestDataAttributesLibrariesItemsTargetFrameworks: + description: The list of target framework identifiers associated with the library. + items: + description: A target framework identifier (for example, `net8.0`). + type: string + type: array + McpScanRequestDataType: + default: mcpscanrequest + description: The type identifier for MCP SCA scan requests. + enum: + - mcpscanrequest + example: mcpscanrequest + type: string + x-enum-varnames: + - MCPSCANREQUEST + McpScanRequestResponse: + description: The top-level response object returned when an MCP SCA dependency scan request has been accepted. + properties: + data: + $ref: "#/components/schemas/McpScanRequestResponseData" + required: + - data + type: object + McpScanRequestResponseData: + description: The data object returned when a scan request has been accepted. + properties: + attributes: + $ref: "#/components/schemas/McpScanRequestResponseDataAttributes" + id: + description: The job identifier assigned to the scan. + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + type: + $ref: "#/components/schemas/McpScanRequestResponseDataType" + required: + - id + - type + - attributes + type: object + McpScanRequestResponseDataAttributes: + description: The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. + properties: + job_id: + description: The job identifier assigned to the scan, used to retrieve the scan result. + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + required: + - job_id + type: object + McpScanRequestResponseDataType: + default: mcpscanrequestresponse + description: The type identifier for MCP SCA scan request responses. + enum: + - mcpscanrequestresponse + example: mcpscanrequestresponse + type: string + x-enum-varnames: + - MCPSCANREQUESTRESPONSE MemberTeam: description: A member team properties: @@ -72940,6 +73144,12 @@ components: type: $ref: "#/components/schemas/ScalarFormulaResponseType" type: object + ScanResultResponse: + description: |- + The raw scan result document produced by the SCA processor. + The contents reflect the vulnerabilities and metadata produced for the libraries + submitted in the original scan request. + type: object ScannedAssetMetadata: description: The metadata of a scanned asset. properties: @@ -159618,6 +159828,138 @@ paths: tags: - Static Analysis x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/static-analysis-sca/dependencies/scan: + post: + operationId: CreateSCAScan + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + commit_hash: 0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc + libraries: + - exclusions: [] + is_dev: false + is_direct: true + package_manager: nuget + purl: pkg:nuget/Newtonsoft.Json@13.0.1 + target_frameworks: + - net8.0 + resource_name: my-org/my-repo + type: mcpscanrequest + schema: + $ref: "#/components/schemas/McpScanRequest" + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + job_id: 0190a3d4-1234-7000-8000-000000000000 + id: 0190a3d4-1234-7000-8000-000000000000 + type: mcpscanrequestresponse + schema: + $ref: "#/components/schemas/McpScanRequestResponse" + description: Accepted + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Submit libraries for vulnerability scanning + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis-sca/dependencies/scan/{job_id}: + get: + operationId: GetSCAScan + parameters: + - description: The job identifier returned when the scan was submitted. + in: path + name: job_id + required: true + schema: + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + vulnerabilities: [] + schema: + $ref: "#/components/schemas/ScanResultResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Retrieve a dependency scan result + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis-sca/licenses/list: + get: + operationId: ListSCALicenses + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + licenses: + - display_name: MIT License + identifier: MIT + short_name: MIT + id: 0190a3d4-1234-7000-8000-000000000000 + type: licenserequest + schema: + $ref: "#/components/schemas/LicensesListResponse" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get the list of SPDX licenses + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols: post: operationId: CreateSCAResolveVulnerableSymbols diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 673622e05f..2ac76726d7 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -18575,6 +18575,41 @@ datadog\_api\_client.v2.model.library module :members: :show-inheritance: +datadog\_api\_client.v2.model.licenses\_list\_response module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.licenses_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.licenses\_list\_response\_data module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.licenses_list_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.licenses\_list\_response\_data\_attributes module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.licenses_list_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.licenses\_list\_response\_data\_attributes\_licenses\_items module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.licenses_list_response_data_attributes_licenses_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.licenses\_list\_response\_data\_type module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.licenses_list_response_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.links module ------------------------------------------ @@ -21802,6 +21837,69 @@ datadog\_api\_client.v2.model.managed\_orgs\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.mcp\_scan\_request module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_data\_attributes module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_data\_attributes\_libraries\_items module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_data_attributes_libraries_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_data\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_response\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_response\_data\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mcp\_scan\_request\_response\_data\_type module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mcp_scan_request_response_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.member\_team module ------------------------------------------------- diff --git a/examples/v2/static-analysis/CreateSCAScan.py b/examples/v2/static-analysis/CreateSCAScan.py new file mode 100644 index 0000000000..fe38998ea8 --- /dev/null +++ b/examples/v2/static-analysis/CreateSCAScan.py @@ -0,0 +1,41 @@ +""" +Submit libraries for vulnerability scanning returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi +from datadog_api_client.v2.model.mcp_scan_request import McpScanRequest +from datadog_api_client.v2.model.mcp_scan_request_data import McpScanRequestData +from datadog_api_client.v2.model.mcp_scan_request_data_attributes import McpScanRequestDataAttributes +from datadog_api_client.v2.model.mcp_scan_request_data_attributes_libraries_items import ( + McpScanRequestDataAttributesLibrariesItems, +) +from datadog_api_client.v2.model.mcp_scan_request_data_type import McpScanRequestDataType + +body = McpScanRequest( + data=McpScanRequestData( + attributes=McpScanRequestDataAttributes( + commit_hash="0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc", + libraries=[ + McpScanRequestDataAttributesLibrariesItems( + exclusions=[], + is_dev=False, + is_direct=True, + package_manager="nuget", + purl="pkg:nuget/Newtonsoft.Json@13.0.1", + target_frameworks=[], + ), + ], + resource_name="my-org/my-repo", + ), + type=McpScanRequestDataType.MCPSCANREQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_sca_scan"] = True +with ApiClient(configuration) as api_client: + api_instance = StaticAnalysisApi(api_client) + response = api_instance.create_sca_scan(body=body) + + print(response) diff --git a/examples/v2/static-analysis/GetSCAScan.py b/examples/v2/static-analysis/GetSCAScan.py new file mode 100644 index 0000000000..d63d018cf9 --- /dev/null +++ b/examples/v2/static-analysis/GetSCAScan.py @@ -0,0 +1,16 @@ +""" +Retrieve a dependency scan result returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi + +configuration = Configuration() +configuration.unstable_operations["get_sca_scan"] = True +with ApiClient(configuration) as api_client: + api_instance = StaticAnalysisApi(api_client) + response = api_instance.get_sca_scan( + job_id="0190a3d4-1234-7000-8000-000000000000", + ) + + print(response) diff --git a/examples/v2/static-analysis/ListSCALicenses.py b/examples/v2/static-analysis/ListSCALicenses.py new file mode 100644 index 0000000000..f293a8745b --- /dev/null +++ b/examples/v2/static-analysis/ListSCALicenses.py @@ -0,0 +1,14 @@ +""" +Get the list of SPDX licenses returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi + +configuration = Configuration() +configuration.unstable_operations["list_sca_licenses"] = True +with ApiClient(configuration) as api_client: + api_instance = StaticAnalysisApi(api_client) + response = api_instance.list_sca_licenses() + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 2e187d4546..b619841020 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -647,6 +647,7 @@ def __init__( "v2.create_custom_ruleset": False, "v2.create_sca_resolve_vulnerable_symbols": False, "v2.create_sca_result": False, + "v2.create_sca_scan": False, "v2.delete_ai_custom_rule": False, "v2.delete_ai_custom_ruleset": False, "v2.delete_ai_memory_violation_result": False, @@ -658,12 +659,14 @@ def __init__( "v2.get_custom_rule": False, "v2.get_custom_rule_revision": False, "v2.get_custom_ruleset": False, + "v2.get_sca_scan": False, "v2.list_ai_custom_rule_revisions": False, "v2.list_ai_custom_rulesets": False, "v2.list_ai_memory_violation_results": False, "v2.list_ai_prompts": False, "v2.list_custom_rule_revisions": False, "v2.list_custom_rulesets": False, + "v2.list_sca_licenses": False, "v2.revert_custom_rule_revision": False, "v2.update_ai_custom_ruleset": False, "v2.update_custom_ruleset": False, diff --git a/src/datadog_api_client/v2/api/static_analysis_api.py b/src/datadog_api_client/v2/api/static_analysis_api.py index 5cc962e1f7..957284e41e 100644 --- a/src/datadog_api_client/v2/api/static_analysis_api.py +++ b/src/datadog_api_client/v2/api/static_analysis_api.py @@ -15,6 +15,10 @@ unset, ) from datadog_api_client.v2.model.sca_request import ScaRequest +from datadog_api_client.v2.model.mcp_scan_request_response import McpScanRequestResponse +from datadog_api_client.v2.model.mcp_scan_request import McpScanRequest +from datadog_api_client.v2.model.scan_result_response import ScanResultResponse +from datadog_api_client.v2.model.licenses_list_response import LicensesListResponse from datadog_api_client.v2.model.resolve_vulnerable_symbols_response import ResolveVulnerableSymbolsResponse from datadog_api_client.v2.model.resolve_vulnerable_symbols_request import ResolveVulnerableSymbolsRequest from datadog_api_client.v2.model.ai_memory_violation_results_response import AiMemoryViolationResultsResponse @@ -268,6 +272,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_sca_scan_endpoint = _Endpoint( + settings={ + "response_type": (McpScanRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/static-analysis-sca/dependencies/scan", + "operation_id": "create_sca_scan", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (McpScanRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_ai_custom_rule_endpoint = _Endpoint( settings={ "response_type": None, @@ -569,6 +593,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_sca_scan_endpoint = _Endpoint( + settings={ + "response_type": (ScanResultResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/static-analysis-sca/dependencies/scan/{job_id}", + "operation_id": "get_sca_scan", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "job_id": { + "required": True, + "openapi_types": (str,), + "attribute": "job_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_ai_custom_rule_revisions_endpoint = _Endpoint( settings={ "response_type": (AiCustomRuleRevisionsResponse,), @@ -722,6 +769,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_sca_licenses_endpoint = _Endpoint( + settings={ + "response_type": (LicensesListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/static-analysis-sca/licenses/list", + "operation_id": "list_sca_licenses", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._revert_custom_rule_revision_endpoint = _Endpoint( settings={ "response_type": None, @@ -976,6 +1039,20 @@ def create_sca_result( return self._create_sca_result_endpoint.call_with_http_info(**kwargs) + def create_sca_scan( + self, + body: McpScanRequest, + ) -> McpScanRequestResponse: + """Submit libraries for vulnerability scanning. + + :type body: McpScanRequest + :rtype: McpScanRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_sca_scan_endpoint.call_with_http_info(**kwargs) + def delete_ai_custom_rule( self, ruleset_name: str, @@ -1203,6 +1280,21 @@ def get_custom_ruleset( return self._get_custom_ruleset_endpoint.call_with_http_info(**kwargs) + def get_sca_scan( + self, + job_id: str, + ) -> ScanResultResponse: + """Retrieve a dependency scan result. + + :param job_id: The job identifier returned when the scan was submitted. + :type job_id: str + :rtype: ScanResultResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["job_id"] = job_id + + return self._get_sca_scan_endpoint.call_with_http_info(**kwargs) + def list_ai_custom_rule_revisions( self, ruleset_name: str, @@ -1428,6 +1520,16 @@ def list_custom_rulesets( kwargs: Dict[str, Any] = {} return self._list_custom_rulesets_endpoint.call_with_http_info(**kwargs) + def list_sca_licenses( + self, + ) -> LicensesListResponse: + """Get the list of SPDX licenses. + + :rtype: LicensesListResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_sca_licenses_endpoint.call_with_http_info(**kwargs) + def revert_custom_rule_revision( self, ruleset_name: str, diff --git a/src/datadog_api_client/v2/model/licenses_list_response.py b/src/datadog_api_client/v2/model/licenses_list_response.py new file mode 100644 index 0000000000..4c85ae1e07 --- /dev/null +++ b/src/datadog_api_client/v2/model/licenses_list_response.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.licenses_list_response_data import LicensesListResponseData + + +class LicensesListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.licenses_list_response_data import LicensesListResponseData + + return { + "data": (LicensesListResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LicensesListResponseData, **kwargs): + """ + The top-level response object returned by the licenses list endpoint, containing the array of supported SPDX licenses. + + :param data: The data object in a licenses list response, containing the list of SPDX licenses. + :type data: LicensesListResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/licenses_list_response_data.py b/src/datadog_api_client/v2/model/licenses_list_response_data.py new file mode 100644 index 0000000000..c0159dc040 --- /dev/null +++ b/src/datadog_api_client/v2/model/licenses_list_response_data.py @@ -0,0 +1,58 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.licenses_list_response_data_attributes import LicensesListResponseDataAttributes + from datadog_api_client.v2.model.licenses_list_response_data_type import LicensesListResponseDataType + + +class LicensesListResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.licenses_list_response_data_attributes import ( + LicensesListResponseDataAttributes, + ) + from datadog_api_client.v2.model.licenses_list_response_data_type import LicensesListResponseDataType + + return { + "attributes": (LicensesListResponseDataAttributes,), + "id": (str,), + "type": (LicensesListResponseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: LicensesListResponseDataAttributes, id: str, type: LicensesListResponseDataType, **kwargs + ): + """ + The data object in a licenses list response, containing the list of SPDX licenses. + + :param attributes: The attributes of the licenses list response, containing the array of SPDX licenses. + :type attributes: LicensesListResponseDataAttributes + + :param id: The unique identifier for this licenses list response. + :type id: str + + :param type: The type identifier for license list responses. + :type type: LicensesListResponseDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/licenses_list_response_data_attributes.py b/src/datadog_api_client/v2/model/licenses_list_response_data_attributes.py new file mode 100644 index 0000000000..a5086bddae --- /dev/null +++ b/src/datadog_api_client/v2/model/licenses_list_response_data_attributes.py @@ -0,0 +1,44 @@ +# 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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.licenses_list_response_data_attributes_licenses_items import ( + LicensesListResponseDataAttributesLicensesItems, + ) + + +class LicensesListResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.licenses_list_response_data_attributes_licenses_items import ( + LicensesListResponseDataAttributesLicensesItems, + ) + + return { + "licenses": ([LicensesListResponseDataAttributesLicensesItems],), + } + + attribute_map = { + "licenses": "licenses", + } + + def __init__(self_, licenses: List[LicensesListResponseDataAttributesLicensesItems], **kwargs): + """ + The attributes of the licenses list response, containing the array of SPDX licenses. + + :param licenses: The list of SPDX licenses returned by the API. + :type licenses: [LicensesListResponseDataAttributesLicensesItems] + """ + super().__init__(kwargs) + + self_.licenses = licenses diff --git a/src/datadog_api_client/v2/model/licenses_list_response_data_attributes_licenses_items.py b/src/datadog_api_client/v2/model/licenses_list_response_data_attributes_licenses_items.py new file mode 100644 index 0000000000..88126b6574 --- /dev/null +++ b/src/datadog_api_client/v2/model/licenses_list_response_data_attributes_licenses_items.py @@ -0,0 +1,45 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class LicensesListResponseDataAttributesLicensesItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "display_name": (str,), + "identifier": (str,), + "short_name": (str,), + } + + attribute_map = { + "display_name": "display_name", + "identifier": "identifier", + "short_name": "short_name", + } + + def __init__(self_, display_name: str, identifier: str, short_name: str, **kwargs): + """ + An SPDX license entry returned by the licenses list endpoint. + + :param display_name: The human-readable name of the license. + :type display_name: str + + :param identifier: The SPDX identifier of the license. + :type identifier: str + + :param short_name: The short name of the license, typically matching the SPDX identifier. + :type short_name: str + """ + super().__init__(kwargs) + + self_.display_name = display_name + self_.identifier = identifier + self_.short_name = short_name diff --git a/src/datadog_api_client/v2/model/licenses_list_response_data_type.py b/src/datadog_api_client/v2/model/licenses_list_response_data_type.py new file mode 100644 index 0000000000..01be9c9912 --- /dev/null +++ b/src/datadog_api_client/v2/model/licenses_list_response_data_type.py @@ -0,0 +1,35 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LicensesListResponseDataType(ModelSimple): + """ + The type identifier for license list responses. + + :param value: If omitted defaults to "licenserequest". Must be one of ["licenserequest"]. + :type value: str + """ + + allowed_values = { + "licenserequest", + } + LICENSEREQUEST: ClassVar["LicensesListResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LicensesListResponseDataType.LICENSEREQUEST = LicensesListResponseDataType("licenserequest") diff --git a/src/datadog_api_client/v2/model/mcp_scan_request.py b/src/datadog_api_client/v2/model/mcp_scan_request.py new file mode 100644 index 0000000000..b437b29961 --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mcp_scan_request_data import McpScanRequestData + + +class McpScanRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mcp_scan_request_data import McpScanRequestData + + return { + "data": (McpScanRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: McpScanRequestData, **kwargs): + """ + The top-level request object for submitting an MCP SCA dependency scan. + + :param data: The data object in an MCP SCA scan request, containing the scan attributes and request type. + :type data: McpScanRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_data.py b/src/datadog_api_client/v2/model/mcp_scan_request_data.py new file mode 100644 index 0000000000..9e72bedb80 --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_data.py @@ -0,0 +1,63 @@ +# 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.mcp_scan_request_data_attributes import McpScanRequestDataAttributes + from datadog_api_client.v2.model.mcp_scan_request_data_type import McpScanRequestDataType + + +class McpScanRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mcp_scan_request_data_attributes import McpScanRequestDataAttributes + from datadog_api_client.v2.model.mcp_scan_request_data_type import McpScanRequestDataType + + return { + "attributes": (McpScanRequestDataAttributes,), + "id": (str,), + "type": (McpScanRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: McpScanRequestDataAttributes, + type: McpScanRequestDataType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The data object in an MCP SCA scan request, containing the scan attributes and request type. + + :param attributes: The attributes of an MCP SCA scan request, describing the libraries to scan and their context. + :type attributes: McpScanRequestDataAttributes + + :param id: An optional identifier for this scan request. + :type id: str, optional + + :param type: The type identifier for MCP SCA scan requests. + :type type: McpScanRequestDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_data_attributes.py b/src/datadog_api_client/v2/model/mcp_scan_request_data_attributes.py new file mode 100644 index 0000000000..e598a733f7 --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_data_attributes.py @@ -0,0 +1,62 @@ +# 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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mcp_scan_request_data_attributes_libraries_items import ( + McpScanRequestDataAttributesLibrariesItems, + ) + + +class McpScanRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mcp_scan_request_data_attributes_libraries_items import ( + McpScanRequestDataAttributesLibrariesItems, + ) + + return { + "commit_hash": (str,), + "libraries": ([McpScanRequestDataAttributesLibrariesItems],), + "resource_name": (str,), + } + + attribute_map = { + "commit_hash": "commit_hash", + "libraries": "libraries", + "resource_name": "resource_name", + } + + def __init__( + self_, + commit_hash: str, + libraries: List[McpScanRequestDataAttributesLibrariesItems], + resource_name: str, + **kwargs, + ): + """ + The attributes of an MCP SCA scan request, describing the libraries to scan and their context. + + :param commit_hash: The commit hash of the source code being scanned. + :type commit_hash: str + + :param libraries: The list of libraries to scan for vulnerabilities. + :type libraries: [McpScanRequestDataAttributesLibrariesItems] + + :param resource_name: The name of the resource (typically the repository or project name) being scanned. + :type resource_name: str + """ + super().__init__(kwargs) + + self_.commit_hash = commit_hash + self_.libraries = libraries + self_.resource_name = resource_name diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_data_attributes_libraries_items.py b/src/datadog_api_client/v2/model/mcp_scan_request_data_attributes_libraries_items.py new file mode 100644 index 0000000000..c6af80971e --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_data_attributes_libraries_items.py @@ -0,0 +1,77 @@ +# 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 List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class McpScanRequestDataAttributesLibrariesItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "exclusions": ([str],), + "is_dev": (bool,), + "is_direct": (bool,), + "package_manager": (str,), + "purl": (str,), + "target_frameworks": ([str],), + } + + attribute_map = { + "exclusions": "exclusions", + "is_dev": "is_dev", + "is_direct": "is_direct", + "package_manager": "package_manager", + "purl": "purl", + "target_frameworks": "target_frameworks", + } + + def __init__( + self_, + is_dev: bool, + is_direct: bool, + package_manager: str, + purl: str, + exclusions: Union[List[str], UnsetType] = unset, + target_frameworks: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + A library declaration to include in the dependency scan. + + :param exclusions: The list of dependency PURLs to exclude when resolving transitive dependencies for this library. + :type exclusions: [str], optional + + :param is_dev: Whether this library is a development-only dependency. + :type is_dev: bool + + :param is_direct: Whether this library is a direct (rather than transitive) dependency. + :type is_direct: bool + + :param package_manager: The package manager that produced this library entry (for example, ``npm`` , ``pip`` , ``nuget`` ). + :type package_manager: str + + :param purl: The Package URL (PURL) uniquely identifying the library and its version. + :type purl: str + + :param target_frameworks: The list of target framework identifiers associated with the library. + :type target_frameworks: [str], optional + """ + if exclusions is not unset: + kwargs["exclusions"] = exclusions + if target_frameworks is not unset: + kwargs["target_frameworks"] = target_frameworks + super().__init__(kwargs) + + self_.is_dev = is_dev + self_.is_direct = is_direct + self_.package_manager = package_manager + self_.purl = purl diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_data_type.py b/src/datadog_api_client/v2/model/mcp_scan_request_data_type.py new file mode 100644 index 0000000000..826921fba7 --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_data_type.py @@ -0,0 +1,35 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class McpScanRequestDataType(ModelSimple): + """ + The type identifier for MCP SCA scan requests. + + :param value: If omitted defaults to "mcpscanrequest". Must be one of ["mcpscanrequest"]. + :type value: str + """ + + allowed_values = { + "mcpscanrequest", + } + MCPSCANREQUEST: ClassVar["McpScanRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +McpScanRequestDataType.MCPSCANREQUEST = McpScanRequestDataType("mcpscanrequest") diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_response.py b/src/datadog_api_client/v2/model/mcp_scan_request_response.py new file mode 100644 index 0000000000..ed4ee52a96 --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_response.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mcp_scan_request_response_data import McpScanRequestResponseData + + +class McpScanRequestResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mcp_scan_request_response_data import McpScanRequestResponseData + + return { + "data": (McpScanRequestResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: McpScanRequestResponseData, **kwargs): + """ + The top-level response object returned when an MCP SCA dependency scan request has been accepted. + + :param data: The data object returned when a scan request has been accepted. + :type data: McpScanRequestResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_response_data.py b/src/datadog_api_client/v2/model/mcp_scan_request_response_data.py new file mode 100644 index 0000000000..919947347f --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_response_data.py @@ -0,0 +1,60 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mcp_scan_request_response_data_attributes import ( + McpScanRequestResponseDataAttributes, + ) + from datadog_api_client.v2.model.mcp_scan_request_response_data_type import McpScanRequestResponseDataType + + +class McpScanRequestResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mcp_scan_request_response_data_attributes import ( + McpScanRequestResponseDataAttributes, + ) + from datadog_api_client.v2.model.mcp_scan_request_response_data_type import McpScanRequestResponseDataType + + return { + "attributes": (McpScanRequestResponseDataAttributes,), + "id": (str,), + "type": (McpScanRequestResponseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: McpScanRequestResponseDataAttributes, id: str, type: McpScanRequestResponseDataType, **kwargs + ): + """ + The data object returned when a scan request has been accepted. + + :param attributes: The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. + :type attributes: McpScanRequestResponseDataAttributes + + :param id: The job identifier assigned to the scan. + :type id: str + + :param type: The type identifier for MCP SCA scan request responses. + :type type: McpScanRequestResponseDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_response_data_attributes.py b/src/datadog_api_client/v2/model/mcp_scan_request_response_data_attributes.py new file mode 100644 index 0000000000..43d019ba9b --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_response_data_attributes.py @@ -0,0 +1,33 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class McpScanRequestResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "job_id": (str,), + } + + attribute_map = { + "job_id": "job_id", + } + + def __init__(self_, job_id: str, **kwargs): + """ + The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. + + :param job_id: The job identifier assigned to the scan, used to retrieve the scan result. + :type job_id: str + """ + super().__init__(kwargs) + + self_.job_id = job_id diff --git a/src/datadog_api_client/v2/model/mcp_scan_request_response_data_type.py b/src/datadog_api_client/v2/model/mcp_scan_request_response_data_type.py new file mode 100644 index 0000000000..cf5bab880b --- /dev/null +++ b/src/datadog_api_client/v2/model/mcp_scan_request_response_data_type.py @@ -0,0 +1,35 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class McpScanRequestResponseDataType(ModelSimple): + """ + The type identifier for MCP SCA scan request responses. + + :param value: If omitted defaults to "mcpscanrequestresponse". Must be one of ["mcpscanrequestresponse"]. + :type value: str + """ + + allowed_values = { + "mcpscanrequestresponse", + } + MCPSCANREQUESTRESPONSE: ClassVar["McpScanRequestResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +McpScanRequestResponseDataType.MCPSCANREQUESTRESPONSE = McpScanRequestResponseDataType("mcpscanrequestresponse") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0b13e607c9..fea806ca67 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3861,6 +3861,13 @@ from datadog_api_client.v2.model.leaked_key_attributes import LeakedKeyAttributes from datadog_api_client.v2.model.leaked_key_type import LeakedKeyType from datadog_api_client.v2.model.library import Library +from datadog_api_client.v2.model.licenses_list_response import LicensesListResponse +from datadog_api_client.v2.model.licenses_list_response_data import LicensesListResponseData +from datadog_api_client.v2.model.licenses_list_response_data_attributes import LicensesListResponseDataAttributes +from datadog_api_client.v2.model.licenses_list_response_data_attributes_licenses_items import ( + LicensesListResponseDataAttributesLicensesItems, +) +from datadog_api_client.v2.model.licenses_list_response_data_type import LicensesListResponseDataType from datadog_api_client.v2.model.links import Links from datadog_api_client.v2.model.list_apis_response import ListAPIsResponse from datadog_api_client.v2.model.list_apis_response_data import ListAPIsResponseData @@ -4086,6 +4093,17 @@ from datadog_api_client.v2.model.managed_orgs_relationships import ManagedOrgsRelationships from datadog_api_client.v2.model.managed_orgs_response import ManagedOrgsResponse from datadog_api_client.v2.model.managed_orgs_type import ManagedOrgsType +from datadog_api_client.v2.model.mcp_scan_request import McpScanRequest +from datadog_api_client.v2.model.mcp_scan_request_data import McpScanRequestData +from datadog_api_client.v2.model.mcp_scan_request_data_attributes import McpScanRequestDataAttributes +from datadog_api_client.v2.model.mcp_scan_request_data_attributes_libraries_items import ( + McpScanRequestDataAttributesLibrariesItems, +) +from datadog_api_client.v2.model.mcp_scan_request_data_type import McpScanRequestDataType +from datadog_api_client.v2.model.mcp_scan_request_response import McpScanRequestResponse +from datadog_api_client.v2.model.mcp_scan_request_response_data import McpScanRequestResponseData +from datadog_api_client.v2.model.mcp_scan_request_response_data_attributes import McpScanRequestResponseDataAttributes +from datadog_api_client.v2.model.mcp_scan_request_response_data_type import McpScanRequestResponseDataType from datadog_api_client.v2.model.member_team import MemberTeam from datadog_api_client.v2.model.member_team_type import MemberTeamType from datadog_api_client.v2.model.metadata import Metadata @@ -11484,6 +11502,11 @@ "LeakedKeyAttributes", "LeakedKeyType", "Library", + "LicensesListResponse", + "LicensesListResponseData", + "LicensesListResponseDataAttributes", + "LicensesListResponseDataAttributesLicensesItems", + "LicensesListResponseDataType", "Links", "ListAPIsResponse", "ListAPIsResponseData", @@ -11677,6 +11700,15 @@ "ManagedOrgsRelationships", "ManagedOrgsResponse", "ManagedOrgsType", + "McpScanRequest", + "McpScanRequestData", + "McpScanRequestDataAttributes", + "McpScanRequestDataAttributesLibrariesItems", + "McpScanRequestDataType", + "McpScanRequestResponse", + "McpScanRequestResponseData", + "McpScanRequestResponseDataAttributes", + "McpScanRequestResponseDataType", "MemberTeam", "MemberTeamType", "Metadata", diff --git a/tests/v2/features/static_analysis.feature b/tests/v2/features/static_analysis.feature index 3d690035c1..5a662bc9c3 100644 --- a/tests/v2/features/static_analysis.feature +++ b/tests/v2/features/static_analysis.feature @@ -434,6 +434,13 @@ Feature: Static Analysis When the request is sent Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Get the list of SPDX licenses returns "OK" response + Given operation "ListSCALicenses" enabled + And new "ListSCALicenses" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast Scenario: List AI custom rule revisions returns "Bad Request" response Given operation "ListAiCustomRuleRevisions" enabled @@ -578,6 +585,22 @@ Feature: Static Analysis When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Retrieve a dependency scan result returns "Not Found" response + Given operation "GetSCAScan" enabled + And new "GetSCAScan" request + And request contains "job_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Retrieve a dependency scan result returns "OK" response + Given operation "GetSCAScan" enabled + And new "GetSCAScan" request + And request contains "job_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast Scenario: Revert Custom Rule Revision returns "Bad request" response Given operation "RevertCustomRuleRevision" enabled @@ -679,6 +702,22 @@ Feature: Static Analysis When the request is sent Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Submit libraries for vulnerability scanning returns "Accepted" response + Given operation "CreateSCAScan" enabled + And new "CreateSCAScan" request + And body with value {"data": {"attributes": {"commit_hash": "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc", "libraries": [{"exclusions": [], "is_dev": false, "is_direct": true, "package_manager": "nuget", "purl": "pkg:nuget/Newtonsoft.Json@13.0.1", "target_frameworks": []}], "resource_name": "my-org/my-repo"}, "type": "mcpscanrequest"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Submit libraries for vulnerability scanning returns "Bad Request" response + Given operation "CreateSCAScan" enabled + And new "CreateSCAScan" request + And body with value {"data": {"attributes": {"commit_hash": "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc", "libraries": [{"exclusions": [], "is_dev": false, "is_direct": true, "package_manager": "nuget", "purl": "pkg:nuget/Newtonsoft.Json@13.0.1", "target_frameworks": []}], "resource_name": "my-org/my-repo"}, "type": "mcpscanrequest"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/k9-vm-ast Scenario: Update Custom Ruleset returns "Bad request" response Given operation "UpdateCustomRuleset" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index f1a04b48a1..b2a00d8c1d 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7285,6 +7285,24 @@ "type": "safe" } }, + "CreateSCAScan": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "GetSCAScan": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "ListSCALicenses": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, "CreateSCAResolveVulnerableSymbols": { "tag": "Static Analysis", "undo": {