Class: ThePlaidApi::SignalScheduleRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/signal_schedule_request.rb

Overview

SignalScheduleRequest defines the request schema for ‘/signal/schedule`

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(access_token:, account_id:, client_transaction_id:, amount:, client_id: SKIP, secret: SKIP, default_payment_method: SKIP, additional_properties: nil) ⇒ SignalScheduleRequest

Returns a new instance of SignalScheduleRequest.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 94

def initialize(access_token:, account_id:, client_transaction_id:, amount:,
               client_id: SKIP, secret: SKIP, default_payment_method: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @access_token = access_token
  @account_id = 
  @client_transaction_id = client_transaction_id
  @amount = amount
  @default_payment_method = default_payment_method unless default_payment_method == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#access_tokenString

The access token associated with the Item data is being requested for.

Returns:

  • (String)


25
26
27
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 25

def access_token
  @access_token
end

#account_idString

The Plaid ‘account_id` of the account that is the funding source for the proposed transaction. The `account_id` is returned in the `/accounts/get` endpoint as well as the [`onSuccess`](plaid.com/docs/link/ios/#link-ios-onsuccess-linkSucc ess-metadata-accounts-id) callback metadata. This will return an [`INVALID_ACCOUNT_ID`](plaid.com/docs/errors/invalid-input/#invali d_account_id) error if the account has been removed at the bank or if the `account_id` is no longer valid.

Returns:

  • (String)


37
38
39
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 37

def 
  @account_id
end

#amountFloat

The transaction amount, in USD (e.g. ‘102.05`)

Returns:

  • (Float)


48
49
50
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 48

def amount
  @amount
end

#client_idString

Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 16

def client_id
  @client_id
end

#client_transaction_idString

The unique ID that you would like to use to refer to this transaction. For your convenience mapping your internal data, you could use your internal ID/identifier for this transaction. The max length for this field is 36 characters.

Returns:

  • (String)


44
45
46
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 44

def client_transaction_id
  @client_transaction_id
end

#default_payment_methodSignalScheduleDefaultPaymentMethod

The payment method specified in the ‘default_payment_method` field directly impacts the timing recommendations provided by the API for submitting the debit entry to your processor or ODFI. If unspecified, defaults to `STANDARD_ACH`. `SAME_DAY_ACH`: Same Day ACH (as defined by Nacha). The API assumes the settlement will occur on the same business day if the `/signal/schedule` request is submitted by 6:00 PM UTC. Note: The actual cutoff time can vary depending on your payment processor or ODFI. Nacha has established three processing windows for Same Day ACH (UTC): 2:30 PM, 6:45 PM, and 8:45 PM. `STANDARD_ACH`: Standard ACH (as defined by Nacha), typically settled one to three business days after submission. `MULTIPLE_PAYMENT_METHODS`: Indicates that there is no default debit rail or multiple payment methods are available, and the transaction could use any of them based on customer policy or availability.



65
66
67
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 65

def default_payment_method
  @default_payment_method
end

#secretString

Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 21

def secret
  @secret
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 111

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  access_token = hash.key?('access_token') ? hash['access_token'] : nil
   = hash.key?('account_id') ? hash['account_id'] : nil
  client_transaction_id =
    hash.key?('client_transaction_id') ? hash['client_transaction_id'] : nil
  amount = hash.key?('amount') ? hash['amount'] : nil
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  default_payment_method =
    hash.key?('default_payment_method') ? hash['default_payment_method'] : SKIP

  # 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.
  SignalScheduleRequest.new(access_token: access_token,
                            account_id: ,
                            client_transaction_id: client_transaction_id,
                            amount: amount,
                            client_id: client_id,
                            secret: secret,
                            default_payment_method: default_payment_method,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 68

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['access_token'] = 'access_token'
  @_hash['account_id'] = 'account_id'
  @_hash['client_transaction_id'] = 'client_transaction_id'
  @_hash['amount'] = 'amount'
  @_hash['default_payment_method'] = 'default_payment_method'
  @_hash
end

.nullablesObject

An array for nullable fields



90
91
92
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 90

def self.nullables
  []
end

.optionalsObject

An array for optional fields



81
82
83
84
85
86
87
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 81

def self.optionals
  %w[
    client_id
    secret
    default_payment_method
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



153
154
155
156
157
158
159
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 153

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, access_token:"\
  " #{@access_token.inspect}, account_id: #{@account_id.inspect}, client_transaction_id:"\
  " #{@client_transaction_id.inspect}, amount: #{@amount.inspect}, default_payment_method:"\
  " #{@default_payment_method.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



144
145
146
147
148
149
150
# File 'lib/the_plaid_api/models/signal_schedule_request.rb', line 144

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, access_token:"\
  " #{@access_token}, account_id: #{@account_id}, client_transaction_id:"\
  " #{@client_transaction_id}, amount: #{@amount}, default_payment_method:"\
  " #{@default_payment_method}, additional_properties: #{@additional_properties}>"
end