Class: Plaid::TransferAuthorization
- Defined in:
- lib/plaid/models/transfer_authorization.rb
Overview
TransferAuthorization contains the authorization decision for a proposed transfer
Instance Attribute Summary collapse
-
#created ⇒ String
The datetime representing when the authorization was created, in the format “2006-01-02T15:04:05Z”.
-
#decision ⇒ Decision
A decision regarding the proposed transfer.
-
#decision_rationale ⇒ TransferAuthorizationDecisionRationale
The rationale for Plaid’s decision regarding a proposed transfer.
-
#id ⇒ String
Plaid’s unique identifier for a transfer authorization.
-
#proposed_transfer ⇒ TransferAuthorizationProposedTransfer
Details regarding the proposed transfer.
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(id:, created:, decision:, decision_rationale:, proposed_transfer:, additional_properties: nil) ⇒ TransferAuthorization
constructor
A new instance of TransferAuthorization.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(id:, created:, decision:, decision_rationale:, proposed_transfer:, additional_properties: nil) ⇒ TransferAuthorization
Returns a new instance of TransferAuthorization.
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/plaid/models/transfer_authorization.rb', line 65 def initialize(id:, created:, decision:, decision_rationale:, proposed_transfer:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @created = created @decision = decision @decision_rationale = decision_rationale @proposed_transfer = proposed_transfer @additional_properties = additional_properties end |
Instance Attribute Details
#created ⇒ String
The datetime representing when the authorization was created, in the format “2006-01-02T15:04:05Z”.
20 21 22 |
# File 'lib/plaid/models/transfer_authorization.rb', line 20 def created @created end |
#decision ⇒ Decision
A decision regarding the proposed transfer. ‘approved` – The proposed transfer has received the end user’s consent and has been approved for processing. Plaid has also reviewed the proposed transfer and has approved it for processing. ‘permitted` – Plaid was unable to fetch the information required to approve or decline the proposed transfer. You may proceed with the transfer, but further review is recommended. Plaid is awaiting further instructions from the client. `declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.
33 34 35 |
# File 'lib/plaid/models/transfer_authorization.rb', line 33 def decision @decision end |
#decision_rationale ⇒ TransferAuthorizationDecisionRationale
The rationale for Plaid’s decision regarding a proposed transfer. Will be null for ‘approved` decisions.
38 39 40 |
# File 'lib/plaid/models/transfer_authorization.rb', line 38 def decision_rationale @decision_rationale end |
#id ⇒ String
Plaid’s unique identifier for a transfer authorization.
15 16 17 |
# File 'lib/plaid/models/transfer_authorization.rb', line 15 def id @id end |
#proposed_transfer ⇒ TransferAuthorizationProposedTransfer
Details regarding the proposed transfer.
42 43 44 |
# File 'lib/plaid/models/transfer_authorization.rb', line 42 def proposed_transfer @proposed_transfer end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/plaid/models/transfer_authorization.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil created = hash.key?('created') ? hash['created'] : nil decision = hash.key?('decision') ? hash['decision'] : nil if hash['decision_rationale'] decision_rationale = TransferAuthorizationDecisionRationale.from_hash(hash['decision_rationale']) end if hash['proposed_transfer'] proposed_transfer = TransferAuthorizationProposedTransfer.from_hash(hash['proposed_transfer']) 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. TransferAuthorization.new(id: id, created: created, decision: decision, decision_rationale: decision_rationale, proposed_transfer: proposed_transfer, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 |
# File 'lib/plaid/models/transfer_authorization.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['created'] = 'created' @_hash['decision'] = 'decision' @_hash['decision_rationale'] = 'decision_rationale' @_hash['proposed_transfer'] = 'proposed_transfer' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/plaid/models/transfer_authorization.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 |
# File 'lib/plaid/models/transfer_authorization.rb', line 56 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
118 119 120 121 122 123 124 |
# File 'lib/plaid/models/transfer_authorization.rb', line 118 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, created: #{@created.inspect}, decision:"\ " #{@decision.inspect}, decision_rationale: #{@decision_rationale.inspect},"\ " proposed_transfer: #{@proposed_transfer.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
110 111 112 113 114 115 |
# File 'lib/plaid/models/transfer_authorization.rb', line 110 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, created: #{@created}, decision: #{@decision},"\ " decision_rationale: #{@decision_rationale}, proposed_transfer: #{@proposed_transfer},"\ " additional_properties: #{@additional_properties}>" end |