Class: Verizon::AccountDeviceListRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::AccountDeviceListRequest
- Defined in:
- lib/verizon/models/account_device_list_request.rb
Overview
Request for listing account devices.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The billing account for which a list of devices is returned.
-
#current_state ⇒ String
The name of a device state, to only include devices in that state.
-
#custom_fields ⇒ Array[CustomFields]
Custom field names and values, if you want to only include devices that have matching values.
-
#device_id ⇒ DeviceId
An identifier for a single device.
-
#earliest ⇒ String
Only include devices that were added after this date and time.
-
#filter ⇒ AccountDeviceListFilter
Filter for a list of devices.
-
#group_name ⇒ String
Only include devices that are in this device group.
-
#largest_device_id_seen ⇒ Integer
Only include devices that have this service plan.
-
#latest ⇒ String
Only include devices that were added before this date and time.
-
#max_number_of_devices ⇒ Integer
Only include devices that have this service plan.
-
#service_plan ⇒ String
Only include devices that have this 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(account_name = SKIP, device_id = SKIP, filter = SKIP, current_state = SKIP, custom_fields = SKIP, earliest = SKIP, group_name = SKIP, latest = SKIP, service_plan = SKIP, max_number_of_devices = SKIP, largest_device_id_seen = SKIP) ⇒ AccountDeviceListRequest
constructor
A new instance of AccountDeviceListRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, device_id = SKIP, filter = SKIP, current_state = SKIP, custom_fields = SKIP, earliest = SKIP, group_name = SKIP, latest = SKIP, service_plan = SKIP, max_number_of_devices = SKIP, largest_device_id_seen = SKIP) ⇒ AccountDeviceListRequest
Returns a new instance of AccountDeviceListRequest.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/verizon/models/account_device_list_request.rb', line 98 def initialize(account_name = SKIP, device_id = SKIP, filter = SKIP, current_state = SKIP, custom_fields = SKIP, earliest = SKIP, group_name = SKIP, latest = SKIP, service_plan = SKIP, max_number_of_devices = SKIP, largest_device_id_seen = SKIP) @account_name = account_name unless account_name == SKIP @device_id = device_id unless device_id == SKIP @filter = filter unless filter == SKIP @current_state = current_state unless current_state == SKIP @custom_fields = custom_fields unless custom_fields == SKIP @earliest = earliest unless earliest == SKIP @group_name = group_name unless group_name == SKIP @latest = latest unless latest == SKIP @service_plan = service_plan unless service_plan == SKIP @max_number_of_devices = max_number_of_devices unless max_number_of_devices == SKIP @largest_device_id_seen = largest_device_id_seen unless largest_device_id_seen == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The billing account for which a list of devices is returned. If you don’t specify an accountName, the list includes all devices to which you have access.
16 17 18 |
# File 'lib/verizon/models/account_device_list_request.rb', line 16 def account_name @account_name end |
#current_state ⇒ String
The name of a device state, to only include devices in that state.
28 29 30 |
# File 'lib/verizon/models/account_device_list_request.rb', line 28 def current_state @current_state end |
#custom_fields ⇒ Array[CustomFields]
Custom field names and values, if you want to only include devices that have matching values.
33 34 35 |
# File 'lib/verizon/models/account_device_list_request.rb', line 33 def custom_fields @custom_fields end |
#device_id ⇒ DeviceId
An identifier for a single device.
20 21 22 |
# File 'lib/verizon/models/account_device_list_request.rb', line 20 def device_id @device_id end |
#earliest ⇒ String
Only include devices that were added after this date and time.
37 38 39 |
# File 'lib/verizon/models/account_device_list_request.rb', line 37 def earliest @earliest end |
#filter ⇒ AccountDeviceListFilter
Filter for a list of devices.
24 25 26 |
# File 'lib/verizon/models/account_device_list_request.rb', line 24 def filter @filter end |
#group_name ⇒ String
Only include devices that are in this device group.
41 42 43 |
# File 'lib/verizon/models/account_device_list_request.rb', line 41 def group_name @group_name end |
#largest_device_id_seen ⇒ Integer
Only include devices that have this service plan.
57 58 59 |
# File 'lib/verizon/models/account_device_list_request.rb', line 57 def largest_device_id_seen @largest_device_id_seen end |
#latest ⇒ String
Only include devices that were added before this date and time.
45 46 47 |
# File 'lib/verizon/models/account_device_list_request.rb', line 45 def latest @latest end |
#max_number_of_devices ⇒ Integer
Only include devices that have this service plan.
53 54 55 |
# File 'lib/verizon/models/account_device_list_request.rb', line 53 def max_number_of_devices @max_number_of_devices end |
#service_plan ⇒ String
Only include devices that have this service plan.
49 50 51 |
# File 'lib/verizon/models/account_device_list_request.rb', line 49 def service_plan @service_plan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/verizon/models/account_device_list_request.rb', line 123 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : SKIP device_id = DeviceId.from_hash(hash['deviceId']) if hash['deviceId'] filter = AccountDeviceListFilter.from_hash(hash['filter']) if hash['filter'] current_state = hash.key?('currentState') ? hash['currentState'] : 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') earliest = hash.key?('earliest') ? hash['earliest'] : SKIP group_name = hash.key?('groupName') ? hash['groupName'] : SKIP latest = hash.key?('latest') ? hash['latest'] : SKIP service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP max_number_of_devices = hash.key?('maxNumberOfDevices') ? hash['maxNumberOfDevices'] : SKIP largest_device_id_seen = hash.key?('largestDeviceIdSeen') ? hash['largestDeviceIdSeen'] : SKIP # Create object from extracted values. AccountDeviceListRequest.new(account_name, device_id, filter, current_state, custom_fields, earliest, group_name, latest, service_plan, max_number_of_devices, largest_device_id_seen) end |
.names ⇒ Object
A mapping from model property names to API property names.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/models/account_device_list_request.rb', line 60 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['device_id'] = 'deviceId' @_hash['filter'] = 'filter' @_hash['current_state'] = 'currentState' @_hash['custom_fields'] = 'customFields' @_hash['earliest'] = 'earliest' @_hash['group_name'] = 'groupName' @_hash['latest'] = 'latest' @_hash['service_plan'] = 'servicePlan' @_hash['max_number_of_devices'] = 'maxNumberOfDevices' @_hash['largest_device_id_seen'] = 'largestDeviceIdSeen' @_hash end |
.nullables ⇒ Object
An array for nullable fields
94 95 96 |
# File 'lib/verizon/models/account_device_list_request.rb', line 94 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/verizon/models/account_device_list_request.rb', line 77 def self.optionals %w[ account_name device_id filter current_state custom_fields earliest group_name latest service_plan max_number_of_devices largest_device_id_seen ] end |