Class: SemgrepWebApp::TriageServiceApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/semgrep_web_app/apis/triage_service_api.rb

Overview

TriageServiceApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

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

#bulk_triage(deployment_slug, body) ⇒ ApiResponse

Bulk triage your findings. You can select the findings to triage by passing in a list of finding IDs as issue_ids, or by passing in filter query parameters. You must specify the issue_type of the findings you want to bulk triage. One of new_triage_state or new_note is required. If specifying a new_triage_reason, you must also use new_triage_state=ignored. Some filters only apply for findings associated with a given product. here here

Parameters:

  • deployment_slug (String)

    Required parameter: TODO: type description

  • body (BulkTriageRequest)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/semgrep_web_app/apis/triage_service_api.rb', line 21

def bulk_triage(deployment_slug,
                body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/deployments/{deploymentSlug}/triage',
                                 Server::SEMGREP)
               .template_param(new_parameter(deployment_slug, key: 'deploymentSlug')
                                .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(BulkTriageResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end