Sha256: 652175bbb658906af8a57de338863f3f602a2057e64bef39f71e2a837346d6dc

Contents?: true

Size: 906 Bytes

Versions: 2

Compression:

Stored size: 906 Bytes

Contents

# frozen_string_literal: true

module VirusTotal
  module Client
    module Action
      module Votes
        #
        # Retrieve votes for an object
        #
        # @param [String] id Object identifier
        #
        # @return [Hash]
        #
        def votes(id)
          id = to_id(id)
          _get("/#{name}/#{id}/votes") { |json| json }
        end

        #
        # Add a vote for an object
        #
        # @param [String] id Object identifier
        # @param [String] verdict harmless or malicious
        #
        # @return [Hash]
        #
        def add_vote(id, verdict)
          id = to_id(id)
          params = {
            data: {
              type: "vote",
              attributes: {
                verdict: verdict
              }
            }
          }
          _post("/#{name}/#{id}/votes", params) { |json| json }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virustotalx-1.2.0 lib/virustotal/clients/actions/votes.rb
virustotalx-1.1.0 lib/virustotal/clients/actions/votes.rb