# frozen_string_literal: true module DjiMqttConnect module Thing::Product # Cancel wayline task # https://developer.dji.com/doc/cloud-api-tutorial/en/server-api-reference/mqtt/thing-model/gateway/dock/wayline.html#cancel-wayline-task class FlighttaskUndoServicesMessage < ServicesMessage def self.build(flight_ids:, bid: generate_bid, tid: generate_tid, timestamp: current_timestamp) new( bid: bid, tid: tid, timestamp: timestamp, _method: "flighttask_undo", data: { flight_ids: flight_ids } ) end attribute :_method, Types::String.enum("flighttask_undo") attribute :data do attribute :flight_ids, Types::Array.of(Types::FlightID) end # All the flight IDs in the message def flight_ids data.flight_ids end def humanized_summary_interpolation super.merge( flight_ids: flight_ids.join(", ") ) end end end end