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:, status:, created_on:, additional_properties: nil) ⇒ DiagnosticsObservationResult
constructor
A new instance of DiagnosticsObservationResult.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_on ⇒ 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(transaction_id:, status:, created_on:, additional_properties: nil) ⇒ DiagnosticsObservationResult
Returns a new instance of DiagnosticsObservationResult.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 44 def initialize(transaction_id:, status:, created_on:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @transaction_id = transaction_id @status = status @created_on = created_on @additional_properties = additional_properties 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.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 56 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 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. DiagnosticsObservationResult.new(transaction_id: transaction_id, status: status, created_on: created_on, additional_properties: additional_properties) 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
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
92 93 94 95 96 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 92 def inspect class_name = self.class.name.split('::').last "<#{class_name} transaction_id: #{@transaction_id.inspect}, status: #{@status.inspect},"\ " created_on: #{@created_on.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_created_on ⇒ Object
80 81 82 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 80 def to_custom_created_on DateTimeHelper.to_rfc3339(created_on) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
85 86 87 88 89 |
# File 'lib/verizon/models/diagnostics_observation_result.rb', line 85 def to_s class_name = self.class.name.split('::').last "<#{class_name} transaction_id: #{@transaction_id}, status: #{@status}, created_on:"\ " #{@created_on}, additional_properties: #{@additional_properties}>" end |