Class: Verizon::DeviceMismatchListRequest

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

Overview

Request to list of all 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(filter = nil, devices = SKIP, account_name = SKIP, group_name = SKIP) ⇒ DeviceMismatchListRequest

Returns a new instance of DeviceMismatchListRequest.



56
57
58
59
60
61
62
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 56

def initialize(filter = nil, devices = SKIP,  = SKIP,
               group_name = SKIP)
  @filter = filter
  @devices = devices unless devices == SKIP
  @account_name =  unless  == SKIP
  @group_name = group_name unless group_name == SKIP
end

Instance Attribute Details

#account_nameString

The account that you want to search for mismatched devices. If you don’t specify an accountName, the search includes all devices to which you have access.

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 26

def 
  @account_name
end

#devicesArray[AccountDeviceList]

A list of specific devices that you want to check, specified by ICCID or MDN.

Returns:



20
21
22
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 20

def devices
  @devices
end

#filterDateFilter

Filter out the dates.

Returns:



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

def filter
  @filter
end

#group_nameString

The name of a device group, to only include devices in that group.

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 30

def group_name
  @group_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 65

def self.from_hash(hash)
  return nil unless hash

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

  devices = SKIP unless hash.key?('devices')
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  group_name = hash.key?('groupName') ? hash['groupName'] : SKIP

  # Create object from extracted values.
  DeviceMismatchListRequest.new(filter,
                                devices,
                                ,
                                group_name)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['filter'] = 'filter'
  @_hash['devices'] = 'devices'
  @_hash['account_name'] = 'accountName'
  @_hash['group_name'] = 'groupName'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
# File 'lib/verizon/models/device_mismatch_list_request.rb', line 43

def self.optionals
  %w[
    devices
    account_name
    group_name
  ]
end