Class: ThePlaidApi::ItemStatusTransactions
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ItemStatusTransactions
- Defined in:
- lib/the_plaid_api/models/item_status_transactions.rb
Overview
Information about the last successful and failed transactions update for the Item.
Instance Attribute Summary collapse
-
#last_failed_update ⇒ DateTime
[ISO 8601](wikipedia.org/wiki/ISO_8601) timestamp of the last failed transactions update for the Item.
-
#last_successful_update ⇒ DateTime
[ISO 8601](wikipedia.org/wiki/ISO_8601) timestamp of the last successful transactions update for the Item.
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(last_successful_update: SKIP, last_failed_update: SKIP, additional_properties: nil) ⇒ ItemStatusTransactions
constructor
A new instance of ItemStatusTransactions.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_last_failed_update ⇒ Object
- #to_custom_last_successful_update ⇒ 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(last_successful_update: SKIP, last_failed_update: SKIP, additional_properties: nil) ⇒ ItemStatusTransactions
Returns a new instance of ItemStatusTransactions.
56 57 58 59 60 61 62 63 64 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 56 def initialize(last_successful_update: SKIP, last_failed_update: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @last_successful_update = last_successful_update unless last_successful_update == SKIP @last_failed_update = last_failed_update unless last_failed_update == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#last_failed_update ⇒ DateTime
[ISO 8601](wikipedia.org/wiki/ISO_8601) timestamp of the last failed transactions update for the Item. The status will update each time Plaid fails an attempt to connect with the institution, regardless of whether any new data is available in the update. This field does not reflect transactions updates performed by non-Transactions products (e.g. Signal).
30 31 32 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 30 def last_failed_update @last_failed_update end |
#last_successful_update ⇒ DateTime
[ISO 8601](wikipedia.org/wiki/ISO_8601) timestamp of the last successful transactions update for the Item. The status will update each time Plaid successfully connects with the institution, regardless of whether any new data is available in the update. This field does not reflect transactions updates performed by non-Transactions products (e.g. Signal).
21 22 23 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 21 def last_successful_update @last_successful_update end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. last_successful_update = if hash.key?('last_successful_update') (DateTimeHelper.from_rfc3339(hash['last_successful_update']) if hash['last_successful_update']) else SKIP end last_failed_update = if hash.key?('last_failed_update') (DateTimeHelper.from_rfc3339(hash['last_failed_update']) if hash['last_failed_update']) 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. ItemStatusTransactions.new(last_successful_update: last_successful_update, last_failed_update: last_failed_update, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['last_successful_update'] = 'last_successful_update' @_hash['last_failed_update'] = 'last_failed_update' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 52 53 54 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 49 def self.nullables %w[ last_successful_update last_failed_update ] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 41 def self.optionals %w[ last_successful_update last_failed_update ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} last_successful_update: #{@last_successful_update.inspect},"\ " last_failed_update: #{@last_failed_update.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_last_failed_update ⇒ Object
99 100 101 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 99 def to_custom_last_failed_update DateTimeHelper.to_rfc3339(last_failed_update) end |
#to_custom_last_successful_update ⇒ Object
95 96 97 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 95 def to_custom_last_successful_update DateTimeHelper.to_rfc3339(last_successful_update) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
104 105 106 107 108 |
# File 'lib/the_plaid_api/models/item_status_transactions.rb', line 104 def to_s class_name = self.class.name.split('::').last "<#{class_name} last_successful_update: #{@last_successful_update}, last_failed_update:"\ " #{@last_failed_update}, additional_properties: #{@additional_properties}>" end |