Class: Verizon::BullseyeServiceResult

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

Overview

Status of Hyper Precise Location on the device.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_number = SKIP, device_list = SKIP, response_type = SKIP) ⇒ BullseyeServiceResult

Returns a new instance of BullseyeServiceResult.



48
49
50
51
52
53
# File 'lib/verizon/models/bullseye_service_result.rb', line 48

def initialize( = SKIP, device_list = SKIP,
               response_type = SKIP)
  @account_number =  unless  == SKIP
  @device_list = device_list unless device_list == SKIP
  @response_type = response_type unless response_type == SKIP
end

Instance Attribute Details

#account_numberString

The account the device belongs to.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/bullseye_service_result.rb', line 14

def 
  @account_number
end

#device_listArray[DeviceServiceInformation]

List of devices.

Returns:



18
19
20
# File 'lib/verizon/models/bullseye_service_result.rb', line 18

def device_list
  @device_list
end

#response_typeApiResponseCode

ResponseCode and/or a message indicating success or failure of the request.

Returns:



23
24
25
# File 'lib/verizon/models/bullseye_service_result.rb', line 23

def response_type
  @response_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/verizon/models/bullseye_service_result.rb', line 56

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP
  # Parameter is an array, so we need to iterate through it
  device_list = nil
  unless hash['deviceList'].nil?
    device_list = []
    hash['deviceList'].each do |structure|
      device_list << (DeviceServiceInformation.from_hash(structure) if structure)
    end
  end

  device_list = SKIP unless hash.key?('deviceList')
  response_type = ApiResponseCode.from_hash(hash['responseType']) if hash['responseType']

  # Create object from extracted values.
  BullseyeServiceResult.new(,
                            device_list,
                            response_type)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/verizon/models/bullseye_service_result.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_number'] = 'accountNumber'
  @_hash['device_list'] = 'deviceList'
  @_hash['response_type'] = 'responseType'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/verizon/models/bullseye_service_result.rb', line 35

def self.optionals
  %w[
    account_number
    device_list
    response_type
  ]
end