Sha256: cfe6aab717dfa9b605be585bdf563de2d869dbd6d348002ba1facb760697dcc9

Contents?: true

Size: 1.12 KB

Versions: 36

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

module Mihari
  module Entities
    class Alert < Grape::Entity
      expose :id,
        documentation: { type: String, required: true,
                         desc: "String representation of the ID" } do |alert, _options|
        alert.id.to_s
      end
      expose :rule_id, documentation: { type: String, required: true }, as: :ruleId
      expose :created_at, documentation: { type: DateTime, required: true }, as: :createdAt

      expose :artifacts, using: Entities::BaseArtifact, documentation: { type: Entities::BaseArtifact, is_array: true }
      expose :tags, using: Entities::Tag, documentation: { type: Entities::Tag, is_array: true, required: true }
    end

    class AlertsWithPagination < Grape::Entity
      expose :alerts, using: Entities::Alert, documentation: { type: Entities::Alert, is_array: true, required: true }
      expose :total, documentation: { type: Integer, required: true }
      expose :current_page, documentation: { type: Integer, required: true }, as: :currentPage
      expose :page_size, documentation: { type: Integer, required: true }, as: :pageSize
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
mihari-6.3.0 lib/mihari/entities/alert.rb
mihari-6.2.0 lib/mihari/entities/alert.rb
mihari-6.1.0 lib/mihari/entities/alert.rb
mihari-6.0.0 lib/mihari/entities/alert.rb
mihari-5.7.2 lib/mihari/entities/alert.rb
mihari-5.7.1 lib/mihari/entities/alert.rb
mihari-5.7.0 lib/mihari/entities/alert.rb
mihari-5.6.2 lib/mihari/entities/alert.rb
mihari-5.6.1 lib/mihari/entities/alert.rb
mihari-5.6.0 lib/mihari/entities/alert.rb
mihari-5.5.0 lib/mihari/entities/alert.rb
mihari-5.4.9 lib/mihari/entities/alert.rb
mihari-5.4.8 lib/mihari/entities/alert.rb
mihari-5.4.7 lib/mihari/entities/alert.rb
mihari-5.4.6 lib/mihari/entities/alert.rb
mihari-5.4.5 lib/mihari/entities/alert.rb
mihari-5.4.4 lib/mihari/entities/alert.rb
mihari-5.4.3 lib/mihari/entities/alert.rb
mihari-5.4.2 lib/mihari/entities/alert.rb
mihari-5.4.1 lib/mihari/entities/alert.rb