Sha256: 7f0443f2816e74b5b53c9ae6f5c47a1772de92b95eabe186cb5b383652549760

Contents?: true

Size: 984 Bytes

Versions: 83

Compression:

Stored size: 984 Bytes

Contents

#
# deviceId string Device ID (36-char UUID)
# startAt string The earliest date to include in the results. 	format: date-time
# stopAt string The latest date to include in the results. 	format: date-time
#

# Method: devices.register
module Alula
  class DeviceCellularHistoryProc < Alula::RpcResource
    ONE_DAY = 86_400
    class Response < Alula::RpcResponse
    end

    def self.call(device_id:, start_at: nil, stop_at: nil)
      # Helpers to set start/stop if only one is passed
      seven_days_in_seconds = Alula::DeviceCellularHistoryProc::ONE_DAY * 7

      stop_at = start_at + seven_days_in_seconds if stop_at.nil?
      start_at = stop_at - seven_days_in_seconds if start_at.nil?

      request(
        http_method: :post,
        path: '/rpc/v1/devices/cellular/history/get',
        payload: {
          deviceId: device_id,
          startAt: start_at.utc.iso8601,
          stopAt: stop_at.utc.iso8601
        },
        handler: Response
      )
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
alula-ruby-0.69.3 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.69.2 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.69.1 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.69.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.68.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.67.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.66.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.65.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.64.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.63.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.62.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.61.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.60.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.59.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.58.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.57.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.56.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.55.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.54.0 lib/alula/procedures/device_cellular_history_proc.rb
alula-ruby-0.53.0 lib/alula/procedures/device_cellular_history_proc.rb