Sha256: b9f77e01e5b885221c214a255a6a2344092157ca63f3a45a61324ff99c9b4252

Contents?: true

Size: 1.11 KB

Versions: 30

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module Mihari
  module Entities
    class Alert < Grape::Entity
      expose :id, documentation: { type: Integer, required: true }
      expose :title, documentation: { type: String, required: true }
      expose :description, documentation: { type: String, required: true }
      expose :source, documentation: { type: String, required: true }
      expose :created_at, documentation: { type: DateTime, required: true }, as: :createdAt

      expose :artifacts, using: Entities::Artifact, documentation: { type: Entities::Artifact, 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

30 entries across 30 versions & 1 rubygems

Version Path
mihari-4.1.2 lib/mihari/web/entities/alert.rb
mihari-4.1.1 lib/mihari/web/entities/alert.rb
mihari-4.1.0 lib/mihari/web/entities/alert.rb
mihari-4.0.0 lib/mihari/web/entities/alert.rb
mihari-3.12.0 lib/mihari/web/entities/alert.rb
mihari-3.11.0 lib/mihari/web/entities/alert.rb
mihari-3.10.1 lib/mihari/web/entities/alert.rb
mihari-3.10.0 lib/mihari/web/entities/alert.rb
mihari-3.9.2 lib/mihari/web/entities/alert.rb
mihari-3.9.1 lib/mihari/web/entities/alert.rb