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

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

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

Returns a new instance of AggregatedReportCallbackResult.



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

def initialize(txid = SKIP, status = SKIP)
  @txid = txid unless txid == SKIP
  @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 (UUID) 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 a 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.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  txid = hash.key?('txid') ? hash['txid'] : SKIP
  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



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    txid
    status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



70
71
72
73
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 70

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} txid: #{@txid.inspect}, status: #{@status.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



64
65
66
67
# File 'lib/verizon/models/aggregated_report_callback_result.rb', line 64

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} txid: #{@txid}, status: #{@status}>"
end