# frozen_string_literal: true module DjiMqttConnect module Thing::Product class RequestsMessage < DjiMqttConnect::Message attribute :tid, Types::UUID attribute :bid, Types::UUID attribute :timestamp, Types::Timestamp # Can be determined from the topic, but included for convenience attribute? :gateway, Types::SerialNumber attribute :_data, Types::Hash attribute :_method, Types::String attribute :data, Types::Hash.default({}.freeze) def humanized_summary Translations.thing_product_requests_summary(_method, **humanized_summary_interpolation) end def humanized_summary_interpolation data.to_h.merge(method: _method) end # All the flight IDs in the message def flight_ids [] end def to_s # Include data method for Generic messages instance_of?(RequestsMessage) ? "#{super}[#{_method}]" : super end end end end