diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 364018c47d..0c0abab0c7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -39232,6 +39232,121 @@ components: type: string x-enum-varnames: - RULESET + ResolveVulnerableSymbolsRequest: + description: The definition of `ResolveVulnerableSymbolsRequest` object. + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestData' + type: object + ResolveVulnerableSymbolsRequestData: + description: The definition of `ResolveVulnerableSymbolsRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataAttributes' + id: + description: The `ResolveVulnerableSymbolsRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataType' + required: + - type + type: object + ResolveVulnerableSymbolsRequestDataAttributes: + description: The definition of `ResolveVulnerableSymbolsRequestDataAttributes` + object. + properties: + purls: + description: The `attributes` `purls`. + items: + type: string + type: array + type: object + ResolveVulnerableSymbolsRequestDataType: + default: resolve-vulnerable-symbols-request + description: Resolve vulnerable symbols request resource type. + enum: + - resolve-vulnerable-symbols-request + example: resolve-vulnerable-symbols-request + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_REQUEST + ResolveVulnerableSymbolsResponse: + description: The definition of `ResolveVulnerableSymbolsResponse` object. + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseData' + type: object + ResolveVulnerableSymbolsResponseData: + description: The definition of `ResolveVulnerableSymbolsResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataAttributes' + id: + description: The `ResolveVulnerableSymbolsResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataType' + required: + - type + type: object + ResolveVulnerableSymbolsResponseDataAttributes: + description: The definition of `ResolveVulnerableSymbolsResponseDataAttributes` + object. + properties: + results: + description: The `attributes` `results`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResults' + type: array + type: object + ResolveVulnerableSymbolsResponseDataType: + default: resolve-vulnerable-symbols-response + description: Resolve vulnerable symbols response resource type. + enum: + - resolve-vulnerable-symbols-response + example: resolve-vulnerable-symbols-response + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_RESPONSE + ResolveVulnerableSymbolsResponseResults: + description: The definition of `ResolveVulnerableSymbolsResponseResults` object. + properties: + purl: + description: The `items` `purl`. + type: string + vulnerable_symbols: + description: The `items` `vulnerable_symbols`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols: + description: The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbols` + object. + properties: + advisory_id: + description: The `items` `advisory_id`. + type: string + symbols: + description: The `items` `symbols`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols: + description: The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols` + object. + properties: + name: + description: The `items` `name`. + type: string + type: + description: The `items` `type`. + type: string + value: + description: The `items` `value`. + type: string + type: object ResourceFilterAttributes: description: Attributes of a resource filter. example: @@ -41666,6 +41781,243 @@ components: example: report_id type: string type: object + ScaRequest: + description: The definition of `ScaRequest` object. + properties: + data: + $ref: '#/components/schemas/ScaRequestData' + type: object + ScaRequestData: + description: The definition of `ScaRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ScaRequestDataAttributes' + id: + description: The `ScaRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/ScaRequestDataType' + required: + - type + type: object + ScaRequestDataAttributes: + description: The definition of `ScaRequestDataAttributes` object. + properties: + commit: + $ref: '#/components/schemas/ScaRequestDataAttributesCommit' + dependencies: + description: The `attributes` `dependencies`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItems' + type: array + env: + description: The `attributes` `env`. + type: string + files: + description: The `attributes` `files`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesFilesItems' + type: array + relations: + description: The `attributes` `relations`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesRelationsItems' + type: array + repository: + $ref: '#/components/schemas/ScaRequestDataAttributesRepository' + service: + description: The `attributes` `service`. + type: string + tags: + additionalProperties: + type: string + description: The `attributes` `tags`. + type: object + vulnerabilities: + description: The `attributes` `vulnerabilities`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItems' + type: array + type: object + ScaRequestDataAttributesCommit: + description: The definition of `ScaRequestDataAttributesCommit` object. + properties: + author_date: + description: The `commit` `author_date`. + type: string + author_email: + description: The `commit` `author_email`. + type: string + author_name: + description: The `commit` `author_name`. + type: string + branch: + description: The `commit` `branch`. + type: string + committer_email: + description: The `commit` `committer_email`. + type: string + committer_name: + description: The `commit` `committer_name`. + type: string + sha: + description: The `commit` `sha`. + type: string + type: object + ScaRequestDataAttributesDependenciesItems: + description: The definition of `ScaRequestDataAttributesDependenciesItems` object. + properties: + exclusions: + description: The `items` `exclusions`. + items: + type: string + type: array + group: + description: The `items` `group`. + type: string + is_dev: + description: The `items` `is_dev`. + type: boolean + is_direct: + description: The `items` `is_direct`. + type: boolean + language: + description: The `items` `language`. + type: string + locations: + description: The `items` `locations`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItems' + type: array + name: + description: The `items` `name`. + type: string + package_manager: + description: The `items` `package_manager`. + type: string + purl: + description: The `items` `purl`. + type: string + reachable_symbol_properties: + description: The `items` `reachable_symbol_properties`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems' + type: array + version: + description: The `items` `version`. + type: string + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItems: + description: The definition of `ScaRequestDataAttributesDependenciesItemsLocationsItems` + object. + properties: + block: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + name: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + namespace: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + version: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition: + description: A position in a file + properties: + end: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + file_name: + description: The `file_name`. + type: string + start: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition: + description: A position + properties: + col: + description: The `col`. + format: int32 + maximum: 2147483647 + type: integer + line: + description: The `line`. + format: int32 + maximum: 2147483647 + type: integer + type: object + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems: + description: The definition of `ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems` + object. + properties: + name: + description: The `items` `name`. + type: string + value: + description: The `items` `value`. + type: string + type: object + ScaRequestDataAttributesFilesItems: + description: The definition of `ScaRequestDataAttributesFilesItems` object. + properties: + name: + description: The `items` `name`. + type: string + purl: + description: The `items` `purl`. + type: string + type: object + ScaRequestDataAttributesRelationsItems: + description: The definition of `ScaRequestDataAttributesRelationsItems` object. + properties: + depends_on: + description: The `items` `depends_on`. + items: + type: string + type: array + ref: + description: The `items` `ref`. + type: string + type: object + ScaRequestDataAttributesRepository: + description: The definition of `ScaRequestDataAttributesRepository` object. + properties: + url: + description: The `repository` `url`. + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItems: + description: The definition of `ScaRequestDataAttributesVulnerabilitiesItems` + object. + properties: + affects: + description: The `items` `affects`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems' + type: array + bom_ref: + description: The `items` `bom_ref`. + type: string + id: + description: The `items` `id`. + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems: + description: The definition of `ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems` + object. + properties: + ref: + description: The `items` `ref`. + type: string + type: object + ScaRequestDataType: + default: scarequests + description: Scarequests resource type. + enum: + - scarequests + example: scarequests + type: string + x-enum-varnames: + - SCAREQUESTS ScalarColumn: description: A single column in a scalar query response. oneOf: @@ -76575,6 +76927,58 @@ paths: cursorPath: meta.page.after limitParam: body.data.attributes.page.limit resultsPath: data + /api/v2/static-analysis-sca/dependencies: + post: + description: Post dependencies for analysis + operationId: CreateSCAResult + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScaRequest' + required: true + responses: + '200': + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Post dependencies for analysis + tags: + - Static Analysis + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols: + post: + description: Post vulnerable symbols + operationId: CreateSCAResolveVulnerableSymbols + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: POST request to resolve vulnerable symbols + tags: + - Static Analysis + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. @@ -80100,6 +80504,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/tracing/metrics/metrics_namespace/ name: Spans Metrics +- description: API for static analysis + name: Static Analysis - description: "Datadog Synthetics uses simulated user requests and browser rendering to help you ensure uptime,\nidentify regional issues, and track your application performance. Datadog Synthetics tests come in\ntwo different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/)\nand diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index a2f10a006c..11eaae8636 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -515,6 +515,13 @@ datadog\_api\_client.v2.api.spans\_metrics\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.static\_analysis\_api module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.static_analysis_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.synthetics\_api module -------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 6198419440..cb909b0832 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -16916,6 +16916,83 @@ datadog\_api\_client.v2.model.reorder\_ruleset\_resource\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_request module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_request\_data module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_request\_data\_attributes module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_request\_data\_type module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response\_data\_attributes module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response\_data\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response\_results module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response\_results\_vulnerable\_symbols module +--------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_response\_results\_vulnerable\_symbols\_symbols module +------------------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols + :members: + :show-inheritance: + datadog\_api\_client.v2.model.resource\_filter\_attributes module ----------------------------------------------------------------- @@ -18351,6 +18428,111 @@ datadog\_api\_client.v2.model.sbom\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.sca\_request module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_commit module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_commit + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items\_locations\_items module +---------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items\_locations\_items\_file\_position module +-------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_file_position + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items\_locations\_items\_position module +-------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_position + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_dependencies\_items\_reachable\_symbol\_properties\_items module +------------------------------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_files\_items module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_files_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_relations\_items module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_relations_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_repository module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_repository + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_vulnerabilities\_items module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_attributes\_vulnerabilities\_items\_affects\_items module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items_affects_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sca\_request\_data\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sca_request_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.scalar\_column module --------------------------------------------------- diff --git a/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.py b/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.py new file mode 100644 index 0000000000..8e009f382e --- /dev/null +++ b/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.py @@ -0,0 +1,31 @@ +""" +POST request to resolve vulnerable symbols returns "OK" 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.resolve_vulnerable_symbols_request import ResolveVulnerableSymbolsRequest +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data import ResolveVulnerableSymbolsRequestData +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_attributes import ( + ResolveVulnerableSymbolsRequestDataAttributes, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_type import ( + ResolveVulnerableSymbolsRequestDataType, +) + +body = ResolveVulnerableSymbolsRequest( + data=ResolveVulnerableSymbolsRequestData( + attributes=ResolveVulnerableSymbolsRequestDataAttributes( + purls=[], + ), + type=ResolveVulnerableSymbolsRequestDataType.RESOLVE_VULNERABLE_SYMBOLS_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_sca_resolve_vulnerable_symbols"] = True +with ApiClient(configuration) as api_client: + api_instance = StaticAnalysisApi(api_client) + response = api_instance.create_sca_resolve_vulnerable_symbols(body=body) + + print(response) diff --git a/examples/v2/static-analysis/CreateSCAResult.py b/examples/v2/static-analysis/CreateSCAResult.py new file mode 100644 index 0000000000..335cc60222 --- /dev/null +++ b/examples/v2/static-analysis/CreateSCAResult.py @@ -0,0 +1,96 @@ +""" +Post dependencies for analysis returns "OK" 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.sca_request import ScaRequest +from datadog_api_client.v2.model.sca_request_data import ScaRequestData +from datadog_api_client.v2.model.sca_request_data_attributes import ScaRequestDataAttributes +from datadog_api_client.v2.model.sca_request_data_attributes_commit import ScaRequestDataAttributesCommit +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items import ( + ScaRequestDataAttributesDependenciesItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items import ( + ScaRequestDataAttributesDependenciesItemsLocationsItems, +) +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_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, +) +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items import ( + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_files_items import ScaRequestDataAttributesFilesItems +from datadog_api_client.v2.model.sca_request_data_attributes_relations_items import ( + ScaRequestDataAttributesRelationsItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_repository import ScaRequestDataAttributesRepository +from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( + ScaRequestDataAttributesVulnerabilitiesItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items_affects_items import ( + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems, +) +from datadog_api_client.v2.model.sca_request_data_type import ScaRequestDataType + +body = ScaRequest( + data=ScaRequestData( + attributes=ScaRequestDataAttributes( + commit=ScaRequestDataAttributesCommit(), + dependencies=[ + ScaRequestDataAttributesDependenciesItems( + exclusions=[], + locations=[ + ScaRequestDataAttributesDependenciesItemsLocationsItems( + block=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + ), + name=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + ), + namespace=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + ), + version=ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition( + end=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + start=ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(), + ), + ), + ], + reachable_symbol_properties=[ + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems(), + ], + ), + ], + files=[ + ScaRequestDataAttributesFilesItems(), + ], + relations=[ + ScaRequestDataAttributesRelationsItems( + depends_on=[], + ), + ], + repository=ScaRequestDataAttributesRepository(), + vulnerabilities=[ + ScaRequestDataAttributesVulnerabilitiesItems( + affects=[ + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems(), + ], + ), + ], + ), + type=ScaRequestDataType.SCAREQUESTS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_sca_result"] = True +with ApiClient(configuration) as api_client: + api_instance = StaticAnalysisApi(api_client) + api_instance.create_sca_result(body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 508a12fde7..e2814c544e 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -334,6 +334,8 @@ def __init__( "v2.get_slo_report": False, "v2.get_slo_report_job_status": False, "v2.get_spa_recommendations": False, + "v2.create_sca_resolve_vulnerable_symbols": False, + "v2.create_sca_result": False, "v2.add_member_team": False, "v2.list_member_teams": False, "v2.remove_member_team": 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 new file mode 100644 index 0000000000..47e3ba4c65 --- /dev/null +++ b/src/datadog_api_client/v2/api/static_analysis_api.py @@ -0,0 +1,95 @@ +# 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 Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.sca_request import ScaRequest +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response import ResolveVulnerableSymbolsResponse +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request import ResolveVulnerableSymbolsRequest + + +class StaticAnalysisApi: + """ + API for static analysis + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_sca_resolve_vulnerable_symbols_endpoint = _Endpoint( + settings={ + "response_type": (ResolveVulnerableSymbolsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols", + "operation_id": "create_sca_resolve_vulnerable_symbols", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ResolveVulnerableSymbolsRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_sca_result_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/static-analysis-sca/dependencies", + "operation_id": "create_sca_result", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ScaRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_sca_resolve_vulnerable_symbols( + self, + body: ResolveVulnerableSymbolsRequest, + ) -> ResolveVulnerableSymbolsResponse: + """POST request to resolve vulnerable symbols. + + Post vulnerable symbols + + :type body: ResolveVulnerableSymbolsRequest + :rtype: ResolveVulnerableSymbolsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_sca_resolve_vulnerable_symbols_endpoint.call_with_http_info(**kwargs) + + def create_sca_result( + self, + body: ScaRequest, + ) -> None: + """Post dependencies for analysis. + + Post dependencies for analysis + + :type body: ScaRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_sca_result_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index b4af1a208d..3e012bff26 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -71,6 +71,7 @@ from datadog_api_client.v2.api.spa_api import SpaApi from datadog_api_client.v2.api.spans_api import SpansApi from datadog_api_client.v2.api.spans_metrics_api import SpansMetricsApi +from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi from datadog_api_client.v2.api.synthetics_api import SyntheticsApi from datadog_api_client.v2.api.teams_api import TeamsApi from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi @@ -153,6 +154,7 @@ "SpaApi", "SpansApi", "SpansMetricsApi", + "StaticAnalysisApi", "SyntheticsApi", "TeamsApi", "TestOptimizationApi", diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request.py new file mode 100644 index 0000000000..3026066805 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data import ResolveVulnerableSymbolsRequestData + + +class ResolveVulnerableSymbolsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data import ( + ResolveVulnerableSymbolsRequestData, + ) + + return { + "data": (ResolveVulnerableSymbolsRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ResolveVulnerableSymbolsRequestData, UnsetType] = unset, **kwargs): + """ + The definition of ``ResolveVulnerableSymbolsRequest`` object. + + :param data: The definition of ``ResolveVulnerableSymbolsRequestData`` object. + :type data: ResolveVulnerableSymbolsRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data.py new file mode 100644 index 0000000000..8012c2c424 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data.py @@ -0,0 +1,72 @@ +# 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.resolve_vulnerable_symbols_request_data_attributes import ( + ResolveVulnerableSymbolsRequestDataAttributes, + ) + from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_type import ( + ResolveVulnerableSymbolsRequestDataType, + ) + + +class ResolveVulnerableSymbolsRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_attributes import ( + ResolveVulnerableSymbolsRequestDataAttributes, + ) + from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_type import ( + ResolveVulnerableSymbolsRequestDataType, + ) + + return { + "attributes": (ResolveVulnerableSymbolsRequestDataAttributes,), + "id": (str,), + "type": (ResolveVulnerableSymbolsRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: ResolveVulnerableSymbolsRequestDataType, + attributes: Union[ResolveVulnerableSymbolsRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ResolveVulnerableSymbolsRequestData`` object. + + :param attributes: The definition of ``ResolveVulnerableSymbolsRequestDataAttributes`` object. + :type attributes: ResolveVulnerableSymbolsRequestDataAttributes, optional + + :param id: The ``ResolveVulnerableSymbolsRequestData`` ``id``. + :type id: str, optional + + :param type: Resolve vulnerable symbols request resource type. + :type type: ResolveVulnerableSymbolsRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data_attributes.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data_attributes.py new file mode 100644 index 0000000000..a08fbb9598 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data_attributes.py @@ -0,0 +1,36 @@ +# 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 ResolveVulnerableSymbolsRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "purls": ([str],), + } + + attribute_map = { + "purls": "purls", + } + + def __init__(self_, purls: Union[List[str], UnsetType] = unset, **kwargs): + """ + The definition of ``ResolveVulnerableSymbolsRequestDataAttributes`` object. + + :param purls: The ``attributes`` ``purls``. + :type purls: [str], optional + """ + if purls is not unset: + kwargs["purls"] = purls + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data_type.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data_type.py new file mode 100644 index 0000000000..67d272788a --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_request_data_type.py @@ -0,0 +1,37 @@ +# 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 ResolveVulnerableSymbolsRequestDataType(ModelSimple): + """ + Resolve vulnerable symbols request resource type. + + :param value: If omitted defaults to "resolve-vulnerable-symbols-request". Must be one of ["resolve-vulnerable-symbols-request"]. + :type value: str + """ + + allowed_values = { + "resolve-vulnerable-symbols-request", + } + RESOLVE_VULNERABLE_SYMBOLS_REQUEST: ClassVar["ResolveVulnerableSymbolsRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ResolveVulnerableSymbolsRequestDataType.RESOLVE_VULNERABLE_SYMBOLS_REQUEST = ResolveVulnerableSymbolsRequestDataType( + "resolve-vulnerable-symbols-request" +) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response.py new file mode 100644 index 0000000000..0057745d90 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response.py @@ -0,0 +1,46 @@ +# 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.resolve_vulnerable_symbols_response_data import ( + ResolveVulnerableSymbolsResponseData, + ) + + +class ResolveVulnerableSymbolsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data import ( + ResolveVulnerableSymbolsResponseData, + ) + + return { + "data": (ResolveVulnerableSymbolsResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ResolveVulnerableSymbolsResponseData, UnsetType] = unset, **kwargs): + """ + The definition of ``ResolveVulnerableSymbolsResponse`` object. + + :param data: The definition of ``ResolveVulnerableSymbolsResponseData`` object. + :type data: ResolveVulnerableSymbolsResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data.py new file mode 100644 index 0000000000..21e3379ddb --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data.py @@ -0,0 +1,72 @@ +# 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.resolve_vulnerable_symbols_response_data_attributes import ( + ResolveVulnerableSymbolsResponseDataAttributes, + ) + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_type import ( + ResolveVulnerableSymbolsResponseDataType, + ) + + +class ResolveVulnerableSymbolsResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_attributes import ( + ResolveVulnerableSymbolsResponseDataAttributes, + ) + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_type import ( + ResolveVulnerableSymbolsResponseDataType, + ) + + return { + "attributes": (ResolveVulnerableSymbolsResponseDataAttributes,), + "id": (str,), + "type": (ResolveVulnerableSymbolsResponseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: ResolveVulnerableSymbolsResponseDataType, + attributes: Union[ResolveVulnerableSymbolsResponseDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ResolveVulnerableSymbolsResponseData`` object. + + :param attributes: The definition of ``ResolveVulnerableSymbolsResponseDataAttributes`` object. + :type attributes: ResolveVulnerableSymbolsResponseDataAttributes, optional + + :param id: The ``ResolveVulnerableSymbolsResponseData`` ``id``. + :type id: str, optional + + :param type: Resolve vulnerable symbols response resource type. + :type type: ResolveVulnerableSymbolsResponseDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data_attributes.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data_attributes.py new file mode 100644 index 0000000000..2585ac58a3 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data_attributes.py @@ -0,0 +1,46 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results import ( + ResolveVulnerableSymbolsResponseResults, + ) + + +class ResolveVulnerableSymbolsResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results import ( + ResolveVulnerableSymbolsResponseResults, + ) + + return { + "results": ([ResolveVulnerableSymbolsResponseResults],), + } + + attribute_map = { + "results": "results", + } + + def __init__(self_, results: Union[List[ResolveVulnerableSymbolsResponseResults], UnsetType] = unset, **kwargs): + """ + The definition of ``ResolveVulnerableSymbolsResponseDataAttributes`` object. + + :param results: The ``attributes`` ``results``. + :type results: [ResolveVulnerableSymbolsResponseResults], optional + """ + if results is not unset: + kwargs["results"] = results + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data_type.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data_type.py new file mode 100644 index 0000000000..9cd2cf3bb6 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_data_type.py @@ -0,0 +1,37 @@ +# 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 ResolveVulnerableSymbolsResponseDataType(ModelSimple): + """ + Resolve vulnerable symbols response resource type. + + :param value: If omitted defaults to "resolve-vulnerable-symbols-response". Must be one of ["resolve-vulnerable-symbols-response"]. + :type value: str + """ + + allowed_values = { + "resolve-vulnerable-symbols-response", + } + RESOLVE_VULNERABLE_SYMBOLS_RESPONSE: ClassVar["ResolveVulnerableSymbolsResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ResolveVulnerableSymbolsResponseDataType.RESOLVE_VULNERABLE_SYMBOLS_RESPONSE = ResolveVulnerableSymbolsResponseDataType( + "resolve-vulnerable-symbols-response" +) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results.py new file mode 100644 index 0000000000..19c47f3633 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results.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 List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols import ( + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols, + ) + + +class ResolveVulnerableSymbolsResponseResults(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols import ( + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols, + ) + + return { + "purl": (str,), + "vulnerable_symbols": ([ResolveVulnerableSymbolsResponseResultsVulnerableSymbols],), + } + + attribute_map = { + "purl": "purl", + "vulnerable_symbols": "vulnerable_symbols", + } + + def __init__( + self_, + purl: Union[str, UnsetType] = unset, + vulnerable_symbols: Union[List[ResolveVulnerableSymbolsResponseResultsVulnerableSymbols], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ResolveVulnerableSymbolsResponseResults`` object. + + :param purl: The ``items`` ``purl``. + :type purl: str, optional + + :param vulnerable_symbols: The ``items`` ``vulnerable_symbols``. + :type vulnerable_symbols: [ResolveVulnerableSymbolsResponseResultsVulnerableSymbols], optional + """ + if purl is not unset: + kwargs["purl"] = purl + if vulnerable_symbols is not unset: + kwargs["vulnerable_symbols"] = vulnerable_symbols + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results_vulnerable_symbols.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results_vulnerable_symbols.py new file mode 100644 index 0000000000..204813e8d7 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results_vulnerable_symbols.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 List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols import ( + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols, + ) + + +class ResolveVulnerableSymbolsResponseResultsVulnerableSymbols(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols import ( + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols, + ) + + return { + "advisory_id": (str,), + "symbols": ([ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols],), + } + + attribute_map = { + "advisory_id": "advisory_id", + "symbols": "symbols", + } + + def __init__( + self_, + advisory_id: Union[str, UnsetType] = unset, + symbols: Union[List[ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ResolveVulnerableSymbolsResponseResultsVulnerableSymbols`` object. + + :param advisory_id: The ``items`` ``advisory_id``. + :type advisory_id: str, optional + + :param symbols: The ``items`` ``symbols``. + :type symbols: [ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols], optional + """ + if advisory_id is not unset: + kwargs["advisory_id"] = advisory_id + if symbols is not unset: + kwargs["symbols"] = symbols + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.py b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.py new file mode 100644 index 0000000000..bd4e8355d7 --- /dev/null +++ b/src/datadog_api_client/v2/model/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.py @@ -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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "type": (str,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "type": "type", + "value": "value", + } + + def __init__( + self_, + name: Union[str, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + value: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols`` object. + + :param name: The ``items`` ``name``. + :type name: str, optional + + :param type: The ``items`` ``type``. + :type type: str, optional + + :param value: The ``items`` ``value``. + :type value: str, optional + """ + if name is not unset: + kwargs["name"] = name + if type is not unset: + kwargs["type"] = type + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request.py b/src/datadog_api_client/v2/model/sca_request.py new file mode 100644 index 0000000000..5c1a4041f5 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request.py @@ -0,0 +1,42 @@ +# 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 import ScaRequestData + + +class ScaRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data import ScaRequestData + + return { + "data": (ScaRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ScaRequestData, UnsetType] = unset, **kwargs): + """ + The definition of ``ScaRequest`` object. + + :param data: The definition of ``ScaRequestData`` object. + :type data: ScaRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data.py b/src/datadog_api_client/v2/model/sca_request_data.py new file mode 100644 index 0000000000..6766eaf8cd --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data.py @@ -0,0 +1,64 @@ +# 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 import ScaRequestDataAttributes + from datadog_api_client.v2.model.sca_request_data_type import ScaRequestDataType + + +class ScaRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data_attributes import ScaRequestDataAttributes + from datadog_api_client.v2.model.sca_request_data_type import ScaRequestDataType + + return { + "attributes": (ScaRequestDataAttributes,), + "id": (str,), + "type": (ScaRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: ScaRequestDataType, + attributes: Union[ScaRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ScaRequestData`` object. + + :param attributes: The definition of ``ScaRequestDataAttributes`` object. + :type attributes: ScaRequestDataAttributes, optional + + :param id: The ``ScaRequestData`` ``id``. + :type id: str, optional + + :param type: Scarequests resource type. + :type type: ScaRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type 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 new file mode 100644 index 0000000000..2b53398733 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes.py @@ -0,0 +1,136 @@ +# 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 Dict, List, 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_commit import ScaRequestDataAttributesCommit + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items import ( + ScaRequestDataAttributesDependenciesItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_files_items import ScaRequestDataAttributesFilesItems + from datadog_api_client.v2.model.sca_request_data_attributes_relations_items import ( + ScaRequestDataAttributesRelationsItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_repository import ScaRequestDataAttributesRepository + from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( + ScaRequestDataAttributesVulnerabilitiesItems, + ) + + +class ScaRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data_attributes_commit import ScaRequestDataAttributesCommit + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items import ( + ScaRequestDataAttributesDependenciesItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_files_items import ( + ScaRequestDataAttributesFilesItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_relations_items import ( + ScaRequestDataAttributesRelationsItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_repository import ( + ScaRequestDataAttributesRepository, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( + ScaRequestDataAttributesVulnerabilitiesItems, + ) + + return { + "commit": (ScaRequestDataAttributesCommit,), + "dependencies": ([ScaRequestDataAttributesDependenciesItems],), + "env": (str,), + "files": ([ScaRequestDataAttributesFilesItems],), + "relations": ([ScaRequestDataAttributesRelationsItems],), + "repository": (ScaRequestDataAttributesRepository,), + "service": (str,), + "tags": ({str: (str,)},), + "vulnerabilities": ([ScaRequestDataAttributesVulnerabilitiesItems],), + } + + attribute_map = { + "commit": "commit", + "dependencies": "dependencies", + "env": "env", + "files": "files", + "relations": "relations", + "repository": "repository", + "service": "service", + "tags": "tags", + "vulnerabilities": "vulnerabilities", + } + + def __init__( + self_, + commit: Union[ScaRequestDataAttributesCommit, UnsetType] = unset, + dependencies: Union[List[ScaRequestDataAttributesDependenciesItems], UnsetType] = unset, + env: Union[str, UnsetType] = unset, + files: Union[List[ScaRequestDataAttributesFilesItems], UnsetType] = unset, + relations: Union[List[ScaRequestDataAttributesRelationsItems], UnsetType] = unset, + repository: Union[ScaRequestDataAttributesRepository, UnsetType] = unset, + service: Union[str, UnsetType] = unset, + tags: Union[Dict[str, str], UnsetType] = unset, + vulnerabilities: Union[List[ScaRequestDataAttributesVulnerabilitiesItems], UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ScaRequestDataAttributes`` object. + + :param commit: The definition of ``ScaRequestDataAttributesCommit`` object. + :type commit: ScaRequestDataAttributesCommit, optional + + :param dependencies: The ``attributes`` ``dependencies``. + :type dependencies: [ScaRequestDataAttributesDependenciesItems], optional + + :param env: The ``attributes`` ``env``. + :type env: str, optional + + :param files: The ``attributes`` ``files``. + :type files: [ScaRequestDataAttributesFilesItems], optional + + :param relations: The ``attributes`` ``relations``. + :type relations: [ScaRequestDataAttributesRelationsItems], optional + + :param repository: The definition of ``ScaRequestDataAttributesRepository`` object. + :type repository: ScaRequestDataAttributesRepository, optional + + :param service: The ``attributes`` ``service``. + :type service: str, optional + + :param tags: The ``attributes`` ``tags``. + :type tags: {str: (str,)}, optional + + :param vulnerabilities: The ``attributes`` ``vulnerabilities``. + :type vulnerabilities: [ScaRequestDataAttributesVulnerabilitiesItems], optional + """ + if commit is not unset: + kwargs["commit"] = commit + if dependencies is not unset: + kwargs["dependencies"] = dependencies + if env is not unset: + kwargs["env"] = env + if files is not unset: + kwargs["files"] = files + if relations is not unset: + kwargs["relations"] = relations + if repository is not unset: + kwargs["repository"] = repository + if service is not unset: + kwargs["service"] = service + if tags is not unset: + kwargs["tags"] = tags + if vulnerabilities is not unset: + kwargs["vulnerabilities"] = vulnerabilities + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_commit.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_commit.py new file mode 100644 index 0000000000..d851b2ecde --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_commit.py @@ -0,0 +1,88 @@ +# 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 ScaRequestDataAttributesCommit(ModelNormal): + @cached_property + def openapi_types(_): + return { + "author_date": (str,), + "author_email": (str,), + "author_name": (str,), + "branch": (str,), + "committer_email": (str,), + "committer_name": (str,), + "sha": (str,), + } + + attribute_map = { + "author_date": "author_date", + "author_email": "author_email", + "author_name": "author_name", + "branch": "branch", + "committer_email": "committer_email", + "committer_name": "committer_name", + "sha": "sha", + } + + def __init__( + self_, + author_date: Union[str, UnsetType] = unset, + author_email: Union[str, UnsetType] = unset, + author_name: Union[str, UnsetType] = unset, + branch: Union[str, UnsetType] = unset, + committer_email: Union[str, UnsetType] = unset, + committer_name: Union[str, UnsetType] = unset, + sha: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ScaRequestDataAttributesCommit`` object. + + :param author_date: The ``commit`` ``author_date``. + :type author_date: str, optional + + :param author_email: The ``commit`` ``author_email``. + :type author_email: str, optional + + :param author_name: The ``commit`` ``author_name``. + :type author_name: str, optional + + :param branch: The ``commit`` ``branch``. + :type branch: str, optional + + :param committer_email: The ``commit`` ``committer_email``. + :type committer_email: str, optional + + :param committer_name: The ``commit`` ``committer_name``. + :type committer_name: str, optional + + :param sha: The ``commit`` ``sha``. + :type sha: str, optional + """ + if author_date is not unset: + kwargs["author_date"] = author_date + if author_email is not unset: + kwargs["author_email"] = author_email + if author_name is not unset: + kwargs["author_name"] = author_name + if branch is not unset: + kwargs["branch"] = branch + if committer_email is not unset: + kwargs["committer_email"] = committer_email + if committer_name is not unset: + kwargs["committer_name"] = committer_name + if sha is not unset: + kwargs["sha"] = sha + super().__init__(kwargs) 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 new file mode 100644 index 0000000000..d813fc0702 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items.py @@ -0,0 +1,138 @@ +# 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, 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 import ( + ScaRequestDataAttributesDependenciesItemsLocationsItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items import ( + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems, + ) + + +class ScaRequestDataAttributesDependenciesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items import ( + ScaRequestDataAttributesDependenciesItemsLocationsItems, + ) + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items import ( + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems, + ) + + return { + "exclusions": ([str],), + "group": (str,), + "is_dev": (bool,), + "is_direct": (bool,), + "language": (str,), + "locations": ([ScaRequestDataAttributesDependenciesItemsLocationsItems],), + "name": (str,), + "package_manager": (str,), + "purl": (str,), + "reachable_symbol_properties": ([ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems],), + "version": (str,), + } + + attribute_map = { + "exclusions": "exclusions", + "group": "group", + "is_dev": "is_dev", + "is_direct": "is_direct", + "language": "language", + "locations": "locations", + "name": "name", + "package_manager": "package_manager", + "purl": "purl", + "reachable_symbol_properties": "reachable_symbol_properties", + "version": "version", + } + + def __init__( + self_, + exclusions: Union[List[str], UnsetType] = unset, + group: Union[str, UnsetType] = unset, + is_dev: Union[bool, UnsetType] = unset, + is_direct: Union[bool, UnsetType] = unset, + language: Union[str, UnsetType] = unset, + locations: Union[List[ScaRequestDataAttributesDependenciesItemsLocationsItems], UnsetType] = unset, + name: Union[str, 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, + **kwargs, + ): + """ + The definition of ``ScaRequestDataAttributesDependenciesItems`` object. + + :param exclusions: The ``items`` ``exclusions``. + :type exclusions: [str], optional + + :param group: The ``items`` ``group``. + :type group: str, optional + + :param is_dev: The ``items`` ``is_dev``. + :type is_dev: bool, optional + + :param is_direct: The ``items`` ``is_direct``. + :type is_direct: bool, optional + + :param language: The ``items`` ``language``. + :type language: str, optional + + :param locations: The ``items`` ``locations``. + :type locations: [ScaRequestDataAttributesDependenciesItemsLocationsItems], optional + + :param name: The ``items`` ``name``. + :type name: str, optional + + :param package_manager: The ``items`` ``package_manager``. + :type package_manager: str, optional + + :param purl: The ``items`` ``purl``. + :type purl: str, optional + + :param reachable_symbol_properties: The ``items`` ``reachable_symbol_properties``. + :type reachable_symbol_properties: [ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems], optional + + :param version: The ``items`` ``version``. + :type version: str, optional + """ + if exclusions is not unset: + kwargs["exclusions"] = exclusions + if group is not unset: + kwargs["group"] = group + if is_dev is not unset: + kwargs["is_dev"] = is_dev + if is_direct is not unset: + kwargs["is_direct"] = is_direct + if language is not unset: + kwargs["language"] = language + if locations is not unset: + kwargs["locations"] = locations + if name is not unset: + kwargs["name"] = name + 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 version is not unset: + kwargs["version"] = version + 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 new file mode 100644 index 0000000000..e54981ca31 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items.py @@ -0,0 +1,74 @@ +# 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_file_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, + ) + + +class ScaRequestDataAttributesDependenciesItemsLocationsItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items_file_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, + ) + + return { + "block": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), + "name": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), + "namespace": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), + "version": (ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition,), + } + + attribute_map = { + "block": "block", + "name": "name", + "namespace": "namespace", + "version": "version", + } + + def __init__( + self_, + block: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, + name: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, + namespace: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, + version: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ScaRequestDataAttributesDependenciesItemsLocationsItems`` object. + + :param block: A position in a file + :type block: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + + :param name: A position in a file + :type name: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + + :param namespace: A position in a file + :type namespace: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + + :param version: A position in a file + :type version: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, optional + """ + if block is not unset: + kwargs["block"] = block + if name is not unset: + kwargs["name"] = name + if namespace is not unset: + kwargs["namespace"] = namespace + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) 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 new file mode 100644 index 0000000000..d3e3eda983 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_file_position.py @@ -0,0 +1,66 @@ +# 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 ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition(ModelNormal): + @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,), + "start": (ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition,), + } + + attribute_map = { + "end": "end", + "file_name": "file_name", + "start": "start", + } + + def __init__( + self_, + end: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, UnsetType] = unset, + file_name: Union[str, UnsetType] = unset, + start: Union[ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, UnsetType] = unset, + **kwargs, + ): + """ + A position in a file + + :param end: A position + :type end: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, optional + + :param file_name: The ``file_name``. + :type file_name: str, optional + + :param start: A position + :type start: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, optional + """ + if end is not unset: + kwargs["end"] = end + if file_name is not unset: + kwargs["file_name"] = file_name + 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_position.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_position.py new file mode 100644 index 0000000000..e4cca0ed2c --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_locations_items_position.py @@ -0,0 +1,52 @@ +# 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 ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition(ModelNormal): + validations = { + "col": { + "inclusive_maximum": 2147483647, + }, + "line": { + "inclusive_maximum": 2147483647, + }, + } + + @cached_property + def openapi_types(_): + return { + "col": (int,), + "line": (int,), + } + + attribute_map = { + "col": "col", + "line": "line", + } + + def __init__(self_, col: Union[int, UnsetType] = unset, line: Union[int, UnsetType] = unset, **kwargs): + """ + A position + + :param col: The ``col``. + :type col: int, optional + + :param line: The ``line``. + :type line: int, optional + """ + if col is not unset: + kwargs["col"] = col + if line is not unset: + kwargs["line"] = line + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.py new file mode 100644 index 0000000000..6b10ad51b8 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.py @@ -0,0 +1,43 @@ +# 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 ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "value": "value", + } + + def __init__(self_, name: Union[str, UnsetType] = unset, value: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems`` object. + + :param name: The ``items`` ``name``. + :type name: str, optional + + :param value: The ``items`` ``value``. + :type value: str, optional + """ + if name is not unset: + kwargs["name"] = name + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_files_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_files_items.py new file mode 100644 index 0000000000..04e9ec85a3 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_files_items.py @@ -0,0 +1,43 @@ +# 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 ScaRequestDataAttributesFilesItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "purl": (str,), + } + + attribute_map = { + "name": "name", + "purl": "purl", + } + + def __init__(self_, name: Union[str, UnsetType] = unset, purl: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``ScaRequestDataAttributesFilesItems`` object. + + :param name: The ``items`` ``name``. + :type name: str, optional + + :param purl: The ``items`` ``purl``. + :type purl: str, optional + """ + if name is not unset: + kwargs["name"] = name + if purl is not unset: + kwargs["purl"] = purl + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_relations_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_relations_items.py new file mode 100644 index 0000000000..bf84289d43 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_relations_items.py @@ -0,0 +1,43 @@ +# 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 ScaRequestDataAttributesRelationsItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "depends_on": ([str],), + "ref": (str,), + } + + attribute_map = { + "depends_on": "depends_on", + "ref": "ref", + } + + def __init__(self_, depends_on: Union[List[str], UnsetType] = unset, ref: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``ScaRequestDataAttributesRelationsItems`` object. + + :param depends_on: The ``items`` ``depends_on``. + :type depends_on: [str], optional + + :param ref: The ``items`` ``ref``. + :type ref: str, optional + """ + if depends_on is not unset: + kwargs["depends_on"] = depends_on + if ref is not unset: + kwargs["ref"] = ref + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_repository.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_repository.py new file mode 100644 index 0000000000..a76f51d6ef --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_repository.py @@ -0,0 +1,36 @@ +# 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 ScaRequestDataAttributesRepository(ModelNormal): + @cached_property + def openapi_types(_): + return { + "url": (str,), + } + + attribute_map = { + "url": "url", + } + + def __init__(self_, url: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``ScaRequestDataAttributesRepository`` object. + + :param url: The ``repository`` ``url``. + :type url: str, optional + """ + if url is not unset: + kwargs["url"] = url + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_vulnerabilities_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_vulnerabilities_items.py new file mode 100644 index 0000000000..6a8d8d5a4a --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_vulnerabilities_items.py @@ -0,0 +1,66 @@ +# 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, 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_vulnerabilities_items_affects_items import ( + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems, + ) + + +class ScaRequestDataAttributesVulnerabilitiesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items_affects_items import ( + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems, + ) + + return { + "affects": ([ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems],), + "bom_ref": (str,), + "id": (str,), + } + + attribute_map = { + "affects": "affects", + "bom_ref": "bom_ref", + "id": "id", + } + + def __init__( + self_, + affects: Union[List[ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems], UnsetType] = unset, + bom_ref: Union[str, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ScaRequestDataAttributesVulnerabilitiesItems`` object. + + :param affects: The ``items`` ``affects``. + :type affects: [ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems], optional + + :param bom_ref: The ``items`` ``bom_ref``. + :type bom_ref: str, optional + + :param id: The ``items`` ``id``. + :type id: str, optional + """ + if affects is not unset: + kwargs["affects"] = affects + if bom_ref is not unset: + kwargs["bom_ref"] = bom_ref + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_attributes_vulnerabilities_items_affects_items.py b/src/datadog_api_client/v2/model/sca_request_data_attributes_vulnerabilities_items_affects_items.py new file mode 100644 index 0000000000..7609898315 --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_request_data_attributes_vulnerabilities_items_affects_items.py @@ -0,0 +1,36 @@ +# 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 ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "ref": (str,), + } + + attribute_map = { + "ref": "ref", + } + + def __init__(self_, ref: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems`` object. + + :param ref: The ``items`` ``ref``. + :type ref: str, optional + """ + if ref is not unset: + kwargs["ref"] = ref + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sca_request_data_type.py b/src/datadog_api_client/v2/model/sca_request_data_type.py new file mode 100644 index 0000000000..70cf5ca87a --- /dev/null +++ b/src/datadog_api_client/v2/model/sca_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 ScaRequestDataType(ModelSimple): + """ + Scarequests resource type. + + :param value: If omitted defaults to "scarequests". Must be one of ["scarequests"]. + :type value: str + """ + + allowed_values = { + "scarequests", + } + SCAREQUESTS: ClassVar["ScaRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ScaRequestDataType.SCAREQUESTS = ScaRequestDataType("scarequests") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index b6be94c822..58aa279f2e 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3445,6 +3445,31 @@ from datadog_api_client.v2.model.reorder_ruleset_resource_array import ReorderRulesetResourceArray from datadog_api_client.v2.model.reorder_ruleset_resource_data import ReorderRulesetResourceData from datadog_api_client.v2.model.reorder_ruleset_resource_data_type import ReorderRulesetResourceDataType +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request import ResolveVulnerableSymbolsRequest +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data import ResolveVulnerableSymbolsRequestData +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_attributes import ( + ResolveVulnerableSymbolsRequestDataAttributes, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_request_data_type import ( + ResolveVulnerableSymbolsRequestDataType, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response import ResolveVulnerableSymbolsResponse +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data import ResolveVulnerableSymbolsResponseData +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_attributes import ( + ResolveVulnerableSymbolsResponseDataAttributes, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_data_type import ( + ResolveVulnerableSymbolsResponseDataType, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results import ( + ResolveVulnerableSymbolsResponseResults, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols import ( + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols, +) +from datadog_api_client.v2.model.resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols import ( + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols, +) from datadog_api_client.v2.model.resource_filter_attributes import ResourceFilterAttributes from datadog_api_client.v2.model.resource_filter_request_type import ResourceFilterRequestType from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes @@ -3621,6 +3646,37 @@ from datadog_api_client.v2.model.slo_report_status_get_response import SLOReportStatusGetResponse from datadog_api_client.v2.model.slo_report_status_get_response_attributes import SLOReportStatusGetResponseAttributes from datadog_api_client.v2.model.slo_report_status_get_response_data import SLOReportStatusGetResponseData +from datadog_api_client.v2.model.sca_request import ScaRequest +from datadog_api_client.v2.model.sca_request_data import ScaRequestData +from datadog_api_client.v2.model.sca_request_data_attributes import ScaRequestDataAttributes +from datadog_api_client.v2.model.sca_request_data_attributes_commit import ScaRequestDataAttributesCommit +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items import ( + ScaRequestDataAttributesDependenciesItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_locations_items import ( + ScaRequestDataAttributesDependenciesItemsLocationsItems, +) +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_position import ( + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, +) +from datadog_api_client.v2.model.sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items import ( + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_files_items import ScaRequestDataAttributesFilesItems +from datadog_api_client.v2.model.sca_request_data_attributes_relations_items import ( + ScaRequestDataAttributesRelationsItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_repository import ScaRequestDataAttributesRepository +from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items import ( + ScaRequestDataAttributesVulnerabilitiesItems, +) +from datadog_api_client.v2.model.sca_request_data_attributes_vulnerabilities_items_affects_items import ( + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems, +) +from datadog_api_client.v2.model.sca_request_data_type import ScaRequestDataType from datadog_api_client.v2.model.scalar_column import ScalarColumn from datadog_api_client.v2.model.scalar_column_type_group import ScalarColumnTypeGroup from datadog_api_client.v2.model.scalar_column_type_number import ScalarColumnTypeNumber @@ -7059,6 +7115,17 @@ "ReorderRulesetResourceArray", "ReorderRulesetResourceData", "ReorderRulesetResourceDataType", + "ResolveVulnerableSymbolsRequest", + "ResolveVulnerableSymbolsRequestData", + "ResolveVulnerableSymbolsRequestDataAttributes", + "ResolveVulnerableSymbolsRequestDataType", + "ResolveVulnerableSymbolsResponse", + "ResolveVulnerableSymbolsResponseData", + "ResolveVulnerableSymbolsResponseDataAttributes", + "ResolveVulnerableSymbolsResponseDataType", + "ResolveVulnerableSymbolsResponseResults", + "ResolveVulnerableSymbolsResponseResultsVulnerableSymbols", + "ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols", "ResourceFilterAttributes", "ResourceFilterRequestType", "ResponseMetaAttributes", @@ -7219,6 +7286,21 @@ "SLOReportStatusGetResponse", "SLOReportStatusGetResponseAttributes", "SLOReportStatusGetResponseData", + "ScaRequest", + "ScaRequestData", + "ScaRequestDataAttributes", + "ScaRequestDataAttributesCommit", + "ScaRequestDataAttributesDependenciesItems", + "ScaRequestDataAttributesDependenciesItemsLocationsItems", + "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + "ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition", + "ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems", + "ScaRequestDataAttributesFilesItems", + "ScaRequestDataAttributesRelationsItems", + "ScaRequestDataAttributesRepository", + "ScaRequestDataAttributesVulnerabilitiesItems", + "ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems", + "ScaRequestDataType", "ScalarColumn", "ScalarColumnTypeGroup", "ScalarColumnTypeNumber", diff --git a/tests/v2/features/static_analysis.feature b/tests/v2/features/static_analysis.feature new file mode 100644 index 0000000000..85bf4d83ae --- /dev/null +++ b/tests/v2/features/static_analysis.feature @@ -0,0 +1,24 @@ +@endpoint(static-analysis) @endpoint(static-analysis-v2) +Feature: Static Analysis + API for static analysis + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "StaticAnalysis" API + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: POST request to resolve vulnerable symbols returns "OK" response + Given operation "CreateSCAResolveVulnerableSymbols" enabled + And new "CreateSCAResolveVulnerableSymbols" request + And body with value {"data": {"attributes": {"purls": []}, "type": "resolve-vulnerable-symbols-request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-vm-sca + 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"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 6c74e264b6..e4c3b10ed7 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3962,6 +3962,18 @@ "type": "safe" } }, + "CreateSCAResult": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateSCAResolveVulnerableSymbols": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": {