Sha256: 54a48034332a0e0a9b5d0ea79e2eca63c1ac46305171e5b5dca08d99f94b3b31

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module VirusTotal
  module Client
    class File < Base
      def report(resource, allinfo: nil)
        params = { resource: resource, allinfo: allinfo }.compact
        post("/file/report", params) { |json| json }
      end

      def scan(path)
        name = ::File.basename(path)
        data = ::File.read(path)
        post_with_file("/file/scan", filename: name, file: data) { |json| json }
      end

      def rescan(resource)
        post("/file/rescan", resource: resource) { |json| json }
      end

      def upload_url
        get("/file/scan/upload_url") { |location| location }
      end

      def download(hash)
        get("/file/download", hash: hash) { |raw| raw }
      end

      def behaviour(hash)
        get("/file/behaviour", hash: hash) { |json| json }
      end

      def network_traffic(hash)
        get("/file/network-traffic", hash: hash) { |json| json }
      end

      def clusters(date)
        get("/file/clusters", date: date) { |json| json }
      end

      def search(query, offset: nil)
        params = { query: query, offset: offset }.compact
        get("/file/search", params) { |json| json }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
virustotalx-0.1.0 lib/virustotal/clients/file.rb