Class: Verizon::MismatchedDevice

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

Overview

4G devices with an ICCID (SIM) that was not activated with the expected IMEI (hardware) during a specified time frame.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = SKIP, mdn = SKIP, activation_date = SKIP, iccid = SKIP, pre_imei = SKIP, post_imei = SKIP, sim_ota_date = SKIP) ⇒ MismatchedDevice

Returns a new instance of MismatchedDevice.



72
73
74
75
76
77
78
79
80
81
82
# File 'lib/verizon/models/mismatched_device.rb', line 72

def initialize( = SKIP, mdn = SKIP, activation_date = SKIP,
               iccid = SKIP, pre_imei = SKIP, post_imei = SKIP,
               sim_ota_date = SKIP)
  @account_name =  unless  == SKIP
  @mdn = mdn unless mdn == SKIP
  @activation_date = activation_date unless activation_date == SKIP
  @iccid = iccid unless iccid == SKIP
  @pre_imei = pre_imei unless pre_imei == SKIP
  @post_imei = post_imei unless post_imei == SKIP
  @sim_ota_date = sim_ota_date unless sim_ota_date == SKIP
end

Instance Attribute Details

#account_nameString

The account that the device is associated with.

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/mismatched_device.rb', line 15

def 
  @account_name
end

#activation_dateString

The date and time when the SIM was last activated.

Returns:

  • (String)


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

def activation_date
  @activation_date
end

#iccidString

The ID of the SIM.

Returns:

  • (String)


27
28
29
# File 'lib/verizon/models/mismatched_device.rb', line 27

def iccid
  @iccid
end

#mdnString

The assigned phone number of the device.

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/mismatched_device.rb', line 19

def mdn
  @mdn
end

#post_imeiString

The IMEI of the device after the SIM OTA activation on simOtaDate.

Returns:

  • (String)


35
36
37
# File 'lib/verizon/models/mismatched_device.rb', line 35

def post_imei
  @post_imei
end

#pre_imeiString

The IMEI of the device prior to the SIM OTA activation on simOtaDate.

Returns:

  • (String)


31
32
33
# File 'lib/verizon/models/mismatched_device.rb', line 31

def pre_imei
  @pre_imei
end

#sim_ota_dateString

The date and time of the SIM OTA activation.

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/mismatched_device.rb', line 39

def sim_ota_date
  @sim_ota_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/verizon/models/mismatched_device.rb', line 85

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  mdn = hash.key?('mdn') ? hash['mdn'] : SKIP
  activation_date =
    hash.key?('activationDate') ? hash['activationDate'] : SKIP
  iccid = hash.key?('iccid') ? hash['iccid'] : SKIP
  pre_imei = hash.key?('preImei') ? hash['preImei'] : SKIP
  post_imei = hash.key?('postImei') ? hash['postImei'] : SKIP
  sim_ota_date = hash.key?('simOtaDate') ? hash['simOtaDate'] : SKIP

  # Create object from extracted values.
  MismatchedDevice.new(,
                       mdn,
                       activation_date,
                       iccid,
                       pre_imei,
                       post_imei,
                       sim_ota_date)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/verizon/models/mismatched_device.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['mdn'] = 'mdn'
  @_hash['activation_date'] = 'activationDate'
  @_hash['iccid'] = 'iccid'
  @_hash['pre_imei'] = 'preImei'
  @_hash['post_imei'] = 'postImei'
  @_hash['sim_ota_date'] = 'simOtaDate'
  @_hash
end

.nullablesObject

An array for nullable fields



68
69
70
# File 'lib/verizon/models/mismatched_device.rb', line 68

def self.nullables
  []
end

.optionalsObject

An array for optional fields



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/verizon/models/mismatched_device.rb', line 55

def self.optionals
  %w[
    account_name
    mdn
    activation_date
    iccid
    pre_imei
    post_imei
    sim_ota_date
  ]
end