Class: Verizon::ResourceOnBoardSensor
- Defined in:
- lib/verizon/models/resource_on_board_sensor.rb
Overview
ResourceOnBoardSensor Model.
Instance Attribute Summary collapse
-
#appeui ⇒ String
global application ID in IEEE EUI64 address space that uniquely identifies the entity able to process the JoinReq frame.
-
#appkey ⇒ String
an encryption key used for messages during every over the air activation.
-
#customdata ⇒ Hash[String, Object]
Name/value pair, where the value is client defined.
-
#description ⇒ String
The kind of sensor device.
-
#deveui ⇒ String
the IEEE EUI64 address space used to identify a device.
-
#kind ⇒ String
The kind of sensor device.
-
#mclass ⇒ String
Class of the sensor device.
-
#name ⇒ String
The kind of sensor device.
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(deveui:, appeui:, appkey:, mclass:, kind:, description:, name:, customdata: SKIP) ⇒ ResourceOnBoardSensor
constructor
A new instance of ResourceOnBoardSensor.
-
#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(deveui:, appeui:, appkey:, mclass:, kind:, description:, name:, customdata: SKIP) ⇒ ResourceOnBoardSensor
Returns a new instance of ResourceOnBoardSensor.
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 74 def initialize(deveui:, appeui:, appkey:, mclass:, kind:, description:, name:, customdata: SKIP) @deveui = deveui @appeui = appeui @appkey = appkey @mclass = mclass @kind = kind @description = description @name = name @customdata = customdata unless customdata == SKIP end |
Instance Attribute Details
#appeui ⇒ String
global application ID in IEEE EUI64 address space that uniquely identifies the entity able to process the JoinReq frame
20 21 22 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 20 def appeui @appeui end |
#appkey ⇒ String
an encryption key used for messages during every over the air activation
24 25 26 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 24 def appkey @appkey end |
#customdata ⇒ Hash[String, Object]
Name/value pair, where the value is client defined. The purpose is to keep track of current state per device action.
46 47 48 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 46 def customdata @customdata end |
#description ⇒ String
The kind of sensor device
37 38 39 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 37 def description @description end |
#deveui ⇒ String
the IEEE EUI64 address space used to identify a device. It is supplied by the device manufacturer
15 16 17 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 15 def deveui @deveui end |
#kind ⇒ String
The kind of sensor device
33 34 35 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 33 def kind @kind end |
#mclass ⇒ String
Class of the sensor device. Valid values are Class A (A), Class B (B), and Class C ©. All LoRaWAN devices must implement Class A
29 30 31 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 29 def mclass @mclass end |
#name ⇒ String
The kind of sensor device
41 42 43 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 41 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. deveui = hash.key?('deveui') ? hash['deveui'] : nil appeui = hash.key?('appeui') ? hash['appeui'] : nil appkey = hash.key?('appkey') ? hash['appkey'] : nil mclass = hash.key?('class') ? hash['class'] : nil kind = hash.key?('kind') ? hash['kind'] : nil description = hash.key?('description') ? hash['description'] : nil name = hash.key?('name') ? hash['name'] : nil customdata = hash.key?('customdata') ? hash['customdata'] : SKIP # Create object from extracted values. ResourceOnBoardSensor.new(deveui: deveui, appeui: appeui, appkey: appkey, mclass: mclass, kind: kind, description: description, name: name, customdata: customdata) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['deveui'] = 'deveui' @_hash['appeui'] = 'appeui' @_hash['appkey'] = 'appkey' @_hash['mclass'] = 'class' @_hash['kind'] = 'kind' @_hash['description'] = 'description' @_hash['name'] = 'name' @_hash['customdata'] = 'customdata' @_hash end |
.nullables ⇒ Object
An array for nullable fields
70 71 72 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 70 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
63 64 65 66 67 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 63 def self.optionals %w[ customdata ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} deveui: #{@deveui.inspect}, appeui: #{@appeui.inspect}, appkey:"\ " #{@appkey.inspect}, mclass: #{@mclass.inspect}, kind: #{@kind.inspect}, description:"\ " #{@description.inspect}, name: #{@name.inspect}, customdata: #{@customdata.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
112 113 114 115 116 117 |
# File 'lib/verizon/models/resource_on_board_sensor.rb', line 112 def to_s class_name = self.class.name.split('::').last "<#{class_name} deveui: #{@deveui}, appeui: #{@appeui}, appkey: #{@appkey}, mclass:"\ " #{@mclass}, kind: #{@kind}, description: #{@description}, name: #{@name}, customdata:"\ " #{@customdata}>" end |