Sha256: ef4030a052a30681efb9230f40b2af3f84ddc5a3f70cbad94dd502ded02efa5f

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module DjiMqttConnect
  module Thing::Product
    # https://developer.dji.com/doc/cloud-api-tutorial/en/server-api-reference/mqtt/thing-model/gateway/dock/organization.html#search-for-the-organization-information-that-device-bound-to
    class AirportOrganizationGetRequestsReplyMessage < RequestsReplyMessage
      def self.build_for(airport_organization_get_message, output:, result: 0)
        new(
          _method: airport_organization_get_message._method,
          tid: airport_organization_get_message.tid,
          bid: airport_organization_get_message.bid,
          timestamp: current_timestamp,
          data: {
            result: result,
            output: output
          }
        )
      end

      attribute :_method, Types::String.enum("airport_organization_get")

      attribute :data do
        include Mixins::ResultMessage

        attribute :result, Types::ResultCode

        attribute :output do
          attribute :organization_name, Types::String
        end
      end

      def humanized_summary_interpolation
        super.merge(
          organization_name: data.output.organization_name
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.25.1 lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get.rb
dji_mqtt_connect-0.1.25 lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get.rb