Class: ThePlaidApi::IncidentUpdate
- Defined in:
- lib/the_plaid_api/models/incident_update.rb
Overview
An update on the health incident
Instance Attribute Summary collapse
-
#description ⇒ String
The content of the update.
-
#status ⇒ Status1
The status of the incident.
-
#updated_date ⇒ DateTime
The date when the update was published, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format, e.g.
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(description: SKIP, status: SKIP, updated_date: SKIP, additional_properties: nil) ⇒ IncidentUpdate
constructor
A new instance of IncidentUpdate.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_updated_date ⇒ 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(description: SKIP, status: SKIP, updated_date: SKIP, additional_properties: nil) ⇒ IncidentUpdate
Returns a new instance of IncidentUpdate.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 50 def initialize(description: SKIP, status: SKIP, updated_date: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @description = description unless description == SKIP @status = status unless status == SKIP @updated_date = updated_date unless updated_date == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#description ⇒ String
The content of the update.
15 16 17 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 15 def description @description end |
#status ⇒ Status1
The status of the incident.
19 20 21 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 19 def status @status end |
#updated_date ⇒ DateTime
The date when the update was published, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format, e.g. āā2020-10-30T15:26:48Zā`.
25 26 27 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 25 def updated_date @updated_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. description = hash.key?('description') ? hash['description'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP updated_date = if hash.key?('updated_date') (DateTimeHelper.from_rfc3339(hash['updated_date']) if hash['updated_date']) else SKIP 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. IncidentUpdate.new(description: description, status: status, updated_date: updated_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['status'] = 'status' @_hash['updated_date'] = 'updated_date' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 42 43 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 37 def self.optionals %w[ description status updated_date ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
100 101 102 103 104 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 100 def inspect class_name = self.class.name.split('::').last "<#{class_name} description: #{@description.inspect}, status: #{@status.inspect},"\ " updated_date: #{@updated_date.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_updated_date ⇒ Object
88 89 90 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 88 def to_custom_updated_date DateTimeHelper.to_rfc3339(updated_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
93 94 95 96 97 |
# File 'lib/the_plaid_api/models/incident_update.rb', line 93 def to_s class_name = self.class.name.split('::').last "<#{class_name} description: #{@description}, status: #{@status}, updated_date:"\ " #{@updated_date}, additional_properties: #{@additional_properties}>" end |