Class: Verizon::DeviceListWithServiceAddress1

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

Overview

DeviceListWithServiceAddress1 Model.

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(device_id = SKIP, primary_placeofuse = SKIP) ⇒ DeviceListWithServiceAddress1

Returns a new instance of DeviceListWithServiceAddress1.



41
42
43
44
# File 'lib/verizon/models/device_list_with_service_address1.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_address1.rb', line 14

def device_id
  @device_id
end

#primary_placeofuseM5gBiprimaryPlaceofuse

TODO: Write general description for this method



18
19
20
# File 'lib/verizon/models/device_list_with_service_address1.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
# File 'lib/verizon/models/device_list_with_service_address1.rb', line 47

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  device_id = hash.key?('deviceId') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:DeviceListWithServiceAddress1DeviceId), hash['deviceId']
  ) : SKIP
  primary_placeofuse = M5gBiprimaryPlaceofuse.from_hash(hash['primaryPlaceofuse']) if
    hash['primaryPlaceofuse']

  # Create object from extracted values.
  DeviceListWithServiceAddress1.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_address1.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_address1.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_address1.rb', line 29

def self.optionals
  %w[
    device_id
    primary_placeofuse
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



64
65
66
67
68
69
70
# File 'lib/verizon/models/device_list_with_service_address1.rb', line 64

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



79
80
81
82
83
# File 'lib/verizon/models/device_list_with_service_address1.rb', line 79

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

#to_sObject

Provides a human-readable string representation of the object.



73
74
75
76
# File 'lib/verizon/models/device_list_with_service_address1.rb', line 73

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