Class: SemgrepWebApp::ScansServiceApi
- Defined in:
- lib/semgrep_web_app/apis/scans_service_api.rb
Overview
ScansServiceApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#scans_service_get_scan(deployment_id, scan_id) ⇒ ApiResponse
Request the details of a scan including the associated deployment, repository, and commit information.
-
#scans_service_search_scans(deployment_id, body) ⇒ ApiResponse
List the scans associated with a particular repository over the past 30 days.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from SemgrepWebApp::BaseApi
Instance Method Details
#scans_service_get_scan(deployment_id, scan_id) ⇒ ApiResponse
Request the details of a scan including the associated deployment, repository, and commit information. here
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/semgrep_web_app/apis/scans_service_api.rb', line 15 def scans_service_get_scan(deployment_id, scan_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api/v1/deployments/{deploymentId}/scan/{scanId}', Server::SEMGREP) .template_param(new_parameter(deployment_id, key: 'deploymentId') .is_required(true) .should_encode(true)) .template_param(new_parameter(scan_id, key: 'scanId') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('SemgrepWebToken'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ProtosOpenapiV1GetScanResponse.method(:from_hash)) .is_api_response(true)) .execute end |
#scans_service_search_scans(deployment_id, body) ⇒ ApiResponse
List the scans associated with a particular repository over the past 30 days. here description here
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/semgrep_web_app/apis/scans_service_api.rb', line 43 def scans_service_search_scans(deployment_id, body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api/v1/deployments/{deploymentId}/scans/search', Server::SEMGREP) .template_param(new_parameter(deployment_id, key: 'deploymentId') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('SemgrepWebToken'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ProtosOpenapiV1SearchScansResponse.method(:from_hash)) .is_api_response(true)) .execute end |