bleumi_pay_sdk_ruby 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -43
- data/bleumi_pay_sdk_ruby.gemspec +2 -3
- data/docs/BadRequest.md +1 -0
- data/docs/Chain.md +11 -0
- data/docs/CheckoutToken.md +23 -0
- data/docs/CreateCheckoutUrlRequest.md +30 -0
- data/docs/CreateCheckoutUrlResponse.md +17 -0
- data/docs/CreatePaymentRequest.md +19 -0
- data/docs/CreatePaymentResponse.md +15 -0
- data/docs/CreatePayoutRequest.md +28 -0
- data/docs/CreatePayoutResponse.md +15 -0
- data/docs/EthAddress.md +6 -1
- data/docs/HostedCheckoutsApi.md +190 -0
- data/docs/NetworkBalance.md +29 -0
- data/docs/PaginatedPaymentOperations.md +29 -0
- data/docs/PaginatedPayments.md +68 -0
- data/docs/PaginatedPayoutItems.md +59 -0
- data/docs/Payment.md +44 -0
- data/docs/PaymentAddresses.md +22 -0
- data/docs/PaymentBalances.md +24 -0
- data/docs/PaymentOperation.md +46 -0
- data/docs/PaymentOperationInputs.md +32 -0
- data/docs/PaymentOperationResponse.md +15 -0
- data/docs/PaymentRefundRequest.md +16 -0
- data/docs/PaymentSettleRequest.md +17 -0
- data/docs/PaymentsApi.md +426 -0
- data/docs/Payout.md +17 -0
- data/docs/PayoutItem.md +39 -0
- data/docs/PayoutItemInputs.md +28 -0
- data/docs/PayoutsApi.md +137 -0
- data/docs/Token.md +15 -0
- data/docs/ValidateCheckoutRequest.md +21 -0
- data/docs/ValidateCheckoutResponse.md +15 -0
- data/docs/WalletAddress.md +14 -0
- data/docs/WalletBalance.md +14 -4
- data/lib/bleumi_pay_sdk_ruby.rb +32 -15
- data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +200 -0
- data/lib/bleumi_pay_sdk_ruby/api/{erc20_payments_api.rb → payments_api.rb} +130 -124
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/api_error.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/configuration.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +13 -3
- data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +7 -5
- data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +272 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +299 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +227 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_input.rb → create_payment_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +18 -22
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +243 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/models/network_balance.rb +274 -0
- data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +224 -0
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallet_operations.rb → paginated_payments.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +30 -53
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +209 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +207 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +42 -17
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +37 -11
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/payout.rb +227 -0
- data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +286 -0
- data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +244 -0
- data/lib/bleumi_pay_sdk_ruby/models/token.rb +214 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → validate_checkout_request.rb} +57 -62
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_address.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +17 -7
- data/lib/bleumi_pay_sdk_ruby/version.rb +3 -3
- data/spec/api/hosted_checkouts_api_spec.rb +67 -0
- data/spec/api/payments_api_spec.rb +122 -0
- data/spec/api/payouts_api_spec.rb +61 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/bad_request_spec.rb +47 -0
- data/spec/models/chain_spec.rb +35 -0
- data/spec/models/checkout_token_spec.rb +65 -0
- data/spec/models/create_checkout_url_request_spec.rb +83 -0
- data/spec/models/create_checkout_url_response_spec.rb +47 -0
- data/spec/models/create_payment_request_spec.rb +53 -0
- data/spec/models/create_payment_response_spec.rb +41 -0
- data/spec/models/create_payout_request_spec.rb +53 -0
- data/spec/models/create_payout_response_spec.rb +41 -0
- data/spec/models/eth_address_spec.rb +41 -0
- data/spec/models/network_balance_spec.rb +77 -0
- data/spec/models/paginated_payment_operations_spec.rb +47 -0
- data/spec/models/paginated_payments_spec.rb +47 -0
- data/spec/models/paginated_payout_items_spec.rb +47 -0
- data/spec/models/payment_addresses_spec.rb +41 -0
- data/spec/models/payment_balances_spec.rb +41 -0
- data/spec/models/payment_operation_inputs_spec.rb +65 -0
- data/spec/models/payment_operation_response_spec.rb +41 -0
- data/spec/models/payment_operation_spec.rb +71 -0
- data/spec/models/payment_refund_request_spec.rb +41 -0
- data/spec/models/payment_settle_request_spec.rb +47 -0
- data/spec/models/payment_spec.rb +65 -0
- data/spec/models/payout_item_inputs_spec.rb +53 -0
- data/spec/models/payout_item_spec.rb +71 -0
- data/spec/models/payout_spec.rb +47 -0
- data/spec/models/token_spec.rb +41 -0
- data/spec/models/validate_checkout_request_spec.rb +59 -0
- data/spec/models/validate_checkout_response_spec.rb +41 -0
- data/spec/models/wallet_address_spec.rb +41 -0
- data/spec/models/wallet_balance_spec.rb +59 -0
- data/spec/spec_helper.rb +111 -0
- metadata +149 -45
- data/docs/Erc20PaymentsApi.md +0 -334
- data/docs/EthNetwork.md +0 -9
- data/docs/PaginatedWalletOperations.md +0 -8
- data/docs/PaginatedWallets.md +0 -8
- data/docs/Wallet.md +0 -13
- data/docs/WalletCreateInput.md +0 -9
- data/docs/WalletCreateOutput.md +0 -10
- data/docs/WalletInputs.md +0 -11
- data/docs/WalletOperation.md +0 -11
- data/docs/WalletOperationInputs.md +0 -10
- data/docs/WalletOperationOutput.md +0 -8
- data/docs/WalletRefundOperationInput.md +0 -7
- data/docs/WalletSettleOperationInput.md +0 -8
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bleumi Pay API
|
3
3
|
|
4
|
-
#A simple and powerful REST API to integrate
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: info@bleumi.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.2.
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -0,0 +1,274 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: info@bleumi.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module BleumiPay
|
16
|
+
class NetworkBalance
|
17
|
+
attr_accessor :mainnet
|
18
|
+
|
19
|
+
attr_accessor :xdai
|
20
|
+
|
21
|
+
attr_accessor :goerli
|
22
|
+
|
23
|
+
attr_accessor :kovan
|
24
|
+
|
25
|
+
attr_accessor :rinkeby
|
26
|
+
|
27
|
+
attr_accessor :ropsten
|
28
|
+
|
29
|
+
attr_accessor :xdai_testnet
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'mainnet' => :'mainnet',
|
35
|
+
:'xdai' => :'xdai',
|
36
|
+
:'goerli' => :'goerli',
|
37
|
+
:'kovan' => :'kovan',
|
38
|
+
:'rinkeby' => :'rinkeby',
|
39
|
+
:'ropsten' => :'ropsten',
|
40
|
+
:'xdai_testnet' => :'xdai_testnet'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'mainnet' => :'Hash<String, WalletBalance>',
|
48
|
+
:'xdai' => :'Hash<String, WalletBalance>',
|
49
|
+
:'goerli' => :'Hash<String, WalletBalance>',
|
50
|
+
:'kovan' => :'Hash<String, WalletBalance>',
|
51
|
+
:'rinkeby' => :'Hash<String, WalletBalance>',
|
52
|
+
:'ropsten' => :'Hash<String, WalletBalance>',
|
53
|
+
:'xdai_testnet' => :'Hash<String, WalletBalance>'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([
|
60
|
+
])
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
if (!attributes.is_a?(Hash))
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::NetworkBalance` initialize method"
|
68
|
+
end
|
69
|
+
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
72
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::NetworkBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
74
|
+
end
|
75
|
+
h[k.to_sym] = v
|
76
|
+
}
|
77
|
+
|
78
|
+
if attributes.key?(:'mainnet')
|
79
|
+
if (value = attributes[:'mainnet']).is_a?(Hash)
|
80
|
+
self.mainnet = value
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'xdai')
|
85
|
+
if (value = attributes[:'xdai']).is_a?(Hash)
|
86
|
+
self.xdai = value
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'goerli')
|
91
|
+
if (value = attributes[:'goerli']).is_a?(Hash)
|
92
|
+
self.goerli = value
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'kovan')
|
97
|
+
if (value = attributes[:'kovan']).is_a?(Hash)
|
98
|
+
self.kovan = value
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'rinkeby')
|
103
|
+
if (value = attributes[:'rinkeby']).is_a?(Hash)
|
104
|
+
self.rinkeby = value
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'ropsten')
|
109
|
+
if (value = attributes[:'ropsten']).is_a?(Hash)
|
110
|
+
self.ropsten = value
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'xdai_testnet')
|
115
|
+
if (value = attributes[:'xdai_testnet']).is_a?(Hash)
|
116
|
+
self.xdai_testnet = value
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
122
|
+
# @return Array for valid properties with the reasons
|
123
|
+
def list_invalid_properties
|
124
|
+
invalid_properties = Array.new
|
125
|
+
invalid_properties
|
126
|
+
end
|
127
|
+
|
128
|
+
# Check to see if the all the properties in the model are valid
|
129
|
+
# @return true if the model is valid
|
130
|
+
def valid?
|
131
|
+
true
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
mainnet == o.mainnet &&
|
140
|
+
xdai == o.xdai &&
|
141
|
+
goerli == o.goerli &&
|
142
|
+
kovan == o.kovan &&
|
143
|
+
rinkeby == o.rinkeby &&
|
144
|
+
ropsten == o.ropsten &&
|
145
|
+
xdai_testnet == o.xdai_testnet
|
146
|
+
end
|
147
|
+
|
148
|
+
# @see the `==` method
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def eql?(o)
|
151
|
+
self == o
|
152
|
+
end
|
153
|
+
|
154
|
+
# Calculates hash code according to all attributes.
|
155
|
+
# @return [Integer] Hash code
|
156
|
+
def hash
|
157
|
+
[mainnet, xdai, goerli, kovan, rinkeby, ropsten, xdai_testnet].hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def self.build_from_hash(attributes)
|
164
|
+
new.build_from_hash(attributes)
|
165
|
+
end
|
166
|
+
|
167
|
+
# Builds the object from hash
|
168
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
169
|
+
# @return [Object] Returns the model itself
|
170
|
+
def build_from_hash(attributes)
|
171
|
+
return nil unless attributes.is_a?(Hash)
|
172
|
+
self.class.openapi_types.each_pair do |key, type|
|
173
|
+
if type =~ /\AArray<(.*)>/i
|
174
|
+
# check to ensure the input is an array given that the attribute
|
175
|
+
# is documented as an array but the input is not
|
176
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
177
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
178
|
+
end
|
179
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
180
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
181
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
182
|
+
end
|
183
|
+
|
184
|
+
self
|
185
|
+
end
|
186
|
+
|
187
|
+
# Deserializes the data based on type
|
188
|
+
# @param string type Data type
|
189
|
+
# @param string value Value to be deserialized
|
190
|
+
# @return [Object] Deserialized data
|
191
|
+
def _deserialize(type, value)
|
192
|
+
case type.to_sym
|
193
|
+
when :DateTime
|
194
|
+
DateTime.parse(value)
|
195
|
+
when :Date
|
196
|
+
Date.parse(value)
|
197
|
+
when :String
|
198
|
+
value.to_s
|
199
|
+
when :Integer
|
200
|
+
value.to_i
|
201
|
+
when :Float
|
202
|
+
value.to_f
|
203
|
+
when :Boolean
|
204
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
205
|
+
true
|
206
|
+
else
|
207
|
+
false
|
208
|
+
end
|
209
|
+
when :Object
|
210
|
+
# generic object (usually a Hash), return directly
|
211
|
+
value
|
212
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
213
|
+
inner_type = Regexp.last_match[:inner_type]
|
214
|
+
value.map { |v| _deserialize(inner_type, v) }
|
215
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
216
|
+
k_type = Regexp.last_match[:k_type]
|
217
|
+
v_type = Regexp.last_match[:v_type]
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each do |k, v|
|
220
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
else # model
|
224
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# Returns the string representation of the object
|
229
|
+
# @return [String] String presentation of the object
|
230
|
+
def to_s
|
231
|
+
to_hash.to_s
|
232
|
+
end
|
233
|
+
|
234
|
+
# to_body is an alias to to_hash (backward compatibility)
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_body
|
237
|
+
to_hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Returns the object in the form of hash
|
241
|
+
# @return [Hash] Returns the object in the form of hash
|
242
|
+
def to_hash
|
243
|
+
hash = {}
|
244
|
+
self.class.attribute_map.each_pair do |attr, param|
|
245
|
+
value = self.send(attr)
|
246
|
+
if value.nil?
|
247
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
248
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
249
|
+
end
|
250
|
+
|
251
|
+
hash[param] = _to_hash(value)
|
252
|
+
end
|
253
|
+
hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Outputs non-array value in the form of hash
|
257
|
+
# For object, use to_hash. Otherwise, just return the value
|
258
|
+
# @param [Object] value Any valid value
|
259
|
+
# @return [Hash] Returns the value in the form of hash
|
260
|
+
def _to_hash(value)
|
261
|
+
if value.is_a?(Array)
|
262
|
+
value.compact.map { |v| _to_hash(v) }
|
263
|
+
elsif value.is_a?(Hash)
|
264
|
+
{}.tap do |hash|
|
265
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
266
|
+
end
|
267
|
+
elsif value.respond_to? :to_hash
|
268
|
+
value.to_hash
|
269
|
+
else
|
270
|
+
value
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: info@bleumi.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module BleumiPay
|
16
|
+
class PaginatedPaymentOperations
|
17
|
+
# List of operations of the payment in the current page
|
18
|
+
attr_accessor :results
|
19
|
+
|
20
|
+
# Cursor to fetch next page of results, empty if no more results
|
21
|
+
attr_accessor :next_token
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'results' => :'results',
|
27
|
+
:'next_token' => :'nextToken'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'results' => :'Array<PaymentOperation>',
|
35
|
+
:'next_token' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaginatedPaymentOperations` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::PaginatedPaymentOperations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'results')
|
61
|
+
if (value = attributes[:'results']).is_a?(Array)
|
62
|
+
self.results = value
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'next_token')
|
67
|
+
self.next_token = attributes[:'next_token']
|
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
|
+
if @results.nil?
|
76
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
77
|
+
end
|
78
|
+
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
return false if @results.nil?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Checks equality by comparing each attribute.
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
results == o.results &&
|
95
|
+
next_token == o.next_token
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[results, next_token].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
new.build_from_hash(attributes)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
123
|
+
if type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :DateTime
|
144
|
+
DateTime.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :Boolean
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the string representation of the object
|
179
|
+
# @return [String] String presentation of the object
|
180
|
+
def to_s
|
181
|
+
to_hash.to_s
|
182
|
+
end
|
183
|
+
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_body
|
187
|
+
to_hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the object in the form of hash
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_hash
|
193
|
+
hash = {}
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
195
|
+
value = self.send(attr)
|
196
|
+
if value.nil?
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
199
|
+
end
|
200
|
+
|
201
|
+
hash[param] = _to_hash(value)
|
202
|
+
end
|
203
|
+
hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Outputs non-array value in the form of hash
|
207
|
+
# For object, use to_hash. Otherwise, just return the value
|
208
|
+
# @param [Object] value Any valid value
|
209
|
+
# @return [Hash] Returns the value in the form of hash
|
210
|
+
def _to_hash(value)
|
211
|
+
if value.is_a?(Array)
|
212
|
+
value.compact.map { |v| _to_hash(v) }
|
213
|
+
elsif value.is_a?(Hash)
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
216
|
+
end
|
217
|
+
elsif value.respond_to? :to_hash
|
218
|
+
value.to_hash
|
219
|
+
else
|
220
|
+
value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|