Class: ThePlaidApi::ExternalPaymentScheduleGet
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ExternalPaymentScheduleGet
- Defined in:
- lib/the_plaid_api/models/external_payment_schedule_get.rb
Overview
The schedule that the payment will be executed on. If a schedule is provided, the payment is automatically set up as a standing order. If no schedule is specified, the payment will be executed only once.
Instance Attribute Summary collapse
-
#adjusted_start_date ⇒ Date
The start date sent to the bank after adjusting for holidays or weekends.
-
#end_date ⇒ Date
A date in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).
-
#interval ⇒ PaymentScheduleInterval
The frequency interval of the payment.
-
#interval_execution_day ⇒ Integer
The day of the interval on which to schedule the payment.
-
#start_date ⇒ Date
A date in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).
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(interval:, interval_execution_day:, start_date:, end_date:, adjusted_start_date:, additional_properties: nil) ⇒ ExternalPaymentScheduleGet
constructor
A new instance of ExternalPaymentScheduleGet.
-
#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(interval:, interval_execution_day:, start_date:, end_date:, adjusted_start_date:, additional_properties: nil) ⇒ ExternalPaymentScheduleGet
Returns a new instance of ExternalPaymentScheduleGet.
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 81 def initialize(interval:, interval_execution_day:, start_date:, end_date:, adjusted_start_date:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @interval = interval @interval_execution_day = interval_execution_day @start_date = start_date @end_date = end_date @adjusted_start_date = adjusted_start_date @additional_properties = additional_properties end |
Instance Attribute Details
#adjusted_start_date ⇒ Date
The start date sent to the bank after adjusting for holidays or weekends. Will be provided in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). If the start date did not require adjustment, this field will be ‘null`.
55 56 57 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 55 def adjusted_start_date @adjusted_start_date end |
#end_date ⇒ Date
A date in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments will end on the last ‘interval_execution_day` on or before the `end_date`. If the only `interval_execution_day` between the start date and the end date (inclusive) is also the same day that `/payment_initiation/payment/create` was called, the bank may make a payment on that day, but it is not guaranteed to do so.
48 49 50 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 48 def end_date @end_date end |
#interval ⇒ PaymentScheduleInterval
The frequency interval of the payment.
16 17 18 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 16 def interval @interval end |
#interval_execution_day ⇒ Integer
The day of the interval on which to schedule the payment. If the payment interval is weekly, ‘interval_execution_day` should be an integer from 1 (Monday) to 7 (Sunday). If the payment interval is monthly, `interval_execution_day` should be an integer indicating which day of the month to make the payment on. Integers from 1 to 28 can be used to make a payment on that day of the month. Negative integers from -1 to -5 can be used to make a payment relative to the end of the month. To make a payment on the last day of the month, use -1; to make the payment on the second-to-last day, use -2, and so on.
28 29 30 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 28 def interval_execution_day @interval_execution_day end |
#start_date ⇒ Date
A date in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments will begin on the first ‘interval_execution_day` on or after the `start_date`. If the first `interval_execution_day` on or after the start date is also the same day that `/payment_initiation/payment/create` was called, the bank may make the first payment on that day, but it is not guaranteed to do so.
38 39 40 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 38 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 95 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. interval = hash.key?('interval') ? hash['interval'] : nil interval_execution_day = hash.key?('interval_execution_day') ? hash['interval_execution_day'] : nil start_date = hash.key?('start_date') ? hash['start_date'] : nil end_date = hash.key?('end_date') ? hash['end_date'] : nil adjusted_start_date = hash.key?('adjusted_start_date') ? hash['adjusted_start_date'] : nil # 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. ExternalPaymentScheduleGet.new(interval: interval, interval_execution_day: interval_execution_day, start_date: start_date, end_date: end_date, adjusted_start_date: adjusted_start_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 66 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['interval'] = 'interval' @_hash['interval_execution_day'] = 'interval_execution_day' @_hash['start_date'] = 'start_date' @_hash['end_date'] = 'end_date' @_hash['adjusted_start_date'] = 'adjusted_start_date' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 77 78 79 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 74 def self.nullables %w[ end_date adjusted_start_date ] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 69 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
132 133 134 135 136 137 138 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 132 def inspect class_name = self.class.name.split('::').last "<#{class_name} interval: #{@interval.inspect}, interval_execution_day:"\ " #{@interval_execution_day.inspect}, start_date: #{@start_date.inspect}, end_date:"\ " #{@end_date.inspect}, adjusted_start_date: #{@adjusted_start_date.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
124 125 126 127 128 129 |
# File 'lib/the_plaid_api/models/external_payment_schedule_get.rb', line 124 def to_s class_name = self.class.name.split('::').last "<#{class_name} interval: #{@interval}, interval_execution_day: #{@interval_execution_day},"\ " start_date: #{@start_date}, end_date: #{@end_date}, adjusted_start_date:"\ " #{@adjusted_start_date}, additional_properties: #{@additional_properties}>" end |