Class: Verizon::AggregatedReportCallbackResult

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/aggregated_report_callback_result.rb

Overview

Aggregated usage report (Asynchronous).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(txid = nil, status = SKIP) ⇒ AggregatedReportCallbackResult

Returns a new instance of AggregatedReportCallbackResult.



44
45
46
47
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 44

def initialize(txid = nil, status = SKIP)
  @txid = txid
  @status = status unless status == SKIP
end

Instance Attribute Details

#statusAggregatedReportCallbackStatusEnum

QUEUED or COMPLETED. Requests for IoT devices with cacheMode=0 (cached) have status=COMPLETED; all other requests are QUEUED.



22
23
24
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 22

def status
  @status
end

#txidString

A unique string that associates the request with the location report information that is sent in asynchronous callback message.ThingSpace will send a separate callback message for each device that was in the request. All of the callback messages will have the same txid.

Returns:

  • (String)


17
18
19
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 17

def txid
  @txid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 50

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  txid = hash.key?('txid') ? hash['txid'] : nil
  status = hash.key?('status') ? hash['status'] : SKIP

  # Create object from extracted values.
  AggregatedReportCallbackResult.new(txid,
                                     status)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['txid'] = 'txid'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 40

def self.nullables
  []
end

.optionalsObject

An array for optional fields



33
34
35
36
37
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 33

def self.optionals
  %w[
    status
  ]
end