Class: Verizon::DtoSensorBoardingEvent
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DtoSensorBoardingEvent
- Defined in:
- lib/verizon/models/dto_sensor_boarding_event.rb
Overview
DtoSensorBoardingEvent Model.
Instance Attribute Summary collapse
-
#createdon ⇒ DateTime
Timestamp of the record.
-
#errmsg ⇒ String
Error message.
-
#fields ⇒ DtoFields
Fields to return needed by search.
-
#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.
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: SKIP, errmsg: SKIP, fields: SKIP, state: SKIP, transactionid: SKIP) ⇒ DtoSensorBoardingEvent
constructor
A new instance of DtoSensorBoardingEvent.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_createdon ⇒ 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: SKIP, errmsg: SKIP, fields: SKIP, state: SKIP, transactionid: SKIP) ⇒ DtoSensorBoardingEvent
Returns a new instance of DtoSensorBoardingEvent.
61 62 63 64 65 66 67 68 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 61 def initialize(createdon: SKIP, errmsg: SKIP, fields: SKIP, state: SKIP, transactionid: SKIP) @createdon = createdon unless createdon == SKIP @errmsg = errmsg unless errmsg == SKIP @fields = fields unless fields == SKIP @state = state unless state == SKIP @transactionid = transactionid unless transactionid == SKIP end |
Instance Attribute Details
#createdon ⇒ DateTime
Timestamp of the record
15 16 17 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 15 def createdon @createdon end |
#errmsg ⇒ String
Error message
19 20 21 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 19 def errmsg @errmsg end |
#fields ⇒ DtoFields
Fields to return needed by search
23 24 25 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 23 def fields @fields end |
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`
28 29 30 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 28 def state @state end |
#transactionid ⇒ String
The system-generated UUID of the transaction
32 33 34 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 32 def transactionid @transactionid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 71 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']) else SKIP end errmsg = hash.key?('errmsg') ? hash['errmsg'] : SKIP fields = DtoFields.from_hash(hash['fields']) if hash['fields'] state = hash.key?('state') ? hash['state'] : SKIP transactionid = hash.key?('transactionid') ? hash['transactionid'] : SKIP # Create object from extracted values. DtoSensorBoardingEvent.new(createdon: createdon, errmsg: errmsg, fields: fields, state: state, transactionid: transactionid) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['createdon'] = 'createdon' @_hash['errmsg'] = 'errmsg' @_hash['fields'] = 'fields' @_hash['state'] = 'state' @_hash['transactionid'] = 'transactionid' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 54 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 46 def self.optionals %w[ createdon errmsg fields state transactionid ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
105 106 107 108 109 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 105 def inspect class_name = self.class.name.split('::').last "<#{class_name} createdon: #{@createdon.inspect}, errmsg: #{@errmsg.inspect}, fields:"\ " #{@fields.inspect}, state: #{@state.inspect}, transactionid: #{@transactionid.inspect}>" end |
#to_custom_createdon ⇒ Object
93 94 95 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 93 def to_custom_createdon DateTimeHelper.to_rfc3339(createdon) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
98 99 100 101 102 |
# File 'lib/verizon/models/dto_sensor_boarding_event.rb', line 98 def to_s class_name = self.class.name.split('::').last "<#{class_name} createdon: #{@createdon}, errmsg: #{@errmsg}, fields: #{@fields}, state:"\ " #{@state}, transactionid: #{@transactionid}>" end |