Class: Verizon::ResourceEvent
- Defined in:
- lib/verizon/models/resource_event.rb
Overview
ResourceEvent Model.
Instance Attribute Summary collapse
-
#accountclientid ⇒ String
Not used in this release, future functionality.
-
#callbackurl ⇒ String
The URL of the callback listener.
-
#createdon ⇒ DateTime
Timestamp of the record.
-
#description ⇒ String
a short description.
-
#deviceid ⇒ String
This is a UUID value of the device created when the device is onboarded.
-
#errmsg ⇒ String
Error message.
-
#fieldid ⇒ String
Error message.
-
#fields ⇒ DtoFields
Fields to return needed by search.
-
#fieldvalue ⇒ Array[Integer]
Fields to return needed by search.
-
#foreignid ⇒ String
UUID of the ECPD account the user belongs to.
-
#id ⇒ String
UUID of the user record, assigned at creation.
-
#lastupdated ⇒ DateTime
Timestamp of the record.
-
#modelid ⇒ String
The model ID of the device.
-
#name ⇒ String
User defined name of the record.
-
#sensordataaggregation ⇒ TrueClass | FalseClass
A flag to indicate if sensor data is to be aggregated (true) or not.
-
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`.
-
#transactionid ⇒ String
The system-generated UUID of the transaction.
-
#version ⇒ String
The resource version.
-
#versionid ⇒ String
The UUID of the resource version.
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(createdon:, fieldid:, foreignid:, lastupdated:, state:, versionid:, accountclientid: SKIP, callbackurl: SKIP, description: SKIP, deviceid: SKIP, errmsg: SKIP, fields: SKIP, fieldvalue: SKIP, id: SKIP, modelid: SKIP, name: SKIP, sensordataaggregation: SKIP, transactionid: SKIP, version: SKIP) ⇒ ResourceEvent
constructor
A new instance of ResourceEvent.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_createdon ⇒ Object
- #to_custom_lastupdated ⇒ Object
-
#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(createdon:, fieldid:, foreignid:, lastupdated:, state:, versionid:, accountclientid: SKIP, callbackurl: SKIP, description: SKIP, deviceid: SKIP, errmsg: SKIP, fields: SKIP, fieldvalue: SKIP, id: SKIP, modelid: SKIP, name: SKIP, sensordataaggregation: SKIP, transactionid: SKIP, version: SKIP) ⇒ ResourceEvent
Returns a new instance of ResourceEvent.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/verizon/models/resource_event.rb', line 139 def initialize(createdon:, fieldid:, foreignid:, lastupdated:, state:, versionid:, accountclientid: SKIP, callbackurl: SKIP, description: SKIP, deviceid: SKIP, errmsg: SKIP, fields: SKIP, fieldvalue: SKIP, id: SKIP, modelid: SKIP, name: SKIP, sensordataaggregation: SKIP, transactionid: SKIP, version: SKIP) @accountclientid = accountclientid unless accountclientid == SKIP @callbackurl = callbackurl unless callbackurl == SKIP @createdon = createdon @description = description unless description == SKIP @deviceid = deviceid unless deviceid == SKIP @errmsg = errmsg unless errmsg == SKIP @fieldid = fieldid @fields = fields unless fields == SKIP @fieldvalue = fieldvalue unless fieldvalue == SKIP @foreignid = foreignid @id = id unless id == SKIP @lastupdated = lastupdated @modelid = modelid unless modelid == SKIP @name = name unless name == SKIP @sensordataaggregation = sensordataaggregation unless sensordataaggregation == SKIP @state = state @transactionid = transactionid unless transactionid == SKIP @version = version unless version == SKIP @versionid = versionid end |
Instance Attribute Details
#accountclientid ⇒ String
Not used in this release, future functionality
15 16 17 |
# File 'lib/verizon/models/resource_event.rb', line 15 def accountclientid @accountclientid end |
#callbackurl ⇒ String
The URL of the callback listener
19 20 21 |
# File 'lib/verizon/models/resource_event.rb', line 19 def callbackurl @callbackurl end |
#createdon ⇒ DateTime
Timestamp of the record
23 24 25 |
# File 'lib/verizon/models/resource_event.rb', line 23 def createdon @createdon end |
#description ⇒ String
a short description
27 28 29 |
# File 'lib/verizon/models/resource_event.rb', line 27 def description @description end |
#deviceid ⇒ String
This is a UUID value of the device created when the device is onboarded
31 32 33 |
# File 'lib/verizon/models/resource_event.rb', line 31 def deviceid @deviceid end |
#errmsg ⇒ String
Error message
35 36 37 |
# File 'lib/verizon/models/resource_event.rb', line 35 def errmsg @errmsg end |
#fieldid ⇒ String
Error message
39 40 41 |
# File 'lib/verizon/models/resource_event.rb', line 39 def fieldid @fieldid end |
#fields ⇒ DtoFields
Fields to return needed by search
43 44 45 |
# File 'lib/verizon/models/resource_event.rb', line 43 def fields @fields end |
#fieldvalue ⇒ Array[Integer]
Fields to return needed by search
47 48 49 |
# File 'lib/verizon/models/resource_event.rb', line 47 def fieldvalue @fieldvalue end |
#foreignid ⇒ String
UUID of the ECPD account the user belongs to
51 52 53 |
# File 'lib/verizon/models/resource_event.rb', line 51 def foreignid @foreignid end |
#id ⇒ String
UUID of the user record, assigned at creation
55 56 57 |
# File 'lib/verizon/models/resource_event.rb', line 55 def id @id end |
#lastupdated ⇒ DateTime
Timestamp of the record
59 60 61 |
# File 'lib/verizon/models/resource_event.rb', line 59 def lastupdated @lastupdated end |
#modelid ⇒ String
The model ID of the device
63 64 65 |
# File 'lib/verizon/models/resource_event.rb', line 63 def modelid @modelid end |
#name ⇒ String
User defined name of the record
67 68 69 |
# File 'lib/verizon/models/resource_event.rb', line 67 def name @name end |
#sensordataaggregation ⇒ TrueClass | FalseClass
A flag to indicate if sensor data is to be aggregated (true) or not
71 72 73 |
# File 'lib/verizon/models/resource_event.rb', line 71 def sensordataaggregation @sensordataaggregation end |
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`
76 77 78 |
# File 'lib/verizon/models/resource_event.rb', line 76 def state @state end |
#transactionid ⇒ String
The system-generated UUID of the transaction
80 81 82 |
# File 'lib/verizon/models/resource_event.rb', line 80 def transactionid @transactionid end |
#version ⇒ String
The resource version
84 85 86 |
# File 'lib/verizon/models/resource_event.rb', line 84 def version @version end |
#versionid ⇒ String
The UUID of the resource version
88 89 90 |
# File 'lib/verizon/models/resource_event.rb', line 88 def versionid @versionid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/verizon/models/resource_event.rb', line 167 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. createdon = if hash.key?('createdon') (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon']) end fieldid = hash.key?('fieldid') ? hash['fieldid'] : nil foreignid = hash.key?('foreignid') ? hash['foreignid'] : nil lastupdated = if hash.key?('lastupdated') (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated']) end state = hash.key?('state') ? hash['state'] : nil versionid = hash.key?('versionid') ? hash['versionid'] : nil accountclientid = hash.key?('accountclientid') ? hash['accountclientid'] : SKIP callbackurl = hash.key?('callbackurl') ? hash['callbackurl'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP deviceid = hash.key?('deviceid') ? hash['deviceid'] : SKIP errmsg = hash.key?('errmsg') ? hash['errmsg'] : SKIP fields = DtoFields.from_hash(hash['fields']) if hash['fields'] fieldvalue = hash.key?('fieldvalue') ? hash['fieldvalue'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP modelid = hash.key?('modelid') ? hash['modelid'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP sensordataaggregation = hash.key?('sensordataaggregation') ? hash['sensordataaggregation'] : SKIP transactionid = hash.key?('transactionid') ? hash['transactionid'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. ResourceEvent.new(createdon: createdon, fieldid: fieldid, foreignid: foreignid, lastupdated: lastupdated, state: state, versionid: versionid, accountclientid: accountclientid, callbackurl: callbackurl, description: description, deviceid: deviceid, errmsg: errmsg, fields: fields, fieldvalue: fieldvalue, id: id, modelid: modelid, name: name, sensordataaggregation: sensordataaggregation, transactionid: transactionid, version: version) end |
.names ⇒ Object
A mapping from model property names to API property names.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/verizon/models/resource_event.rb', line 91 def self.names @_hash = {} if @_hash.nil? @_hash['accountclientid'] = 'accountclientid' @_hash['callbackurl'] = 'callbackurl' @_hash['createdon'] = 'createdon' @_hash['description'] = 'description' @_hash['deviceid'] = 'deviceid' @_hash['errmsg'] = 'errmsg' @_hash['fieldid'] = 'fieldid' @_hash['fields'] = 'fields' @_hash['fieldvalue'] = 'fieldvalue' @_hash['foreignid'] = 'foreignid' @_hash['id'] = 'id' @_hash['lastupdated'] = 'lastupdated' @_hash['modelid'] = 'modelid' @_hash['name'] = 'name' @_hash['sensordataaggregation'] = 'sensordataaggregation' @_hash['state'] = 'state' @_hash['transactionid'] = 'transactionid' @_hash['version'] = 'version' @_hash['versionid'] = 'versionid' @_hash end |
.nullables ⇒ Object
An array for nullable fields
135 136 137 |
# File 'lib/verizon/models/resource_event.rb', line 135 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/verizon/models/resource_event.rb', line 116 def self.optionals %w[ accountclientid callbackurl description deviceid errmsg fields fieldvalue id modelid name sensordataaggregation transactionid version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/verizon/models/resource_event.rb', line 239 def inspect class_name = self.class.name.split('::').last "<#{class_name} accountclientid: #{@accountclientid.inspect}, callbackurl:"\ " #{@callbackurl.inspect}, createdon: #{@createdon.inspect}, description:"\ " #{@description.inspect}, deviceid: #{@deviceid.inspect}, errmsg: #{@errmsg.inspect},"\ " fieldid: #{@fieldid.inspect}, fields: #{@fields.inspect}, fieldvalue:"\ " #{@fieldvalue.inspect}, foreignid: #{@foreignid.inspect}, id: #{@id.inspect}, lastupdated:"\ " #{@lastupdated.inspect}, modelid: #{@modelid.inspect}, name: #{@name.inspect},"\ " sensordataaggregation: #{@sensordataaggregation.inspect}, state: #{@state.inspect},"\ " transactionid: #{@transactionid.inspect}, version: #{@version.inspect}, versionid:"\ " #{@versionid.inspect}>" end |
#to_custom_createdon ⇒ Object
219 220 221 |
# File 'lib/verizon/models/resource_event.rb', line 219 def to_custom_createdon DateTimeHelper.to_rfc3339(createdon) end |
#to_custom_lastupdated ⇒ Object
223 224 225 |
# File 'lib/verizon/models/resource_event.rb', line 223 def to_custom_lastupdated DateTimeHelper.to_rfc3339(lastupdated) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
228 229 230 231 232 233 234 235 236 |
# File 'lib/verizon/models/resource_event.rb', line 228 def to_s class_name = self.class.name.split('::').last "<#{class_name} accountclientid: #{@accountclientid}, callbackurl: #{@callbackurl},"\ " createdon: #{@createdon}, description: #{@description}, deviceid: #{@deviceid}, errmsg:"\ " #{@errmsg}, fieldid: #{@fieldid}, fields: #{@fields}, fieldvalue: #{@fieldvalue},"\ " foreignid: #{@foreignid}, id: #{@id}, lastupdated: #{@lastupdated}, modelid: #{@modelid},"\ " name: #{@name}, sensordataaggregation: #{@sensordataaggregation}, state: #{@state},"\ " transactionid: #{@transactionid}, version: #{@version}, versionid: #{@versionid}>" end |