diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c1ed29256660..07bda16a9065 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -48002,6 +48002,72 @@ components: required: - name type: object + LicensesListResponse: + description: The top-level response object returned by the licenses list endpoint, containing the array of supported SPDX licenses. + properties: + data: + $ref: "#/components/schemas/LicensesListResponseData" + required: + - data + type: object + LicensesListResponseData: + description: The data object in a licenses list response, containing the list of SPDX licenses. + properties: + attributes: + $ref: "#/components/schemas/LicensesListResponseDataAttributes" + id: + description: The unique identifier for this licenses list response. + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + type: + $ref: "#/components/schemas/LicensesListResponseDataType" + required: + - id + - type + - attributes + type: object + LicensesListResponseDataAttributes: + description: The attributes of the licenses list response, containing the array of SPDX licenses. + properties: + licenses: + $ref: "#/components/schemas/LicensesListResponseDataAttributesLicenses" + required: + - licenses + type: object + LicensesListResponseDataAttributesLicenses: + description: The list of SPDX licenses returned by the API. + items: + $ref: "#/components/schemas/LicensesListResponseDataAttributesLicensesItems" + type: array + LicensesListResponseDataAttributesLicensesItems: + description: An SPDX license entry returned by the licenses list endpoint. + properties: + display_name: + description: The human-readable name of the license. + example: MIT License + type: string + identifier: + description: The SPDX identifier of the license. + example: MIT + type: string + short_name: + description: The short name of the license, typically matching the SPDX identifier. + example: MIT + type: string + required: + - display_name + - identifier + - short_name + type: object + LicensesListResponseDataType: + default: licenserequest + description: The type identifier for license list responses. + enum: + - licenserequest + example: licenserequest + type: string + x-enum-varnames: + - LICENSEREQUEST Links: description: The JSON:API links related to pagination. properties: @@ -50672,6 +50738,144 @@ components: type: string x-enum-varnames: - MANAGED_ORGS + McpScanRequest: + description: The top-level request object for submitting an MCP SCA dependency scan. + properties: + data: + $ref: "#/components/schemas/McpScanRequestData" + required: + - data + type: object + McpScanRequestData: + description: The data object in an MCP SCA scan request, containing the scan attributes and request type. + properties: + attributes: + $ref: "#/components/schemas/McpScanRequestDataAttributes" + id: + description: An optional identifier for this scan request. + type: string + type: + $ref: "#/components/schemas/McpScanRequestDataType" + required: + - type + - attributes + type: object + McpScanRequestDataAttributes: + description: The attributes of an MCP SCA scan request, describing the libraries to scan and their context. + properties: + commit_hash: + description: The commit hash of the source code being scanned. + example: 0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc + type: string + libraries: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibraries" + resource_name: + description: The name of the resource (typically the repository or project name) being scanned. + example: my-org/my-repo + type: string + required: + - resource_name + - commit_hash + - libraries + type: object + McpScanRequestDataAttributesLibraries: + description: The list of libraries to scan for vulnerabilities. + items: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibrariesItems" + type: array + McpScanRequestDataAttributesLibrariesItems: + description: A library declaration to include in the dependency scan. + properties: + exclusions: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibrariesItemsExclusions" + is_dev: + description: Whether this library is a development-only dependency. + example: false + type: boolean + is_direct: + description: Whether this library is a direct (rather than transitive) dependency. + example: true + type: boolean + package_manager: + description: The package manager that produced this library entry (for example, `npm`, `pip`, `nuget`). + example: nuget + type: string + purl: + description: The Package URL (PURL) uniquely identifying the library and its version. + example: pkg:nuget/Newtonsoft.Json@13.0.1 + type: string + target_frameworks: + $ref: "#/components/schemas/McpScanRequestDataAttributesLibrariesItemsTargetFrameworks" + required: + - purl + - is_dev + - is_direct + - package_manager + type: object + McpScanRequestDataAttributesLibrariesItemsExclusions: + description: The list of dependency PURLs to exclude when resolving transitive dependencies for this library. + items: + description: A dependency PURL to exclude. + type: string + type: array + McpScanRequestDataAttributesLibrariesItemsTargetFrameworks: + description: The list of target framework identifiers associated with the library. + items: + description: A target framework identifier (for example, `net8.0`). + type: string + type: array + McpScanRequestDataType: + default: mcpscanrequest + description: The type identifier for MCP SCA scan requests. + enum: + - mcpscanrequest + example: mcpscanrequest + type: string + x-enum-varnames: + - MCPSCANREQUEST + McpScanRequestResponse: + description: The top-level response object returned when an MCP SCA dependency scan request has been accepted. + properties: + data: + $ref: "#/components/schemas/McpScanRequestResponseData" + required: + - data + type: object + McpScanRequestResponseData: + description: The data object returned when a scan request has been accepted. + properties: + attributes: + $ref: "#/components/schemas/McpScanRequestResponseDataAttributes" + id: + description: The job identifier assigned to the scan. + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + type: + $ref: "#/components/schemas/McpScanRequestResponseDataType" + required: + - id + - type + - attributes + type: object + McpScanRequestResponseDataAttributes: + description: The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. + properties: + job_id: + description: The job identifier assigned to the scan, used to retrieve the scan result. + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + required: + - job_id + type: object + McpScanRequestResponseDataType: + default: mcpscanrequestresponse + description: The type identifier for MCP SCA scan request responses. + enum: + - mcpscanrequestresponse + example: mcpscanrequestresponse + type: string + x-enum-varnames: + - MCPSCANREQUESTRESPONSE MemberTeam: description: A member team properties: @@ -67651,7 +67855,7 @@ components: type: object ResolveVulnerableSymbolsResponseDataType: default: resolve-vulnerable-symbols-response - description: The type identifier for responses containing resolved vulnerable symbols. + description: The type identifier for responses containing resolved vulnerable symbols enum: - resolve-vulnerable-symbols-response example: resolve-vulnerable-symbols-response @@ -71369,6 +71573,9 @@ components: type: $ref: "#/components/schemas/ScalarFormulaResponseType" type: object + ScanResultResponse: + description: The raw scan result document produced by the SCA processor. The contents reflect the vulnerabilities and metadata produced for the libraries submitted in the original scan request. + type: object ScannedAssetMetadata: description: The metadata of a scanned asset. properties: @@ -155905,6 +156112,138 @@ paths: tags: - Static Analysis x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/static-analysis-sca/dependencies/scan: + post: + operationId: CreateSCAScan + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + commit_hash: 0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc + libraries: + - exclusions: [] + is_dev: false + is_direct: true + package_manager: nuget + purl: pkg:nuget/Newtonsoft.Json@13.0.1 + target_frameworks: + - net8.0 + resource_name: my-org/my-repo + type: mcpscanrequest + schema: + $ref: "#/components/schemas/McpScanRequest" + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + job_id: 0190a3d4-1234-7000-8000-000000000000 + id: 0190a3d4-1234-7000-8000-000000000000 + type: mcpscanrequestresponse + schema: + $ref: "#/components/schemas/McpScanRequestResponse" + description: Accepted + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Submit libraries for vulnerability scanning + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis-sca/dependencies/scan/{job_id}: + get: + operationId: GetSCAScan + parameters: + - description: The job identifier returned when the scan was submitted. + in: path + name: job_id + required: true + schema: + example: 0190a3d4-1234-7000-8000-000000000000 + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + vulnerabilities: [] + schema: + $ref: "#/components/schemas/ScanResultResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Retrieve a dependency scan result + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis-sca/licenses/list: + get: + operationId: ListSCALicenses + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + licenses: + - display_name: MIT License + identifier: MIT + short_name: MIT + id: 0190a3d4-1234-7000-8000-000000000000 + type: licenserequest + schema: + $ref: "#/components/schemas/LicensesListResponse" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get the list of SPDX licenses + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols: post: operationId: CreateSCAResolveVulnerableSymbols diff --git a/examples/v2/static-analysis/CreateSCAScan.rb b/examples/v2/static-analysis/CreateSCAScan.rb new file mode 100644 index 000000000000..eff0d1c81825 --- /dev/null +++ b/examples/v2/static-analysis/CreateSCAScan.rb @@ -0,0 +1,28 @@ +# Submit libraries for vulnerability scanning returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_sca_scan".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::McpScanRequest.new({ + data: DatadogAPIClient::V2::McpScanRequestData.new({ + attributes: DatadogAPIClient::V2::McpScanRequestDataAttributes.new({ + commit_hash: "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc", + libraries: [ + DatadogAPIClient::V2::McpScanRequestDataAttributesLibrariesItems.new({ + exclusions: [], + is_dev: false, + is_direct: true, + package_manager: "nuget", + purl: "pkg:nuget/Newtonsoft.Json@13.0.1", + target_frameworks: [], + }), + ], + resource_name: "my-org/my-repo", + }), + type: DatadogAPIClient::V2::McpScanRequestDataType::MCPSCANREQUEST, + }), +}) +p api_instance.create_sca_scan(body) diff --git a/examples/v2/static-analysis/GetSCAScan.rb b/examples/v2/static-analysis/GetSCAScan.rb new file mode 100644 index 000000000000..b4066b19d200 --- /dev/null +++ b/examples/v2/static-analysis/GetSCAScan.rb @@ -0,0 +1,8 @@ +# Retrieve a dependency scan result returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_sca_scan".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.get_sca_scan("0190a3d4-1234-7000-8000-000000000000") diff --git a/examples/v2/static-analysis/ListSCALicenses.rb b/examples/v2/static-analysis/ListSCALicenses.rb new file mode 100644 index 000000000000..05e21ca3d905 --- /dev/null +++ b/examples/v2/static-analysis/ListSCALicenses.rb @@ -0,0 +1,8 @@ +# Get the list of SPDX licenses returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_sca_licenses".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.list_sca_licenses() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 0f058611cc2b..5d98450866d7 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4753,6 +4753,12 @@ "v2.CreateSCAResult" => { "body" => "ScaRequest", }, + "v2.CreateSCAScan" => { + "body" => "McpScanRequest", + }, + "v2.GetSCAScan" => { + "job_id" => "String", + }, "v2.CreateSCAResolveVulnerableSymbols" => { "body" => "ResolveVulnerableSymbolsRequest", }, diff --git a/features/v2/static_analysis.feature b/features/v2/static_analysis.feature index 3d690035c187..5a662bc9c322 100644 --- a/features/v2/static_analysis.feature +++ b/features/v2/static_analysis.feature @@ -434,6 +434,13 @@ Feature: Static Analysis When the request is sent Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Get the list of SPDX licenses returns "OK" response + Given operation "ListSCALicenses" enabled + And new "ListSCALicenses" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast Scenario: List AI custom rule revisions returns "Bad Request" response Given operation "ListAiCustomRuleRevisions" enabled @@ -578,6 +585,22 @@ Feature: Static Analysis When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Retrieve a dependency scan result returns "Not Found" response + Given operation "GetSCAScan" enabled + And new "GetSCAScan" request + And request contains "job_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Retrieve a dependency scan result returns "OK" response + Given operation "GetSCAScan" enabled + And new "GetSCAScan" request + And request contains "job_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast Scenario: Revert Custom Rule Revision returns "Bad request" response Given operation "RevertCustomRuleRevision" enabled @@ -679,6 +702,22 @@ Feature: Static Analysis When the request is sent Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Submit libraries for vulnerability scanning returns "Accepted" response + Given operation "CreateSCAScan" enabled + And new "CreateSCAScan" request + And body with value {"data": {"attributes": {"commit_hash": "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc", "libraries": [{"exclusions": [], "is_dev": false, "is_direct": true, "package_manager": "nuget", "purl": "pkg:nuget/Newtonsoft.Json@13.0.1", "target_frameworks": []}], "resource_name": "my-org/my-repo"}, "type": "mcpscanrequest"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Submit libraries for vulnerability scanning returns "Bad Request" response + Given operation "CreateSCAScan" enabled + And new "CreateSCAScan" request + And body with value {"data": {"attributes": {"commit_hash": "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc", "libraries": [{"exclusions": [], "is_dev": false, "is_direct": true, "package_manager": "nuget", "purl": "pkg:nuget/Newtonsoft.Json@13.0.1", "target_frameworks": []}], "resource_name": "my-org/my-repo"}, "type": "mcpscanrequest"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/k9-vm-ast Scenario: Update Custom Ruleset returns "Bad request" response Given operation "UpdateCustomRuleset" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index d86d61c22888..ed3317d68ce5 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -7126,6 +7126,24 @@ "type": "safe" } }, + "CreateSCAScan": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "GetSCAScan": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "ListSCALicenses": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, "CreateSCAResolveVulnerableSymbols": { "tag": "Static Analysis", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index ed737191502f..c8aedd5b2483 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -573,6 +573,7 @@ def initialize "v2.create_custom_ruleset": false, "v2.create_sca_resolve_vulnerable_symbols": false, "v2.create_sca_result": false, + "v2.create_sca_scan": false, "v2.delete_ai_custom_rule": false, "v2.delete_ai_custom_ruleset": false, "v2.delete_ai_memory_violation_result": false, @@ -584,12 +585,14 @@ def initialize "v2.get_custom_rule": false, "v2.get_custom_rule_revision": false, "v2.get_custom_ruleset": false, + "v2.get_sca_scan": false, "v2.list_ai_custom_rule_revisions": false, "v2.list_ai_custom_rulesets": false, "v2.list_ai_memory_violation_results": false, "v2.list_ai_prompts": false, "v2.list_custom_rule_revisions": false, "v2.list_custom_rulesets": false, + "v2.list_sca_licenses": false, "v2.revert_custom_rule_revision": false, "v2.update_ai_custom_ruleset": false, "v2.update_custom_ruleset": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 8d7b3c4198cd..62ad07844847 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3721,6 +3721,11 @@ def overrides "v2.leaked_key_attributes" => "LeakedKeyAttributes", "v2.leaked_key_type" => "LeakedKeyType", "v2.library" => "Library", + "v2.licenses_list_response" => "LicensesListResponse", + "v2.licenses_list_response_data" => "LicensesListResponseData", + "v2.licenses_list_response_data_attributes" => "LicensesListResponseDataAttributes", + "v2.licenses_list_response_data_attributes_licenses_items" => "LicensesListResponseDataAttributesLicensesItems", + "v2.licenses_list_response_data_type" => "LicensesListResponseDataType", "v2.links" => "Links", "v2.list_allocations_response" => "ListAllocationsResponse", "v2.list_apis_response" => "ListAPIsResponse", @@ -4165,6 +4170,15 @@ def overrides "v2.managed_orgs_relationship_to_orgs" => "ManagedOrgsRelationshipToOrgs", "v2.managed_orgs_response" => "ManagedOrgsResponse", "v2.managed_orgs_type" => "ManagedOrgsType", + "v2.mcp_scan_request" => "McpScanRequest", + "v2.mcp_scan_request_data" => "McpScanRequestData", + "v2.mcp_scan_request_data_attributes" => "McpScanRequestDataAttributes", + "v2.mcp_scan_request_data_attributes_libraries_items" => "McpScanRequestDataAttributesLibrariesItems", + "v2.mcp_scan_request_data_type" => "McpScanRequestDataType", + "v2.mcp_scan_request_response" => "McpScanRequestResponse", + "v2.mcp_scan_request_response_data" => "McpScanRequestResponseData", + "v2.mcp_scan_request_response_data_attributes" => "McpScanRequestResponseDataAttributes", + "v2.mcp_scan_request_response_data_type" => "McpScanRequestResponseDataType", "v2.member_team" => "MemberTeam", "v2.member_team_type" => "MemberTeamType", "v2.metadata" => "Metadata", diff --git a/lib/datadog_api_client/v2/api/static_analysis_api.rb b/lib/datadog_api_client/v2/api/static_analysis_api.rb index 2be51c047146..e74695f4c771 100644 --- a/lib/datadog_api_client/v2/api/static_analysis_api.rb +++ b/lib/datadog_api_client/v2/api/static_analysis_api.rb @@ -704,6 +704,76 @@ def create_sca_result_with_http_info(body, opts = {}) return data, status_code, headers end + # Submit libraries for vulnerability scanning. + # + # @see #create_sca_scan_with_http_info + def create_sca_scan(body, opts = {}) + data, _status_code, _headers = create_sca_scan_with_http_info(body, opts) + data + end + + # Submit libraries for vulnerability scanning. + # @param body [McpScanRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(McpScanRequestResponse, Integer, Hash)>] McpScanRequestResponse data, response status code and response headers + def create_sca_scan_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_scan".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_scan") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_scan")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_scan ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_scan" + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/dependencies/scan' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'McpScanRequestResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_sca_scan, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_scan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an AI custom rule. # # @see #delete_ai_custom_rule_with_http_info @@ -1525,6 +1595,74 @@ def get_custom_ruleset_with_http_info(ruleset_name, opts = {}) return data, status_code, headers end + # Retrieve a dependency scan result. + # + # @see #get_sca_scan_with_http_info + def get_sca_scan(job_id, opts = {}) + data, _status_code, _headers = get_sca_scan_with_http_info(job_id, opts) + data + end + + # Retrieve a dependency scan result. + # @param job_id [String] The job identifier returned when the scan was submitted. + # @param opts [Hash] the optional parameters + # @return [Array<(ScanResultResponse, Integer, Hash)>] ScanResultResponse data, response status code and response headers + def get_sca_scan_with_http_info(job_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_sca_scan".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sca_scan") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sca_scan")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_sca_scan ...' + end + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling StaticAnalysisAPI.get_sca_scan" + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/dependencies/scan/{job_id}'.sub('{job_id}', CGI.escape(job_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ScanResultResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_sca_scan, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_sca_scan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List AI custom rule revisions. # # @see #list_ai_custom_rule_revisions_with_http_info @@ -1995,6 +2133,69 @@ def list_custom_rulesets_with_http_info(opts = {}) return data, status_code, headers end + # Get the list of SPDX licenses. + # + # @see #list_sca_licenses_with_http_info + def list_sca_licenses(opts = {}) + data, _status_code, _headers = list_sca_licenses_with_http_info(opts) + data + end + + # Get the list of SPDX licenses. + # @param opts [Hash] the optional parameters + # @return [Array<(LicensesListResponse, Integer, Hash)>] LicensesListResponse data, response status code and response headers + def list_sca_licenses_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_sca_licenses".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_sca_licenses") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_sca_licenses")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_sca_licenses ...' + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/licenses/list' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LicensesListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_sca_licenses, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_sca_licenses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Revert Custom Rule Revision. # # @see #revert_custom_rule_revision_with_http_info diff --git a/lib/datadog_api_client/v2/models/licenses_list_response.rb b/lib/datadog_api_client/v2/models/licenses_list_response.rb new file mode 100644 index 000000000000..94b42bcb4946 --- /dev/null +++ b/lib/datadog_api_client/v2/models/licenses_list_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The top-level response object returned by the licenses list endpoint, containing the array of supported SPDX licenses. + class LicensesListResponse + include BaseGenericModel + + # The data object in a licenses list response, containing the list of SPDX licenses. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LicensesListResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LicensesListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/licenses_list_response_data.rb b/lib/datadog_api_client/v2/models/licenses_list_response_data.rb new file mode 100644 index 000000000000..7d5893693e8b --- /dev/null +++ b/lib/datadog_api_client/v2/models/licenses_list_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object in a licenses list response, containing the list of SPDX licenses. + class LicensesListResponseData + include BaseGenericModel + + # The attributes of the licenses list response, containing the array of SPDX licenses. + attr_reader :attributes + + # The unique identifier for this licenses list response. + attr_reader :id + + # The type identifier for license list responses. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LicensesListResponseDataAttributes', + :'id' => :'String', + :'type' => :'LicensesListResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LicensesListResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/licenses_list_response_data_attributes.rb b/lib/datadog_api_client/v2/models/licenses_list_response_data_attributes.rb new file mode 100644 index 000000000000..3603d5bdd4df --- /dev/null +++ b/lib/datadog_api_client/v2/models/licenses_list_response_data_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the licenses list response, containing the array of SPDX licenses. + class LicensesListResponseDataAttributes + include BaseGenericModel + + # The list of SPDX licenses returned by the API. + attr_reader :licenses + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'licenses' => :'licenses' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'licenses' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LicensesListResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'licenses') + if (value = attributes[:'licenses']).is_a?(Array) + self.licenses = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @licenses.nil? + true + end + + # Custom attribute writer method with validation + # @param licenses [Object] Object to be assigned + # @!visibility private + def licenses=(licenses) + if licenses.nil? + fail ArgumentError, 'invalid value for "licenses", licenses cannot be nil.' + end + @licenses = licenses + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + licenses == o.licenses && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [licenses, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/licenses_list_response_data_attributes_licenses_items.rb b/lib/datadog_api_client/v2/models/licenses_list_response_data_attributes_licenses_items.rb new file mode 100644 index 000000000000..e9174eddcc54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/licenses_list_response_data_attributes_licenses_items.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An SPDX license entry returned by the licenses list endpoint. + class LicensesListResponseDataAttributesLicensesItems + include BaseGenericModel + + # The human-readable name of the license. + attr_reader :display_name + + # The SPDX identifier of the license. + attr_reader :identifier + + # The short name of the license, typically matching the SPDX identifier. + attr_reader :short_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'identifier' => :'identifier', + :'short_name' => :'short_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'identifier' => :'String', + :'short_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LicensesListResponseDataAttributesLicensesItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + end + + if attributes.key?(:'short_name') + self.short_name = attributes[:'short_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @display_name.nil? + return false if @identifier.nil? + return false if @short_name.nil? + true + end + + # Custom attribute writer method with validation + # @param display_name [Object] Object to be assigned + # @!visibility private + def display_name=(display_name) + if display_name.nil? + fail ArgumentError, 'invalid value for "display_name", display_name cannot be nil.' + end + @display_name = display_name + end + + # Custom attribute writer method with validation + # @param identifier [Object] Object to be assigned + # @!visibility private + def identifier=(identifier) + if identifier.nil? + fail ArgumentError, 'invalid value for "identifier", identifier cannot be nil.' + end + @identifier = identifier + end + + # Custom attribute writer method with validation + # @param short_name [Object] Object to be assigned + # @!visibility private + def short_name=(short_name) + if short_name.nil? + fail ArgumentError, 'invalid value for "short_name", short_name cannot be nil.' + end + @short_name = short_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + identifier == o.identifier && + short_name == o.short_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, identifier, short_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/licenses_list_response_data_type.rb b/lib/datadog_api_client/v2/models/licenses_list_response_data_type.rb new file mode 100644 index 000000000000..82fc4fd73897 --- /dev/null +++ b/lib/datadog_api_client/v2/models/licenses_list_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type identifier for license list responses. + class LicensesListResponseDataType + include BaseEnumModel + + LICENSEREQUEST = "licenserequest".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request.rb b/lib/datadog_api_client/v2/models/mcp_scan_request.rb new file mode 100644 index 000000000000..e371a603ad39 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The top-level request object for submitting an MCP SCA dependency scan. + class McpScanRequest + include BaseGenericModel + + # The data object in an MCP SCA scan request, containing the scan attributes and request type. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'McpScanRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_data.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_data.rb new file mode 100644 index 000000000000..094c353c75d0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object in an MCP SCA scan request, containing the scan attributes and request type. + class McpScanRequestData + include BaseGenericModel + + # The attributes of an MCP SCA scan request, describing the libraries to scan and their context. + attr_reader :attributes + + # An optional identifier for this scan request. + attr_accessor :id + + # The type identifier for MCP SCA scan requests. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'McpScanRequestDataAttributes', + :'id' => :'String', + :'type' => :'McpScanRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_data_attributes.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_data_attributes.rb new file mode 100644 index 000000000000..2659caa203ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_data_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an MCP SCA scan request, describing the libraries to scan and their context. + class McpScanRequestDataAttributes + include BaseGenericModel + + # The commit hash of the source code being scanned. + attr_reader :commit_hash + + # The list of libraries to scan for vulnerabilities. + attr_reader :libraries + + # The name of the resource (typically the repository or project name) being scanned. + attr_reader :resource_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commit_hash' => :'commit_hash', + :'libraries' => :'libraries', + :'resource_name' => :'resource_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commit_hash' => :'String', + :'libraries' => :'Array', + :'resource_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'commit_hash') + self.commit_hash = attributes[:'commit_hash'] + end + + if attributes.key?(:'libraries') + if (value = attributes[:'libraries']).is_a?(Array) + self.libraries = value + end + end + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @commit_hash.nil? + return false if @libraries.nil? + return false if @resource_name.nil? + true + end + + # Custom attribute writer method with validation + # @param commit_hash [Object] Object to be assigned + # @!visibility private + def commit_hash=(commit_hash) + if commit_hash.nil? + fail ArgumentError, 'invalid value for "commit_hash", commit_hash cannot be nil.' + end + @commit_hash = commit_hash + end + + # Custom attribute writer method with validation + # @param libraries [Object] Object to be assigned + # @!visibility private + def libraries=(libraries) + if libraries.nil? + fail ArgumentError, 'invalid value for "libraries", libraries cannot be nil.' + end + @libraries = libraries + end + + # Custom attribute writer method with validation + # @param resource_name [Object] Object to be assigned + # @!visibility private + def resource_name=(resource_name) + if resource_name.nil? + fail ArgumentError, 'invalid value for "resource_name", resource_name cannot be nil.' + end + @resource_name = resource_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + commit_hash == o.commit_hash && + libraries == o.libraries && + resource_name == o.resource_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commit_hash, libraries, resource_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_data_attributes_libraries_items.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_data_attributes_libraries_items.rb new file mode 100644 index 000000000000..530e36377514 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_data_attributes_libraries_items.rb @@ -0,0 +1,210 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A library declaration to include in the dependency scan. + class McpScanRequestDataAttributesLibrariesItems + include BaseGenericModel + + # The list of dependency PURLs to exclude when resolving transitive dependencies for this library. + attr_accessor :exclusions + + # Whether this library is a development-only dependency. + attr_reader :is_dev + + # Whether this library is a direct (rather than transitive) dependency. + attr_reader :is_direct + + # The package manager that produced this library entry (for example, `npm`, `pip`, `nuget`). + attr_reader :package_manager + + # The Package URL (PURL) uniquely identifying the library and its version. + attr_reader :purl + + # The list of target framework identifiers associated with the library. + attr_accessor :target_frameworks + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'exclusions' => :'exclusions', + :'is_dev' => :'is_dev', + :'is_direct' => :'is_direct', + :'package_manager' => :'package_manager', + :'purl' => :'purl', + :'target_frameworks' => :'target_frameworks' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'exclusions' => :'Array', + :'is_dev' => :'Boolean', + :'is_direct' => :'Boolean', + :'package_manager' => :'String', + :'purl' => :'String', + :'target_frameworks' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequestDataAttributesLibrariesItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'exclusions') + if (value = attributes[:'exclusions']).is_a?(Array) + self.exclusions = value + end + end + + if attributes.key?(:'is_dev') + self.is_dev = attributes[:'is_dev'] + end + + if attributes.key?(:'is_direct') + self.is_direct = attributes[:'is_direct'] + end + + if attributes.key?(:'package_manager') + self.package_manager = attributes[:'package_manager'] + end + + if attributes.key?(:'purl') + self.purl = attributes[:'purl'] + end + + if attributes.key?(:'target_frameworks') + if (value = attributes[:'target_frameworks']).is_a?(Array) + self.target_frameworks = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @is_dev.nil? + return false if @is_direct.nil? + return false if @package_manager.nil? + return false if @purl.nil? + true + end + + # Custom attribute writer method with validation + # @param is_dev [Object] Object to be assigned + # @!visibility private + def is_dev=(is_dev) + if is_dev.nil? + fail ArgumentError, 'invalid value for "is_dev", is_dev cannot be nil.' + end + @is_dev = is_dev + end + + # Custom attribute writer method with validation + # @param is_direct [Object] Object to be assigned + # @!visibility private + def is_direct=(is_direct) + if is_direct.nil? + fail ArgumentError, 'invalid value for "is_direct", is_direct cannot be nil.' + end + @is_direct = is_direct + end + + # Custom attribute writer method with validation + # @param package_manager [Object] Object to be assigned + # @!visibility private + def package_manager=(package_manager) + if package_manager.nil? + fail ArgumentError, 'invalid value for "package_manager", package_manager cannot be nil.' + end + @package_manager = package_manager + end + + # Custom attribute writer method with validation + # @param purl [Object] Object to be assigned + # @!visibility private + def purl=(purl) + if purl.nil? + fail ArgumentError, 'invalid value for "purl", purl cannot be nil.' + end + @purl = purl + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + exclusions == o.exclusions && + is_dev == o.is_dev && + is_direct == o.is_direct && + package_manager == o.package_manager && + purl == o.purl && + target_frameworks == o.target_frameworks && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [exclusions, is_dev, is_direct, package_manager, purl, target_frameworks, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_data_type.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_data_type.rb new file mode 100644 index 000000000000..c1d50b5e063a --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type identifier for MCP SCA scan requests. + class McpScanRequestDataType + include BaseEnumModel + + MCPSCANREQUEST = "mcpscanrequest".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_response.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_response.rb new file mode 100644 index 000000000000..1e3887fcdf88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The top-level response object returned when an MCP SCA dependency scan request has been accepted. + class McpScanRequestResponse + include BaseGenericModel + + # The data object returned when a scan request has been accepted. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'McpScanRequestResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequestResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_response_data.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_response_data.rb new file mode 100644 index 000000000000..a1f5f8dad8de --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object returned when a scan request has been accepted. + class McpScanRequestResponseData + include BaseGenericModel + + # The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. + attr_reader :attributes + + # The job identifier assigned to the scan. + attr_reader :id + + # The type identifier for MCP SCA scan request responses. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'McpScanRequestResponseDataAttributes', + :'id' => :'String', + :'type' => :'McpScanRequestResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequestResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_response_data_attributes.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_response_data_attributes.rb new file mode 100644 index 000000000000..2f0f292bf6ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_response_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. + class McpScanRequestResponseDataAttributes + include BaseGenericModel + + # The job identifier assigned to the scan, used to retrieve the scan result. + attr_reader :job_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'job_id' => :'job_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'job_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::McpScanRequestResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'job_id') + self.job_id = attributes[:'job_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @job_id.nil? + true + end + + # Custom attribute writer method with validation + # @param job_id [Object] Object to be assigned + # @!visibility private + def job_id=(job_id) + if job_id.nil? + fail ArgumentError, 'invalid value for "job_id", job_id cannot be nil.' + end + @job_id = job_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + job_id == o.job_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [job_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mcp_scan_request_response_data_type.rb b/lib/datadog_api_client/v2/models/mcp_scan_request_response_data_type.rb new file mode 100644 index 000000000000..8905b219c497 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mcp_scan_request_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type identifier for MCP SCA scan request responses. + class McpScanRequestResponseDataType + include BaseEnumModel + + MCPSCANREQUESTRESPONSE = "mcpscanrequestresponse".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb index a45ab9cbbe16..385024cadef3 100644 --- a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb @@ -27,7 +27,7 @@ class ResolveVulnerableSymbolsResponseData # The unique identifier for this response data object. attr_accessor :id - # The type identifier for responses containing resolved vulnerable symbols. + # The type identifier for responses containing resolved vulnerable symbols attr_reader :type attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb index 2d678c236521..ab8e3ab075b8 100644 --- a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # The type identifier for responses containing resolved vulnerable symbols. + # The type identifier for responses containing resolved vulnerable symbols class ResolveVulnerableSymbolsResponseDataType include BaseEnumModel