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