Class: Verizon::SearchDeviceByPropertyFields
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::SearchDeviceByPropertyFields
- Defined in:
- lib/verizon/models/search_device_by_property_fields.rb
Overview
List of device sensors and their most recently reported values.
Instance Attribute Summary collapse
-
#acceleration ⇒ Acceleration
TODO: Write general description for this method.
-
#battery ⇒ String
TODO: Write general description for this method.
-
#device_propertylocation ⇒ DevicePropertylocation
TODO: Write general description for this method.
-
#humidity ⇒ String
TODO: Write general description for this method.
-
#light ⇒ String
TODO: Write general description for this method.
-
#pressure ⇒ String
TODO: Write general description for this method.
-
#signal_strength ⇒ String
TODO: Write general description for this method.
-
#temperature ⇒ String
TODO: Write general description for this method.
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(acceleration: SKIP, battery: SKIP, humidity: SKIP, light: SKIP, pressure: SKIP, signal_strength: SKIP, temperature: SKIP, device_propertylocation: SKIP, additional_properties: nil) ⇒ SearchDeviceByPropertyFields
constructor
A new instance of SearchDeviceByPropertyFields.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(acceleration: SKIP, battery: SKIP, humidity: SKIP, light: SKIP, pressure: SKIP, signal_strength: SKIP, temperature: SKIP, device_propertylocation: SKIP, additional_properties: nil) ⇒ SearchDeviceByPropertyFields
Returns a new instance of SearchDeviceByPropertyFields.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 77 def initialize(acceleration: SKIP, battery: SKIP, humidity: SKIP, light: SKIP, pressure: SKIP, signal_strength: SKIP, temperature: SKIP, device_propertylocation: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @acceleration = acceleration unless acceleration == SKIP @battery = battery unless battery == SKIP @humidity = humidity unless humidity == SKIP @light = light unless light == SKIP @pressure = pressure unless pressure == SKIP @signal_strength = signal_strength unless signal_strength == SKIP @temperature = temperature unless temperature == SKIP @device_propertylocation = device_propertylocation unless device_propertylocation == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#acceleration ⇒ Acceleration
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 14 def acceleration @acceleration end |
#battery ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 18 def battery @battery end |
#device_propertylocation ⇒ DevicePropertylocation
TODO: Write general description for this method
42 43 44 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 42 def device_propertylocation @device_propertylocation end |
#humidity ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 22 def humidity @humidity end |
#light ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 26 def light @light end |
#pressure ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 30 def pressure @pressure end |
#signal_strength ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 34 def signal_strength @signal_strength end |
#temperature ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 38 def temperature @temperature end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 96 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. acceleration = Acceleration.from_hash(hash['acceleration']) if hash['acceleration'] battery = hash.key?('battery') ? hash['battery'] : SKIP humidity = hash.key?('humidity') ? hash['humidity'] : SKIP light = hash.key?('light') ? hash['light'] : SKIP pressure = hash.key?('pressure') ? hash['pressure'] : SKIP signal_strength = hash.key?('signalStrength') ? hash['signalStrength'] : SKIP temperature = hash.key?('temperature') ? hash['temperature'] : SKIP device_propertylocation = DevicePropertylocation.from_hash(hash['DevicePropertylocation']) if hash['DevicePropertylocation'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. SearchDeviceByPropertyFields.new(acceleration: acceleration, battery: battery, humidity: humidity, light: light, pressure: pressure, signal_strength: signal_strength, temperature: temperature, device_propertylocation: device_propertylocation, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['acceleration'] = 'acceleration' @_hash['battery'] = 'battery' @_hash['humidity'] = 'humidity' @_hash['light'] = 'light' @_hash['pressure'] = 'pressure' @_hash['signal_strength'] = 'signalStrength' @_hash['temperature'] = 'temperature' @_hash['device_propertylocation'] = 'DevicePropertylocation' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 59 def self.optionals %w[ acceleration battery humidity light pressure signal_strength temperature device_propertylocation ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
140 141 142 143 144 145 146 147 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 140 def inspect class_name = self.class.name.split('::').last "<#{class_name} acceleration: #{@acceleration.inspect}, battery: #{@battery.inspect},"\ " humidity: #{@humidity.inspect}, light: #{@light.inspect}, pressure: #{@pressure.inspect},"\ " signal_strength: #{@signal_strength.inspect}, temperature: #{@temperature.inspect},"\ " device_propertylocation: #{@device_propertylocation.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
131 132 133 134 135 136 137 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 131 def to_s class_name = self.class.name.split('::').last "<#{class_name} acceleration: #{@acceleration}, battery: #{@battery}, humidity:"\ " #{@humidity}, light: #{@light}, pressure: #{@pressure}, signal_strength:"\ " #{@signal_strength}, temperature: #{@temperature}, device_propertylocation:"\ " #{@device_propertylocation}, additional_properties: #{@additional_properties}>" end |