Class: Verizon::DeviceListWithServiceAddress

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

Overview

DeviceListWithServiceAddress Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(device_id = SKIP, primary_placeofuse = SKIP) ⇒ DeviceListWithServiceAddress

Returns a new instance of DeviceListWithServiceAddress.



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

def initialize(device_id = SKIP, primary_placeofuse = SKIP)
  @device_id = device_id unless device_id == SKIP
  @primary_placeofuse = primary_placeofuse unless primary_placeofuse == SKIP
end

Instance Attribute Details

#device_idArray[M5gBideviceId1]

TODO: Write general description for this method

Returns:



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

def device_id
  @device_id
end

#primary_placeofuseM5gBiaddressAndcustomerinfo

TODO: Write general description for this method



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

def primary_placeofuse
  @primary_placeofuse
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/verizon/models/device_list_with_service_address.rb', line 47

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  device_id = nil
  unless hash['deviceId'].nil?
    device_id = []
    hash['deviceId'].each do |structure|
      device_id << (M5gBideviceId1.from_hash(structure) if structure)
    end
  end

  device_id = SKIP unless hash.key?('deviceId')
  primary_placeofuse = M5gBiaddressAndcustomerinfo.from_hash(hash['primaryPlaceofuse']) if
    hash['primaryPlaceofuse']

  # Create object from extracted values.
  DeviceListWithServiceAddress.new(device_id,
                                   primary_placeofuse)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/verizon/models/device_list_with_service_address.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['device_id'] = 'deviceId'
  @_hash['primary_placeofuse'] = 'primaryPlaceofuse'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
# File 'lib/verizon/models/device_list_with_service_address.rb', line 37

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/verizon/models/device_list_with_service_address.rb', line 29

def self.optionals
  %w[
    device_id
    primary_placeofuse
  ]
end