Class: Verizon::BullseyeServiceResult
- Defined in:
- lib/verizon/models/bullseye_service_result.rb
Overview
Status of Hyper Precise Location on the device.
Instance Attribute Summary collapse
-
#account_number ⇒ String
The account the device belongs to.
-
#device_list ⇒ Array[DeviceServiceInformation]
List of devices.
-
#response_type ⇒ ApiResponseCode
ResponseCode and/or a message indicating success or failure of the request.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(account_number = SKIP, device_list = SKIP, response_type = SKIP) ⇒ BullseyeServiceResult
constructor
A new instance of BullseyeServiceResult.
Methods inherited from BaseModel
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(account_number = SKIP, device_list = SKIP, response_type = SKIP) @account_number = account_number unless account_number == SKIP @device_list = device_list unless device_list == SKIP @response_type = response_type unless response_type == SKIP end |
Instance Attribute Details
#account_number ⇒ String
The account the device belongs to.
14 15 16 |
# File 'lib/verizon/models/bullseye_service_result.rb', line 14 def account_number @account_number end |
#device_list ⇒ Array[DeviceServiceInformation]
List of devices.
18 19 20 |
# File 'lib/verizon/models/bullseye_service_result.rb', line 18 def device_list @device_list end |
#response_type ⇒ ApiResponseCode
ResponseCode and/or a message indicating success or failure of the request.
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. account_number = 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(account_number, device_list, response_type) end |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/verizon/models/bullseye_service_result.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
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 |