Sha256: b35e66556a990492a9387f16e992cd084344f78645f96c491905c070221491bd

Contents?: true

Size: 1.58 KB

Versions: 25

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

module Mihari
  module Entities
    class Query < Grape::Entity
      expose :analyzer, documentation: { type: String, required: true }
      expose :query, documentation: { type: String, required: true }
      expose :interval, documentation: { type: Integer, required: false }
    end

    class Emitter < Grape::Entity
      expose :emitter, documentation: { type: String, required: true }
    end

    class Rule < Grape::Entity
      expose :id, documentation: { type: String, required: true }
      expose :title, documentation: { type: String, required: true }
      expose :description, documentation: { type: String, required: true }
      expose :yaml, documentation: { type: String, required: true }
      expose :created_at, documentation: { type: DateTime, required: true }, as: :createdAt
      expose :updated_at, documentation: { type: DateTime, required: true }, as: :updatedAt

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

    class RulesWithPagination < Grape::Entity
      expose :rules, using: Entities::Rule, documentation: { type: Entities::Rule, 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

    class RuleIDs < Grape::Entity
      expose :rule_ids, documentation: { type: [String], required: true }, as: :ruleIds
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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