summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/reports/security/scan.rb
blob: 7dd0acc868b9e08a8a4faba85c3942bd01d82429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module Gitlab
  module Ci
    module Reports
      module Security
        class Scan
          attr_accessor :type, :status, :start_time, :end_time

          def initialize(params = {})
            @type = params.dig('type')
            @status = params.dig('status')
            @start_time = params.dig('start_time')
            @end_time = params.dig('end_time')
          end

          def to_hash
            {
              type: type,
              status: status,
              start_time: start_time,
              end_time: end_time
            }.compact
          end
        end
      end
    end
  end
end