bleumi_pay_sdk_ruby 1.0.2 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +67 -47
- data/bleumi_pay_sdk_ruby.gemspec +4 -5
- data/docs/AlgorandBalance.md +28 -0
- data/docs/AlgorandWalletAddress.md +24 -0
- data/docs/AlgorandWalletInputs.md +23 -0
- data/docs/BadRequest.md +2 -1
- data/docs/Chain.md +14 -0
- data/docs/CheckoutToken.md +28 -0
- data/docs/CreateCheckoutUrlRequest.md +28 -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/EthereumBalance.md +30 -0
- data/docs/EthereumWalletAddress.md +23 -0
- data/docs/EthereumWalletInputs.md +23 -0
- data/docs/HostedCheckoutsApi.md +197 -0
- data/docs/PaginatedPaymentOperations.md +28 -0
- data/docs/PaginatedPayments.md +95 -0
- data/docs/PaginatedPayoutItems.md +59 -0
- data/docs/Payment.md +67 -0
- data/docs/PaymentAddresses.md +21 -0
- data/docs/PaymentBalances.md +21 -0
- data/docs/PaymentOperation.md +46 -0
- data/docs/PaymentOperationInputs.md +31 -0
- data/docs/PaymentOperationResponse.md +15 -0
- data/docs/PaymentRefundRequest.md +14 -0
- data/docs/PaymentSettleRequest.md +17 -0
- data/docs/PaymentsApi.md +368 -0
- data/docs/Payout.md +18 -0
- data/docs/PayoutItem.md +39 -0
- data/docs/PayoutItemInputs.md +28 -0
- data/docs/PayoutsApi.md +137 -0
- data/docs/RskBalance.md +28 -0
- data/docs/ValidateCheckoutRequest.md +21 -0
- data/docs/ValidateCheckoutResponse.md +15 -0
- data/docs/WalletBalance.md +18 -4
- data/hc_create.rb +40 -0
- data/hc_list.rb +17 -0
- data/hc_validate.rb +22 -0
- data/lib/bleumi_pay_sdk_ruby.rb +38 -17
- data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +517 -0
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
- data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +288 -0
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +11 -9
- data/lib/bleumi_pay_sdk_ruby/api_error.rb +3 -3
- data/lib/bleumi_pay_sdk_ruby/configuration.rb +4 -4
- data/lib/bleumi_pay_sdk_ruby/models/algorand_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_address.rb +221 -0
- data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_inputs.rb +247 -0
- data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +15 -5
- data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +12 -9
- data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +302 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +312 -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} +33 -11
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +19 -23
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +244 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/ethereum_balance.rb +241 -0
- data/lib/bleumi_pay_sdk_ruby/models/ethereum_wallet_address.rb +221 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → ethereum_wallet_inputs.rb} +35 -50
- 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} +19 -9
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +19 -9
- data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +31 -54
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +231 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +225 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +44 -18
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +38 -12
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/payout.rb +237 -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/rsk_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb +257 -0
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +37 -12
- data/lib/bleumi_pay_sdk_ruby/version.rb +4 -4
- data/po_create.rb +39 -0
- data/po_list.rb +23 -0
- data/py_create.rb +48 -0
- data/py_get.rb +18 -0
- data/py_getop.rb +19 -0
- data/py_list.rb +24 -0
- data/py_listops.rb +21 -0
- data/py_refund.rb +43 -0
- data/py_settle.rb +43 -0
- data/spec/api/hosted_checkouts_api_spec.rb +67 -0
- data/spec/api/payments_api_spec.rb +123 -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/algorand_balance_spec.rb +47 -0
- data/spec/models/algorand_wallet_address_spec.rb +47 -0
- data/spec/models/algorand_wallet_inputs_spec.rb +65 -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 +77 -0
- data/spec/models/create_checkout_url_request_spec.rb +89 -0
- data/spec/models/create_checkout_url_response_spec.rb +47 -0
- data/spec/models/create_payment_request_spec.rb +59 -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/ethereum_balance_spec.rb +59 -0
- data/spec/models/ethereum_wallet_address_spec.rb +47 -0
- data/spec/models/ethereum_wallet_inputs_spec.rb +65 -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 +53 -0
- data/spec/models/payment_balances_spec.rb +53 -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 +53 -0
- data/spec/models/rsk_balance_spec.rb +47 -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_balance_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +180 -49
- data/docs/Erc20PaymentsApi.md +0 -334
- data/docs/EthAddress.md +0 -8
- 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
- data/lib/bleumi_pay_sdk_ruby/api/erc20_payments_api.rb +0 -482
- data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +0 -208
@@ -1,30 +1,36 @@
|
|
1
1
|
=begin
|
2
|
-
#Bleumi Pay API
|
2
|
+
#Bleumi Pay REST 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, Algorand 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
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module BleumiPay
|
16
|
-
class
|
17
|
-
# Unique ID identifying the
|
16
|
+
class CreatePaymentRequest
|
17
|
+
# Unique ID identifying the payment
|
18
18
|
attr_accessor :id
|
19
19
|
|
20
|
+
# (Only for Algorand Standard Asset) Asset id which will be used for payment.
|
21
|
+
attr_accessor :token
|
22
|
+
|
23
|
+
# Address of buyer. Refund operations on this payment will use this address. You can set this to your address to manually handle refunds (outside of Bleumi Pay) to your buyer. This address must be able to receive payments from smart contracts.
|
20
24
|
attr_accessor :buyer_address
|
21
25
|
|
26
|
+
# Your deposit address. Settle operations on this payment will use this address. This address must be able to receive payments from smart contracts.
|
22
27
|
attr_accessor :transfer_address
|
23
28
|
|
24
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
30
|
def self.attribute_map
|
26
31
|
{
|
27
32
|
:'id' => :'id',
|
33
|
+
:'token' => :'token',
|
28
34
|
:'buyer_address' => :'buyerAddress',
|
29
35
|
:'transfer_address' => :'transferAddress'
|
30
36
|
}
|
@@ -34,22 +40,29 @@ module BleumiPay
|
|
34
40
|
def self.openapi_types
|
35
41
|
{
|
36
42
|
:'id' => :'String',
|
37
|
-
:'
|
38
|
-
:'
|
43
|
+
:'token' => :'String',
|
44
|
+
:'buyer_address' => :'String',
|
45
|
+
:'transfer_address' => :'String'
|
39
46
|
}
|
40
47
|
end
|
41
48
|
|
49
|
+
# List of attributes with nullable: true
|
50
|
+
def self.openapi_nullable
|
51
|
+
Set.new([
|
52
|
+
])
|
53
|
+
end
|
54
|
+
|
42
55
|
# Initializes the object
|
43
56
|
# @param [Hash] attributes Model attributes in the form of hash
|
44
57
|
def initialize(attributes = {})
|
45
58
|
if (!attributes.is_a?(Hash))
|
46
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::CreatePaymentRequest` initialize method"
|
47
60
|
end
|
48
61
|
|
49
62
|
# check to see if the attribute exists and convert string to symbol for hash key
|
50
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
51
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::CreatePaymentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
53
66
|
end
|
54
67
|
h[k.to_sym] = v
|
55
68
|
}
|
@@ -58,6 +71,10 @@ module BleumiPay
|
|
58
71
|
self.id = attributes[:'id']
|
59
72
|
end
|
60
73
|
|
74
|
+
if attributes.key?(:'token')
|
75
|
+
self.token = attributes[:'token']
|
76
|
+
end
|
77
|
+
|
61
78
|
if attributes.key?(:'buyer_address')
|
62
79
|
self.buyer_address = attributes[:'buyer_address']
|
63
80
|
end
|
@@ -101,6 +118,7 @@ module BleumiPay
|
|
101
118
|
return true if self.equal?(o)
|
102
119
|
self.class == o.class &&
|
103
120
|
id == o.id &&
|
121
|
+
token == o.token &&
|
104
122
|
buyer_address == o.buyer_address &&
|
105
123
|
transfer_address == o.transfer_address
|
106
124
|
end
|
@@ -114,7 +132,7 @@ module BleumiPay
|
|
114
132
|
# Calculates hash code according to all attributes.
|
115
133
|
# @return [Integer] Hash code
|
116
134
|
def hash
|
117
|
-
[id, buyer_address, transfer_address].hash
|
135
|
+
[id, token, buyer_address, transfer_address].hash
|
118
136
|
end
|
119
137
|
|
120
138
|
# Builds the object from hash
|
@@ -203,7 +221,11 @@ module BleumiPay
|
|
203
221
|
hash = {}
|
204
222
|
self.class.attribute_map.each_pair do |attr, param|
|
205
223
|
value = self.send(attr)
|
206
|
-
|
224
|
+
if value.nil?
|
225
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
226
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
227
|
+
end
|
228
|
+
|
207
229
|
hash[param] = _to_hash(value)
|
208
230
|
end
|
209
231
|
hash
|
@@ -1,28 +1,25 @@
|
|
1
1
|
=begin
|
2
|
-
#Bleumi Pay API
|
2
|
+
#Bleumi Pay REST 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, Algorand 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
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module BleumiPay
|
16
|
-
class
|
17
|
-
|
18
|
-
|
19
|
-
# Address of the newly created wallet
|
16
|
+
class CreatePaymentResponse
|
17
|
+
# Address of the newly created payment
|
20
18
|
attr_accessor :addr
|
21
19
|
|
22
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
23
21
|
def self.attribute_map
|
24
22
|
{
|
25
|
-
:'chain' => :'chain',
|
26
23
|
:'addr' => :'addr'
|
27
24
|
}
|
28
25
|
end
|
@@ -30,30 +27,31 @@ module BleumiPay
|
|
30
27
|
# Attribute type mapping.
|
31
28
|
def self.openapi_types
|
32
29
|
{
|
33
|
-
:'chain' => :'EthNetwork',
|
34
30
|
:'addr' => :'String'
|
35
31
|
}
|
36
32
|
end
|
37
33
|
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
38
40
|
# Initializes the object
|
39
41
|
# @param [Hash] attributes Model attributes in the form of hash
|
40
42
|
def initialize(attributes = {})
|
41
43
|
if (!attributes.is_a?(Hash))
|
42
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::CreatePaymentResponse` initialize method"
|
43
45
|
end
|
44
46
|
|
45
47
|
# check to see if the attribute exists and convert string to symbol for hash key
|
46
48
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
47
49
|
if (!self.class.attribute_map.key?(k.to_sym))
|
48
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::CreatePaymentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
49
51
|
end
|
50
52
|
h[k.to_sym] = v
|
51
53
|
}
|
52
54
|
|
53
|
-
if attributes.key?(:'chain')
|
54
|
-
self.chain = attributes[:'chain']
|
55
|
-
end
|
56
|
-
|
57
55
|
if attributes.key?(:'addr')
|
58
56
|
self.addr = attributes[:'addr']
|
59
57
|
end
|
@@ -63,10 +61,6 @@ module BleumiPay
|
|
63
61
|
# @return Array for valid properties with the reasons
|
64
62
|
def list_invalid_properties
|
65
63
|
invalid_properties = Array.new
|
66
|
-
if @chain.nil?
|
67
|
-
invalid_properties.push('invalid value for "chain", chain cannot be nil.')
|
68
|
-
end
|
69
|
-
|
70
64
|
if @addr.nil?
|
71
65
|
invalid_properties.push('invalid value for "addr", addr cannot be nil.')
|
72
66
|
end
|
@@ -77,7 +71,6 @@ module BleumiPay
|
|
77
71
|
# Check to see if the all the properties in the model are valid
|
78
72
|
# @return true if the model is valid
|
79
73
|
def valid?
|
80
|
-
return false if @chain.nil?
|
81
74
|
return false if @addr.nil?
|
82
75
|
true
|
83
76
|
end
|
@@ -87,7 +80,6 @@ module BleumiPay
|
|
87
80
|
def ==(o)
|
88
81
|
return true if self.equal?(o)
|
89
82
|
self.class == o.class &&
|
90
|
-
chain == o.chain &&
|
91
83
|
addr == o.addr
|
92
84
|
end
|
93
85
|
|
@@ -100,7 +92,7 @@ module BleumiPay
|
|
100
92
|
# Calculates hash code according to all attributes.
|
101
93
|
# @return [Integer] Hash code
|
102
94
|
def hash
|
103
|
-
[
|
95
|
+
[addr].hash
|
104
96
|
end
|
105
97
|
|
106
98
|
# Builds the object from hash
|
@@ -189,7 +181,11 @@ module BleumiPay
|
|
189
181
|
hash = {}
|
190
182
|
self.class.attribute_map.each_pair do |attr, param|
|
191
183
|
value = self.send(attr)
|
192
|
-
|
184
|
+
if value.nil?
|
185
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
186
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
187
|
+
end
|
188
|
+
|
193
189
|
hash[param] = _to_hash(value)
|
194
190
|
end
|
195
191
|
hash
|
@@ -0,0 +1,244 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay REST API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand 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 CreatePayoutRequest
|
17
|
+
# Unique identifier for this payout
|
18
|
+
attr_accessor :txid
|
19
|
+
|
20
|
+
# ETH - for Ethereum ; XDAI - for xDai ; XDAIT - for xDai Testnet ; ALGO - Algo; <asset id> - for Algorand Standard Asset; <contract address of ERC-20 token> - for ERC-20 Tokens;
|
21
|
+
attr_accessor :token
|
22
|
+
|
23
|
+
# Array of payments to be made in this payout. This is an atomic transaction (i.e. either all payments are processed or all of them are rejected).
|
24
|
+
attr_accessor :payouts
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'txid' => :'txid',
|
30
|
+
:'token' => :'token',
|
31
|
+
:'payouts' => :'payouts'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'txid' => :'String',
|
39
|
+
:'token' => :'String',
|
40
|
+
:'payouts' => :'Array<Payout>'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::CreatePayoutRequest` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::CreatePayoutRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'txid')
|
66
|
+
self.txid = attributes[:'txid']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'token')
|
70
|
+
self.token = attributes[:'token']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'payouts')
|
74
|
+
if (value = attributes[:'payouts']).is_a?(Array)
|
75
|
+
self.payouts = value
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
invalid_properties = Array.new
|
84
|
+
if @txid.nil?
|
85
|
+
invalid_properties.push('invalid value for "txid", txid cannot be nil.')
|
86
|
+
end
|
87
|
+
|
88
|
+
if @token.nil?
|
89
|
+
invalid_properties.push('invalid value for "token", token cannot be nil.')
|
90
|
+
end
|
91
|
+
|
92
|
+
if @payouts.nil?
|
93
|
+
invalid_properties.push('invalid value for "payouts", payouts cannot be nil.')
|
94
|
+
end
|
95
|
+
|
96
|
+
invalid_properties
|
97
|
+
end
|
98
|
+
|
99
|
+
# Check to see if the all the properties in the model are valid
|
100
|
+
# @return true if the model is valid
|
101
|
+
def valid?
|
102
|
+
return false if @txid.nil?
|
103
|
+
return false if @token.nil?
|
104
|
+
return false if @payouts.nil?
|
105
|
+
true
|
106
|
+
end
|
107
|
+
|
108
|
+
# Checks equality by comparing each attribute.
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def ==(o)
|
111
|
+
return true if self.equal?(o)
|
112
|
+
self.class == o.class &&
|
113
|
+
txid == o.txid &&
|
114
|
+
token == o.token &&
|
115
|
+
payouts == o.payouts
|
116
|
+
end
|
117
|
+
|
118
|
+
# @see the `==` method
|
119
|
+
# @param [Object] Object to be compared
|
120
|
+
def eql?(o)
|
121
|
+
self == o
|
122
|
+
end
|
123
|
+
|
124
|
+
# Calculates hash code according to all attributes.
|
125
|
+
# @return [Integer] Hash code
|
126
|
+
def hash
|
127
|
+
[txid, token, payouts].hash
|
128
|
+
end
|
129
|
+
|
130
|
+
# Builds the object from hash
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
+
# @return [Object] Returns the model itself
|
133
|
+
def self.build_from_hash(attributes)
|
134
|
+
new.build_from_hash(attributes)
|
135
|
+
end
|
136
|
+
|
137
|
+
# Builds the object from hash
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
139
|
+
# @return [Object] Returns the model itself
|
140
|
+
def build_from_hash(attributes)
|
141
|
+
return nil unless attributes.is_a?(Hash)
|
142
|
+
self.class.openapi_types.each_pair do |key, type|
|
143
|
+
if type =~ /\AArray<(.*)>/i
|
144
|
+
# check to ensure the input is an array given that the attribute
|
145
|
+
# is documented as an array but the input is not
|
146
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
147
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
148
|
+
end
|
149
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
150
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
151
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
152
|
+
end
|
153
|
+
|
154
|
+
self
|
155
|
+
end
|
156
|
+
|
157
|
+
# Deserializes the data based on type
|
158
|
+
# @param string type Data type
|
159
|
+
# @param string value Value to be deserialized
|
160
|
+
# @return [Object] Deserialized data
|
161
|
+
def _deserialize(type, value)
|
162
|
+
case type.to_sym
|
163
|
+
when :DateTime
|
164
|
+
DateTime.parse(value)
|
165
|
+
when :Date
|
166
|
+
Date.parse(value)
|
167
|
+
when :String
|
168
|
+
value.to_s
|
169
|
+
when :Integer
|
170
|
+
value.to_i
|
171
|
+
when :Float
|
172
|
+
value.to_f
|
173
|
+
when :Boolean
|
174
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
175
|
+
true
|
176
|
+
else
|
177
|
+
false
|
178
|
+
end
|
179
|
+
when :Object
|
180
|
+
# generic object (usually a Hash), return directly
|
181
|
+
value
|
182
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
183
|
+
inner_type = Regexp.last_match[:inner_type]
|
184
|
+
value.map { |v| _deserialize(inner_type, v) }
|
185
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
186
|
+
k_type = Regexp.last_match[:k_type]
|
187
|
+
v_type = Regexp.last_match[:v_type]
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each do |k, v|
|
190
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
else # model
|
194
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
if value.nil?
|
217
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
218
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
219
|
+
end
|
220
|
+
|
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
|