module Quby module Compiler module Entities class AnonymousConditions < Dry::Struct class ConstantRule < Dry::Struct attribute :type, Types::String.constrained(eql: "constant") attribute :value, Types::Bool end class BasedOnValueRule < Dry::Struct attribute :type, Types::String.constrained(eql: "based_on_value") attribute :question_key, Types::String attribute :question_value, Types::String end Rule = ConstantRule | BasedOnValueRule attribute? :hide_pii_from_researchers, Rule.optional attribute? :hide_values_from_professionals, Rule.optional end end end end