Class: Verizon::DiagnosticsObservationResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DiagnosticsObservationResult
- Defined in:
- lib/verizon/models/diagnostics_observation_result.rb
Overview
A success response containing the current status of the request.
Instance Attribute Summary collapse
-
#created_on ⇒ DateTime
The date and time of when this request was created.
-
#status ⇒ String
Status of the request.
-
#transaction_id ⇒ String
Transaction identifier.
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(transaction_id = nil, status = nil, created_on = nil) ⇒ DiagnosticsObservationResult
constructor
A new instance of DiagnosticsObservationResult.
- #to_custom_created_on ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(transaction_id = nil, status = nil, created_on = nil) ⇒ DiagnosticsObservationResult
Returns a new instance of DiagnosticsObservationResult.
44 45 46 47 48 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 44 def initialize(transaction_id = nil, status = nil, created_on = nil) @transaction_id = transaction_id @status = status @created_on = created_on end |
Instance Attribute Details
#created_on ⇒ DateTime
The date and time of when this request was created.
23 24 25 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 23 def created_on @created_on end |
#status ⇒ String
Status of the request.
19 20 21 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 19 def status @status end |
#transaction_id ⇒ String
Transaction identifier.
15 16 17 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 15 def transaction_id @transaction_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 51 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. transaction_id = hash.key?('transactionID') ? hash['transactionID'] : nil status = hash.key?('status') ? hash['status'] : nil created_on = if hash.key?('createdOn') (DateTimeHelper.from_rfc3339(hash['createdOn']) if hash['createdOn']) end # Create object from extracted values. DiagnosticsObservationResult.new(transaction_id, status, created_on) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['transaction_id'] = 'transactionID' @_hash['status'] = 'status' @_hash['created_on'] = 'createdOn' @_hash end |
.nullables ⇒ Object
An array for nullable fields
40 41 42 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 40 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 35 def self.optionals [] end |
Instance Method Details
#to_custom_created_on ⇒ Object
67 68 69 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 67 def to_custom_created_on DateTimeHelper.to_rfc3339(created_on) end |