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.12.0 lib/mihari/entities/alert.rb
mihari-4.11.0 lib/mihari/entities/alert.rb
mihari-4.10.0 lib/mihari/entities/alert.rb
mihari-4.9.0 lib/mihari/entities/alert.rb
mihari-4.8.0 lib/mihari/entities/alert.rb
mihari-4.7.4 lib/mihari/entities/alert.rb
mihari-4.7.3 lib/mihari/entities/alert.rb
mihari-4.7.2 lib/mihari/entities/alert.rb
mihari-4.7.1 lib/mihari/entities/alert.rb
mihari-4.7.0 lib/mihari/entities/alert.rb
mihari-4.6.1 lib/mihari/entities/alert.rb
mihari-4.6.0 lib/mihari/entities/alert.rb
mihari-4.5.3 lib/mihari/entities/alert.rb
mihari-4.5.2 lib/mihari/entities/alert.rb
mihari-4.5.1 lib/mihari/entities/alert.rb
mihari-4.5.0 lib/mihari/entities/alert.rb
mihari-4.4.1 lib/mihari/entities/alert.rb
mihari-4.4.0 lib/mihari/entities/alert.rb
mihari-4.3.0 lib/mihari/entities/alert.rb
mihari-4.2.0 lib/mihari/entities/alert.rb