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