Sha256: 39c49100d53fdc7d4ea6a0ee6bc506c060f772cfcf0a6d9d5c1b2e93fc7c4247
Contents?: true
Size: 1.35 KB
Versions: 6
Compression:
Stored size: 1.35 KB
Contents
require "json" require "dry/struct" module Mihari module Structs module Alert class SearchFilter < Dry::Struct attribute? :artifact_data, Types::String.optional attribute? :description, Types::String.optional attribute? :source, Types::String.optional attribute? :tag_name, Types::String.optional attribute? :title, Types::String.optional attribute? :from_at, Types::DateTime.optional attribute? :to_at, Types::DateTime.optional attribute? :asn, Types::Int.optional attribute? :dns_record, Types::String.optional attribute? :reverse_dns_name, Types::String.optional def has_valid_artifact_filters !(artifact_data || asn || dns_record || reverse_dns_name).nil? end end class SearchFilterWithPagination < SearchFilter attribute? :page, Types::Int.default(1) attribute? :limit, Types::Int.default(10) def without_pagination SearchFilter.new( artifact_data: artifact_data, description: description, from_at: from_at, source: source, tag_name: tag_name, title: title, to_at: to_at, asn: asn, dns_record: dns_record, reverse_dns_name: reverse_dns_name ) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems