yapstone-payouts 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +150 -0
  5. data/Rakefile +10 -0
  6. data/docs/AuthenticationApi.md +58 -0
  7. data/docs/CancelDepositRequest.md +17 -0
  8. data/docs/CancelRequest.md +19 -0
  9. data/docs/Deposit.md +31 -0
  10. data/docs/DepositDetail.md +23 -0
  11. data/docs/DepositListResponse.md +19 -0
  12. data/docs/DepositRequest.md +19 -0
  13. data/docs/Disbursement.md +27 -0
  14. data/docs/DisbursementListResponse.md +19 -0
  15. data/docs/DisbursementRequest.md +19 -0
  16. data/docs/FundingPool.md +31 -0
  17. data/docs/InlineResponse200.md +25 -0
  18. data/docs/Meta.md +17 -0
  19. data/docs/Page.md +21 -0
  20. data/docs/PaymentTransactionDetail.md +31 -0
  21. data/docs/PayoutsApi.md +2065 -0
  22. data/docs/PoolListResponse.md +21 -0
  23. data/docs/Reimbursement.md +27 -0
  24. data/docs/ReimbursementListResponse.md +19 -0
  25. data/docs/ReimbursementRequest.md +19 -0
  26. data/docs/ReverseDisbursementRequest.md +19 -0
  27. data/docs/ReverseReimbursementRequest.md +19 -0
  28. data/docs/StatusChanges.md +19 -0
  29. data/git_push.sh +55 -0
  30. data/lib/yapstone-payouts.rb +62 -0
  31. data/lib/yapstone-payouts/api/authentication_api.rb +92 -0
  32. data/lib/yapstone-payouts/api/payouts_api.rb +2462 -0
  33. data/lib/yapstone-payouts/api_client.rb +386 -0
  34. data/lib/yapstone-payouts/api_error.rb +57 -0
  35. data/lib/yapstone-payouts/configuration.rb +249 -0
  36. data/lib/yapstone-payouts/models/cancel_deposit_request.rb +235 -0
  37. data/lib/yapstone-payouts/models/cancel_request.rb +244 -0
  38. data/lib/yapstone-payouts/models/deposit.rb +261 -0
  39. data/lib/yapstone-payouts/models/deposit_detail.rb +233 -0
  40. data/lib/yapstone-payouts/models/deposit_list_response.rb +207 -0
  41. data/lib/yapstone-payouts/models/deposit_request.rb +217 -0
  42. data/lib/yapstone-payouts/models/disbursement.rb +243 -0
  43. data/lib/yapstone-payouts/models/disbursement_list_response.rb +207 -0
  44. data/lib/yapstone-payouts/models/disbursement_request.rb +217 -0
  45. data/lib/yapstone-payouts/models/funding_pool.rb +259 -0
  46. data/lib/yapstone-payouts/models/inline_response200.rb +232 -0
  47. data/lib/yapstone-payouts/models/meta.rb +197 -0
  48. data/lib/yapstone-payouts/models/page.rb +218 -0
  49. data/lib/yapstone-payouts/models/payment_transaction_detail.rb +279 -0
  50. data/lib/yapstone-payouts/models/pool_list_response.rb +216 -0
  51. data/lib/yapstone-payouts/models/reimbursement.rb +243 -0
  52. data/lib/yapstone-payouts/models/reimbursement_list_response.rb +207 -0
  53. data/lib/yapstone-payouts/models/reimbursement_request.rb +217 -0
  54. data/lib/yapstone-payouts/models/reverse_disbursement_request.rb +215 -0
  55. data/lib/yapstone-payouts/models/reverse_reimbursement_request.rb +215 -0
  56. data/lib/yapstone-payouts/models/status_changes.rb +205 -0
  57. data/lib/yapstone-payouts/version.rb +15 -0
  58. data/spec/api/authentication_api_spec.rb +48 -0
  59. data/spec/api/payouts_api_spec.rb +506 -0
  60. data/spec/api_client_spec.rb +226 -0
  61. data/spec/configuration_spec.rb +42 -0
  62. data/spec/models/cancel_deposit_request_spec.rb +45 -0
  63. data/spec/models/cancel_request_spec.rb +51 -0
  64. data/spec/models/deposit_detail_spec.rb +59 -0
  65. data/spec/models/deposit_list_response_spec.rb +47 -0
  66. data/spec/models/deposit_request_spec.rb +47 -0
  67. data/spec/models/deposit_spec.rb +83 -0
  68. data/spec/models/disbursement_list_response_spec.rb +47 -0
  69. data/spec/models/disbursement_request_spec.rb +47 -0
  70. data/spec/models/disbursement_spec.rb +71 -0
  71. data/spec/models/funding_pool_spec.rb +83 -0
  72. data/spec/models/inline_response200_spec.rb +65 -0
  73. data/spec/models/meta_spec.rb +41 -0
  74. data/spec/models/page_spec.rb +53 -0
  75. data/spec/models/payment_transaction_detail_spec.rb +83 -0
  76. data/spec/models/pool_list_response_spec.rb +53 -0
  77. data/spec/models/reimbursement_list_response_spec.rb +47 -0
  78. data/spec/models/reimbursement_request_spec.rb +47 -0
  79. data/spec/models/reimbursement_spec.rb +71 -0
  80. data/spec/models/reverse_disbursement_request_spec.rb +47 -0
  81. data/spec/models/reverse_reimbursement_request_spec.rb +47 -0
  82. data/spec/models/status_changes_spec.rb +47 -0
  83. data/spec/spec_helper.rb +111 -0
  84. data/yapstone-payouts.gemspec +45 -0
  85. metadata +333 -0
@@ -0,0 +1,279 @@
1
+ =begin
2
+ #Payout Orchestrator API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ class PaymentTransactionDetail
17
+ attr_accessor :client_unique_txn_id
18
+
19
+ attr_accessor :client_correlation_id
20
+
21
+ attr_accessor :origination_id
22
+
23
+ attr_accessor :payer_party_id
24
+
25
+ attr_accessor :payee_contract_id
26
+
27
+ attr_accessor :payee_instrument_id
28
+
29
+ attr_accessor :payee_applicant_id
30
+
31
+ attr_accessor :amount
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'client_unique_txn_id' => :'clientUniqueTxnId',
37
+ :'client_correlation_id' => :'clientCorrelationId',
38
+ :'origination_id' => :'originationId',
39
+ :'payer_party_id' => :'payerPartyId',
40
+ :'payee_contract_id' => :'payeeContractId',
41
+ :'payee_instrument_id' => :'payeeInstrumentId',
42
+ :'payee_applicant_id' => :'payeeApplicantId',
43
+ :'amount' => :'amount'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'client_unique_txn_id' => :'String',
51
+ :'client_correlation_id' => :'String',
52
+ :'origination_id' => :'String',
53
+ :'payer_party_id' => :'String',
54
+ :'payee_contract_id' => :'String',
55
+ :'payee_instrument_id' => :'String',
56
+ :'payee_applicant_id' => :'String',
57
+ :'amount' => :'Integer'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::PaymentTransactionDetail` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::PaymentTransactionDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'client_unique_txn_id')
77
+ self.client_unique_txn_id = attributes[:'client_unique_txn_id']
78
+ end
79
+
80
+ if attributes.key?(:'client_correlation_id')
81
+ self.client_correlation_id = attributes[:'client_correlation_id']
82
+ end
83
+
84
+ if attributes.key?(:'origination_id')
85
+ self.origination_id = attributes[:'origination_id']
86
+ end
87
+
88
+ if attributes.key?(:'payer_party_id')
89
+ self.payer_party_id = attributes[:'payer_party_id']
90
+ end
91
+
92
+ if attributes.key?(:'payee_contract_id')
93
+ self.payee_contract_id = attributes[:'payee_contract_id']
94
+ end
95
+
96
+ if attributes.key?(:'payee_instrument_id')
97
+ self.payee_instrument_id = attributes[:'payee_instrument_id']
98
+ end
99
+
100
+ if attributes.key?(:'payee_applicant_id')
101
+ self.payee_applicant_id = attributes[:'payee_applicant_id']
102
+ end
103
+
104
+ if attributes.key?(:'amount')
105
+ self.amount = attributes[:'amount']
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ invalid_properties = Array.new
113
+ if @payee_contract_id.nil?
114
+ invalid_properties.push('invalid value for "payee_contract_id", payee_contract_id cannot be nil.')
115
+ end
116
+
117
+ if @payee_instrument_id.nil?
118
+ invalid_properties.push('invalid value for "payee_instrument_id", payee_instrument_id cannot be nil.')
119
+ end
120
+
121
+ if @payee_applicant_id.nil?
122
+ invalid_properties.push('invalid value for "payee_applicant_id", payee_applicant_id cannot be nil.')
123
+ end
124
+
125
+ if @amount.nil?
126
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ return false if @payee_contract_id.nil?
136
+ return false if @payee_instrument_id.nil?
137
+ return false if @payee_applicant_id.nil?
138
+ return false if @amount.nil?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ client_unique_txn_id == o.client_unique_txn_id &&
148
+ client_correlation_id == o.client_correlation_id &&
149
+ origination_id == o.origination_id &&
150
+ payer_party_id == o.payer_party_id &&
151
+ payee_contract_id == o.payee_contract_id &&
152
+ payee_instrument_id == o.payee_instrument_id &&
153
+ payee_applicant_id == o.payee_applicant_id &&
154
+ amount == o.amount
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [client_unique_txn_id, client_correlation_id, origination_id, payer_party_id, payee_contract_id, payee_instrument_id, payee_applicant_id, amount].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ new.build_from_hash(attributes)
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.openapi_types.each_pair do |key, type|
182
+ if type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ Yapstone.const_get(type).build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ next if value.nil?
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #Payout Orchestrator API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ class PoolListResponse
17
+ attr_accessor :meta
18
+
19
+ attr_accessor :get_meta
20
+
21
+ attr_accessor :funding_pools
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'meta' => :'meta',
27
+ :'get_meta' => :'get_meta',
28
+ :'funding_pools' => :'fundingPools'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'meta' => :'Meta',
36
+ :'get_meta' => :'Meta',
37
+ :'funding_pools' => :'Array<FundingPool>'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::PoolListResponse` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::PoolListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'meta')
57
+ self.meta = attributes[:'meta']
58
+ end
59
+
60
+ if attributes.key?(:'get_meta')
61
+ self.get_meta = attributes[:'get_meta']
62
+ end
63
+
64
+ if attributes.key?(:'funding_pools')
65
+ if (value = attributes[:'funding_pools']).is_a?(Array)
66
+ self.funding_pools = value
67
+ end
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ meta == o.meta &&
90
+ get_meta == o.get_meta &&
91
+ funding_pools == o.funding_pools
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [meta, get_meta, funding_pools].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ new.build_from_hash(attributes)
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.openapi_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ Yapstone.const_get(type).build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ next if value.nil?
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+ end
216
+ end