Class: Verizon::ESIMGlobalDeviceList

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

Overview

ESIMGlobalDeviceList Model.

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, provisioning_status_filter = SKIP, profile_status_filter = SKIP, carrier_name_filter = SKIP, device_filter = SKIP) ⇒ ESIMGlobalDeviceList

Returns a new instance of ESIMGlobalDeviceList.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/verizon/models/esim_global_device_list.rb', line 59

def initialize( = SKIP, provisioning_status_filter = SKIP,
               profile_status_filter = SKIP, carrier_name_filter = SKIP,
               device_filter = SKIP)
  @account_name =  unless  == SKIP
  unless provisioning_status_filter == SKIP
    @provisioning_status_filter =
      provisioning_status_filter
  end
  @profile_status_filter = profile_status_filter unless profile_status_filter == SKIP
  @carrier_name_filter = carrier_name_filter unless carrier_name_filter == SKIP
  @device_filter = device_filter unless device_filter == SKIP
end

Instance Attribute Details

#account_nameString

The numeric name of the account.

Returns:

  • (String)


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

def 
  @account_name
end

#carrier_name_filterString

The cellular service provider.

Returns:

  • (String)


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

def carrier_name_filter
  @carrier_name_filter
end

#device_filterArray[DeviceId2]

An array of device identifiers to filter the list.

Returns:



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

def device_filter
  @device_filter
end

#profile_status_filterProfileStatusFilterEnum

The last status of the device’s profile as a filter.



22
23
24
# File 'lib/verizon/models/esim_global_device_list.rb', line 22

def profile_status_filter
  @profile_status_filter
end

#provisioning_status_filterProvisioningStatusFilterEnum

The last status of the device as a list filter.



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

def provisioning_status_filter
  @provisioning_status_filter
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/verizon/models/esim_global_device_list.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  provisioning_status_filter =
    hash.key?('provisioningStatusFilter') ? hash['provisioningStatusFilter'] : SKIP
  profile_status_filter =
    hash.key?('profileStatusFilter') ? hash['profileStatusFilter'] : SKIP
  carrier_name_filter =
    hash.key?('carrierNameFilter') ? hash['carrierNameFilter'] : SKIP
  # Parameter is an array, so we need to iterate through it
  device_filter = nil
  unless hash['deviceFilter'].nil?
    device_filter = []
    hash['deviceFilter'].each do |structure|
      device_filter << (DeviceId2.from_hash(structure) if structure)
    end
  end

  device_filter = SKIP unless hash.key?('deviceFilter')

  # Create object from extracted values.
  ESIMGlobalDeviceList.new(,
                           provisioning_status_filter,
                           profile_status_filter,
                           carrier_name_filter,
                           device_filter)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['provisioning_status_filter'] = 'provisioningStatusFilter'
  @_hash['profile_status_filter'] = 'profileStatusFilter'
  @_hash['carrier_name_filter'] = 'carrierNameFilter'
  @_hash['device_filter'] = 'deviceFilter'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/verizon/models/esim_global_device_list.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    account_name
    provisioning_status_filter
    profile_status_filter
    carrier_name_filter
    device_filter
  ]
end