Class: Verizon::DevicePrlListRequest
- Defined in:
- lib/verizon/models/device_prl_list_request.rb
Overview
Requests the current PRL (Preferred Roaming List) version for 2G or 3G devices, which can help determine which devices need a PRL update. (4G and GSM devices do not have a PRL.).
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of a billing account.
-
#custom_fields ⇒ Array[CustomFields]
The names and values of custom fields, if you want to only include devices that have matching custom fields.
-
#device_ids ⇒ Array[DeviceId]
The devices for which you want the PRL version, specified by device identifier.
-
#group_name ⇒ String
The name of a device group, if you want to only include devices in that group.
-
#service_plan ⇒ String
The name of a service plan, if you want to only include devices that have that service plan.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(device_ids = SKIP, account_name = SKIP, custom_fields = SKIP, group_name = SKIP, service_plan = SKIP) ⇒ DevicePrlListRequest
constructor
A new instance of DevicePrlListRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(device_ids = SKIP, account_name = SKIP, custom_fields = SKIP, group_name = SKIP, service_plan = SKIP) ⇒ DevicePrlListRequest
Returns a new instance of DevicePrlListRequest.
70 71 72 73 74 75 76 77 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 70 def initialize(device_ids = SKIP, account_name = SKIP, custom_fields = SKIP, group_name = SKIP, service_plan = SKIP) @device_ids = device_ids unless device_ids == SKIP @account_name = account_name unless account_name == SKIP @custom_fields = custom_fields unless custom_fields == SKIP @group_name = group_name unless group_name == SKIP @service_plan = service_plan unless service_plan == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The name of a billing account. This parameter is only required if you are passing groupName and the UWS account used for the current API session has access to multiple billing accounts, because the same device group name can exist in multiple accounts.An account name is usually numeric, and must include any leading zeros.
26 27 28 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 26 def account_name @account_name end |
#custom_fields ⇒ Array[CustomFields]
The names and values of custom fields, if you want to only include devices that have matching custom fields.
31 32 33 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 31 def custom_fields @custom_fields end |
#device_ids ⇒ Array[DeviceId]
The devices for which you want the PRL version, specified by device identifier. You only need to provide one identifier per device. Do not use any of the other parameters if you specify device IDs.
18 19 20 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 18 def device_ids @device_ids end |
#group_name ⇒ String
The name of a device group, if you want to only include devices in that group.
36 37 38 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 36 def group_name @group_name end |
#service_plan ⇒ String
The name of a service plan, if you want to only include devices that have that service plan.
41 42 43 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 41 def service_plan @service_plan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 80 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_ids = nil unless hash['deviceIds'].nil? device_ids = [] hash['deviceIds'].each do |structure| device_ids << (DeviceId.from_hash(structure) if structure) end end device_ids = SKIP unless hash.key?('deviceIds') account_name = hash.key?('accountName') ? hash['accountName'] : SKIP # Parameter is an array, so we need to iterate through it custom_fields = nil unless hash['customFields'].nil? custom_fields = [] hash['customFields'].each do |structure| custom_fields << (CustomFields.from_hash(structure) if structure) end end custom_fields = SKIP unless hash.key?('customFields') group_name = hash.key?('groupName') ? hash['groupName'] : SKIP service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP # Create object from extracted values. DevicePrlListRequest.new(device_ids, account_name, custom_fields, group_name, service_plan) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 52 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['device_ids'] = 'deviceIds' @_hash['account_name'] = 'accountName' @_hash['custom_fields'] = 'customFields' @_hash['group_name'] = 'groupName' @_hash['service_plan'] = 'servicePlan' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 60 61 62 63 |
# File 'lib/verizon/models/device_prl_list_request.rb', line 55 def self.optionals %w[ device_ids account_name custom_fields group_name service_plan ] end |