Class: Verizon::DeviceGroupDevicesData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DeviceGroupDevicesData
- Defined in:
- lib/verizon/models/device_group_devices_data.rb
Overview
Returns the name, description, and list of devices in a device group.
Instance Attribute Summary collapse
-
#description ⇒ String
The description of the device group.
-
#devices ⇒ Array[AccountDeviceList]
The devices in the device group.
-
#has_more_data ⇒ TrueClass | FalseClass
False for a status 200 response.True for a status 202 response, indicating that there is more data to be retrieved.
-
#name ⇒ String
The name of the device group.
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(description = SKIP, devices = SKIP, has_more_data = SKIP, name = SKIP) ⇒ DeviceGroupDevicesData
constructor
A new instance of DeviceGroupDevicesData.
Methods inherited from BaseModel
Constructor Details
#initialize(description = SKIP, devices = SKIP, has_more_data = SKIP, name = SKIP) ⇒ DeviceGroupDevicesData
Returns a new instance of DeviceGroupDevicesData.
54 55 56 57 58 59 60 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 54 def initialize(description = SKIP, devices = SKIP, has_more_data = SKIP, name = SKIP) @description = description unless description == SKIP @devices = devices unless devices == SKIP @has_more_data = has_more_data unless has_more_data == SKIP @name = name unless name == SKIP end |
Instance Attribute Details
#description ⇒ String
The description of the device group.
14 15 16 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 14 def description @description end |
#devices ⇒ Array[AccountDeviceList]
The devices in the device group.
18 19 20 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 18 def devices @devices end |
#has_more_data ⇒ TrueClass | FalseClass
False for a status 200 response.True for a status 202 response, indicating that there is more data to be retrieved.
23 24 25 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 23 def has_more_data @has_more_data end |
#name ⇒ String
The name of the device group.
27 28 29 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 27 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. description = hash.key?('description') ? hash['description'] : SKIP # 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') has_more_data = hash.key?('hasMoreData') ? hash['hasMoreData'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP # Create object from extracted values. DeviceGroupDevicesData.new(description, devices, has_more_data, name) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['devices'] = 'devices' @_hash['has_more_data'] = 'hasMoreData' @_hash['name'] = 'name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/verizon/models/device_group_devices_data.rb', line 40 def self.optionals %w[ description devices has_more_data name ] end |