Class: ThePlaidApi::TransferRepaymentListRequest

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

Overview

Defines the request schema for ‘/transfer/repayment/list`

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(client_id: SKIP, secret: SKIP, start_date: SKIP, end_date: SKIP, count: 25, offset: 0, additional_properties: nil) ⇒ TransferRepaymentListRequest

Returns a new instance of TransferRepaymentListRequest.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 73

def initialize(client_id: SKIP, secret: SKIP, start_date: SKIP,
               end_date: SKIP, count: 25, offset: 0,
               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
  @start_date = start_date unless start_date == SKIP
  @end_date = end_date unless end_date == SKIP
  @count = count unless count == SKIP
  @offset = offset unless offset == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#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)


17
18
19
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 17

def client_id
  @client_id
end

#countInteger

The maximum number of repayments to return.

Returns:

  • (Integer)


34
35
36
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 34

def count
  @count
end

#end_dateDateTime

The end ‘created` datetime of repayments to return (RFC 3339 format).

Returns:

  • (DateTime)


30
31
32
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 30

def end_date
  @end_date
end

#offsetInteger

The number of repayments to skip before returning results.

Returns:

  • (Integer)


38
39
40
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 38

def offset
  @offset
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)


22
23
24
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 22

def secret
  @secret
end

#start_dateDateTime

The start ‘created` datetime of repayments to return (RFC 3339 format).

Returns:

  • (DateTime)


26
27
28
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 26

def start_date
  @start_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



89
90
91
92
93
94
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
122
123
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 89

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  start_date = if hash.key?('start_date')
                 (DateTimeHelper.from_rfc3339(hash['start_date']) if hash['start_date'])
               else
                 SKIP
               end
  end_date = if hash.key?('end_date')
               (DateTimeHelper.from_rfc3339(hash['end_date']) if hash['end_date'])
             else
               SKIP
             end
  count = hash['count'] ||= 25
  offset = hash['offset'] ||= 0

  # 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.
  TransferRepaymentListRequest.new(client_id: client_id,
                                   secret: secret,
                                   start_date: start_date,
                                   end_date: end_date,
                                   count: count,
                                   offset: offset,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['start_date'] = 'start_date'
  @_hash['end_date'] = 'end_date'
  @_hash['count'] = 'count'
  @_hash['offset'] = 'offset'
  @_hash
end

.nullablesObject

An array for nullable fields



65
66
67
68
69
70
71
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 65

def self.nullables
  %w[
    start_date
    end_date
    count
  ]
end

.optionalsObject

An array for optional fields



53
54
55
56
57
58
59
60
61
62
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 53

def self.optionals
  %w[
    client_id
    secret
    start_date
    end_date
    count
    offset
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



142
143
144
145
146
147
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 142

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, start_date:"\
  " #{@start_date.inspect}, end_date: #{@end_date.inspect}, count: #{@count.inspect}, offset:"\
  " #{@offset.inspect}, additional_properties: #{@additional_properties}>"
end

#to_custom_end_dateObject



129
130
131
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 129

def to_custom_end_date
  DateTimeHelper.to_rfc3339(end_date)
end

#to_custom_start_dateObject



125
126
127
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 125

def to_custom_start_date
  DateTimeHelper.to_rfc3339(start_date)
end

#to_sObject

Provides a human-readable string representation of the object.



134
135
136
137
138
139
# File 'lib/the_plaid_api/models/transfer_repayment_list_request.rb', line 134

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, start_date: #{@start_date},"\
  " end_date: #{@end_date}, count: #{@count}, offset: #{@offset}, additional_properties:"\
  " #{@additional_properties}>"
end