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,235 @@
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 CancelDepositRequest
17
+ attr_accessor :action
18
+
19
+ class EnumAttributeValidator
20
+ attr_reader :datatype
21
+ attr_reader :allowable_values
22
+
23
+ def initialize(datatype, allowable_values)
24
+ @allowable_values = allowable_values.map do |value|
25
+ case datatype.to_s
26
+ when /Integer/i
27
+ value.to_i
28
+ when /Float/i
29
+ value.to_f
30
+ else
31
+ value
32
+ end
33
+ end
34
+ end
35
+
36
+ def valid?(value)
37
+ !value || allowable_values.include?(value)
38
+ end
39
+ end
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'action' => :'action'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'action' => :'String'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::CancelDepositRequest` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::CancelDepositRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'action')
71
+ self.action = attributes[:'action']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @action.nil?
80
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @action.nil?
90
+ action_validator = EnumAttributeValidator.new('String', ["CANCEL"])
91
+ return false unless action_validator.valid?(@action)
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method checking allowed values (enum).
96
+ # @param [Object] action Object to be assigned
97
+ def action=(action)
98
+ validator = EnumAttributeValidator.new('String', ["CANCEL"])
99
+ unless validator.valid?(action)
100
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
101
+ end
102
+ @action = action
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ action == o.action
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [action].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ Yapstone.const_get(type).build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ next if value.nil?
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+ end
235
+ end
@@ -0,0 +1,244 @@
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 CancelRequest
17
+ attr_accessor :amount
18
+
19
+ attr_accessor :action
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'amount' => :'amount',
47
+ :'action' => :'action'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'amount' => :'Integer',
55
+ :'action' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::CancelRequest` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::CancelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'amount')
75
+ self.amount = attributes[:'amount']
76
+ end
77
+
78
+ if attributes.key?(:'action')
79
+ self.action = attributes[:'action']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @action.nil?
88
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @action.nil?
98
+ action_validator = EnumAttributeValidator.new('String', ["CANCEL", "REVERSE"])
99
+ return false unless action_validator.valid?(@action)
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method checking allowed values (enum).
104
+ # @param [Object] action Object to be assigned
105
+ def action=(action)
106
+ validator = EnumAttributeValidator.new('String', ["CANCEL", "REVERSE"])
107
+ unless validator.valid?(action)
108
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
109
+ end
110
+ @action = action
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ amount == o.amount &&
119
+ action == o.action
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [amount, action].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.openapi_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ Yapstone.const_get(type).build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+ end
244
+ end