module Conduit::Driver::Atom
  # Get device info by sending its serial number.
  #
  # Doesn't take a `callback` attribute since the operation is sync.
  class QueryDeviceInfo < Conduit::Driver::Atom::Base
    # Required attributes
    #
    # * `carrier_id`
    # * `device_serial_number`
    required_attributes :carrier_id, :device_serial_number

    # Optional Attributes
    #
    # `iccid`
    optional_attributes :iccid
    http_method         :post
    url_route           "/carriers"

    # Builds the url manually since it contains dynamic parts.
    def remote_url
      super + "/#{@options[:carrier_id]}/query_device_info"
    end
  end
end
