transferzero-sdk 1.8.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +93 -0
- data/README.md +15 -5
- data/docs/AccountMeta.md +1 -1
- data/docs/AccountValidationRequest.md +2 -0
- data/docs/Currency.md +1 -3
- data/docs/CurrencyExchange.md +1 -3
- data/docs/CurrencyOpposite.md +4 -4
- data/docs/Document.md +7 -3
- data/docs/DocumentsApi.md +2 -74
- data/docs/FieldSelectValidation.md +1 -1
- data/docs/FieldValidation.md +1 -1
- data/docs/PayinMethodDetails.md +3 -1
- data/docs/PayinMethodDetailsBTC.md +17 -0
- data/docs/PayinMethodDetailsMobile.md +1 -1
- data/docs/PaymentMethod.md +2 -2
- data/docs/PaymentMethodOpposite.md +2 -2
- data/docs/PayoutMethod.md +1 -1
- data/docs/PayoutMethodCashProviderEnum.md +16 -0
- data/docs/PayoutMethodCountryEnum.md +16 -0
- data/docs/PayoutMethodDetails.md +21 -1
- data/docs/PayoutMethodDetailsBTC.md +23 -0
- data/docs/PayoutMethodDetailsGBPBank.md +29 -0
- data/docs/PayoutMethodDetailsIBAN.md +1 -1
- data/docs/PayoutMethodDetailsMobile.md +3 -1
- data/docs/PayoutMethodDetailsXOFCash.md +25 -0
- data/docs/PayoutMethodDetailsZARBank.md +35 -0
- data/docs/ProofOfPayment.md +23 -0
- data/docs/ProofOfPaymentListResponse.md +17 -0
- data/docs/Recipient.md +8 -4
- data/docs/RecipientStateReasonDetails.md +23 -0
- data/docs/RecipientsApi.md +63 -1
- data/docs/Sender.md +74 -34
- data/lib/transferzero-sdk.rb +10 -0
- data/lib/transferzero-sdk/api/documents_api.rb +0 -63
- data/lib/transferzero-sdk/api/recipients_api.rb +56 -2
- data/lib/transferzero-sdk/api_client.rb +5 -3
- data/lib/transferzero-sdk/models/account.rb +70 -69
- data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/account_meta.rb +61 -60
- data/lib/transferzero-sdk/models/account_response.rb +66 -65
- data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
- data/lib/transferzero-sdk/models/account_validation_request.rb +171 -161
- data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
- data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
- data/lib/transferzero-sdk/models/api_log.rb +136 -135
- data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
- data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
- data/lib/transferzero-sdk/models/currency.rb +133 -142
- data/lib/transferzero-sdk/models/currency_exchange.rb +149 -158
- data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
- data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
- data/lib/transferzero-sdk/models/currency_opposite.rb +166 -165
- data/lib/transferzero-sdk/models/debit.rb +151 -150
- data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
- data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/debit_request.rb +60 -59
- data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
- data/lib/transferzero-sdk/models/debit_response.rb +60 -59
- data/lib/transferzero-sdk/models/document.rb +197 -175
- data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/document_request.rb +60 -59
- data/lib/transferzero-sdk/models/document_response.rb +60 -59
- data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/error_status.rb +66 -65
- data/lib/transferzero-sdk/models/field_description.rb +95 -94
- data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
- data/lib/transferzero-sdk/models/field_validation.rb +78 -77
- data/lib/transferzero-sdk/models/pagination.rb +97 -96
- data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
- data/lib/transferzero-sdk/models/payin_method.rb +97 -96
- data/lib/transferzero-sdk/models/payin_method_details.rb +122 -110
- data/lib/transferzero-sdk/models/payin_method_details_btc.rb +204 -0
- data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
- data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -70
- data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
- data/lib/transferzero-sdk/models/payment_method.rb +109 -108
- data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
- data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
- data/lib/transferzero-sdk/models/payout_method.rb +107 -106
- data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
- data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +31 -0
- data/lib/transferzero-sdk/models/payout_method_country_enum.rb +32 -0
- data/lib/transferzero-sdk/models/payout_method_details.rb +417 -297
- data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
- data/lib/transferzero-sdk/models/payout_method_details_btc.rb +250 -0
- data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
- data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
- data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
- data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
- data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +93 -83
- data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -103
- data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +108 -107
- data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +254 -0
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
- data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +324 -0
- data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
- data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
- data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +17 -19
- data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
- data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
- data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/politically_exposed_person.rb +123 -123
- data/lib/transferzero-sdk/models/proof_of_payment.rb +233 -0
- data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +204 -0
- data/lib/transferzero-sdk/models/recipient.rb +246 -226
- data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
- data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
- data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
- data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +235 -0
- data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/sender.rb +595 -358
- data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/sender_request.rb +60 -59
- data/lib/transferzero-sdk/models/sender_response.rb +66 -65
- data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
- data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
- data/lib/transferzero-sdk/models/sender_state.rb +19 -24
- data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/transaction.rb +192 -191
- data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
- data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
- data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
- data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
- data/lib/transferzero-sdk/models/transaction_state.rb +23 -28
- data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
- data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
- data/lib/transferzero-sdk/models/webhook.rb +92 -91
- data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
- data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
- data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
- data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
- data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
- data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
- data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
- data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
- data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
- data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
- data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
- data/lib/transferzero-sdk/version.rb +1 -1
- data/spec/models/payin_method_details_btc_spec.rb +41 -0
- data/spec/models/payout_method_cash_provider_enum_spec.rb +35 -0
- data/spec/models/payout_method_country_enum_spec.rb +35 -0
- data/spec/models/payout_method_details_btc_spec.rb +59 -0
- data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
- data/spec/models/payout_method_details_xof_cash_spec.rb +71 -0
- data/spec/models/payout_method_details_zar_bank_spec.rb +89 -0
- data/spec/models/proof_of_payment_list_response_spec.rb +41 -0
- data/spec/models/proof_of_payment_spec.rb +59 -0
- data/spec/models/recipient_state_reason_details_spec.rb +59 -0
- data/transferzero-sdk-1.10.0.gem +0 -0
- data/transferzero-sdk-1.11.0.gem +0 -0
- metadata +46 -3
@@ -0,0 +1,204 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class ProofOfPaymentListResponse
|
17
|
+
attr_accessor :object
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'object' => :'object'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'object' => :'Array<ProofOfPayment>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
if (!attributes.is_a?(Hash))
|
37
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ProofOfPaymentListResponse` initialize method"
|
38
|
+
end
|
39
|
+
|
40
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
42
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
43
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ProofOfPaymentListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
44
|
+
end
|
45
|
+
h[k.to_sym] = v
|
46
|
+
}
|
47
|
+
|
48
|
+
if attributes.key?(:'object')
|
49
|
+
if (value = attributes[:'object']).is_a?(Array)
|
50
|
+
self.object = value
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
56
|
+
# @return Array for valid properties with the reasons
|
57
|
+
def list_invalid_properties
|
58
|
+
invalid_properties = Array.new
|
59
|
+
invalid_properties
|
60
|
+
end
|
61
|
+
|
62
|
+
# Check to see if the all the properties in the model are valid
|
63
|
+
# @return true if the model is valid
|
64
|
+
def valid?
|
65
|
+
true
|
66
|
+
end
|
67
|
+
|
68
|
+
# Checks equality by comparing each attribute.
|
69
|
+
# @param [Object] Object to be compared
|
70
|
+
def ==(o)
|
71
|
+
return true if self.equal?(o)
|
72
|
+
self.class == o.class &&
|
73
|
+
object == o.object
|
74
|
+
end
|
75
|
+
|
76
|
+
# @see the `==` method
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def eql?(o)
|
79
|
+
self == o
|
80
|
+
end
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Integer] Hash code
|
84
|
+
def hash
|
85
|
+
[object].hash
|
86
|
+
end
|
87
|
+
|
88
|
+
require 'active_support/core_ext/hash'
|
89
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
90
|
+
# Builds the object from hash
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
# @return [Object] Returns the model itself
|
93
|
+
def build_from_hash(attributes)
|
94
|
+
return nil unless attributes.is_a?(Hash)
|
95
|
+
self.class.openapi_types.each_pair do |key, type|
|
96
|
+
if type =~ /\AArray<(.*)>/i
|
97
|
+
# check to ensure the input is an array given that the the attribute
|
98
|
+
# is documented as an array but the input is not
|
99
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
100
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
101
|
+
end
|
102
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
103
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
104
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
105
|
+
end
|
106
|
+
|
107
|
+
self
|
108
|
+
end
|
109
|
+
|
110
|
+
# Deserializes the data based on type
|
111
|
+
# @param string type Data type
|
112
|
+
# @param string value Value to be deserialized
|
113
|
+
# @return [Object] Deserialized data
|
114
|
+
def _deserialize(type, value)
|
115
|
+
case type.to_sym
|
116
|
+
when :DateTime
|
117
|
+
DateTime.parse(value)
|
118
|
+
when :Date
|
119
|
+
Date.parse(value)
|
120
|
+
when :String
|
121
|
+
value.to_s
|
122
|
+
when :Integer
|
123
|
+
value.to_i
|
124
|
+
when :Float
|
125
|
+
value.to_f
|
126
|
+
when :Boolean
|
127
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
128
|
+
true
|
129
|
+
else
|
130
|
+
false
|
131
|
+
end
|
132
|
+
when :Object
|
133
|
+
# generic object (usually a Hash), return directly
|
134
|
+
value
|
135
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
136
|
+
inner_type = Regexp.last_match[:inner_type]
|
137
|
+
value.map { |v| _deserialize(inner_type, v) }
|
138
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
139
|
+
k_type = Regexp.last_match[:k_type]
|
140
|
+
v_type = Regexp.last_match[:v_type]
|
141
|
+
{}.tap do |hash|
|
142
|
+
value.each do |k, v|
|
143
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
else # model
|
147
|
+
temp_model = TransferZero.const_get(type).new
|
148
|
+
temp_model.build_from_hash(value)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# Returns the string representation of the object
|
153
|
+
# @return [String] String presentation of the object
|
154
|
+
def to_s
|
155
|
+
to_hash.to_s
|
156
|
+
end
|
157
|
+
|
158
|
+
# to_body is an alias to to_hash (backward compatibility)
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
160
|
+
def to_body
|
161
|
+
to_hash
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the object in the form of hash
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
166
|
+
def to_hash
|
167
|
+
hash = {}
|
168
|
+
self.class.attribute_map.each_pair do |attr, param|
|
169
|
+
value = self.send(attr)
|
170
|
+
next if value.nil?
|
171
|
+
hash[param] = _to_hash(value)
|
172
|
+
end
|
173
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
174
|
+
end
|
175
|
+
|
176
|
+
def [](key)
|
177
|
+
to_hash[key]
|
178
|
+
end
|
179
|
+
|
180
|
+
def dig(*args)
|
181
|
+
to_hash.dig(*args)
|
182
|
+
end
|
183
|
+
|
184
|
+
# Outputs non-array value in the form of hash
|
185
|
+
# For object, use to_hash. Otherwise, just return the value
|
186
|
+
# @param [Object] value Any valid value
|
187
|
+
# @return [Hash] Returns the value in the form of hash
|
188
|
+
def _to_hash(value)
|
189
|
+
if value.is_a?(Array)
|
190
|
+
value.compact.map { |v| _to_hash(v) }
|
191
|
+
elsif value.is_a?(Hash)
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
194
|
+
end
|
195
|
+
elsif value.respond_to? :to_hash
|
196
|
+
value.to_hash
|
197
|
+
else
|
198
|
+
value
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|
203
|
+
|
204
|
+
end
|
@@ -13,291 +13,310 @@ OpenAPI Generator version: 4.0.0-beta3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TransferZero
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
# The recipient describes the amount, the currency and the destination where the money should be sent.
|
17
|
+
class Recipient
|
18
|
+
# the amount that should be paid to the recipient. This can be in any currency, usually either the input or the output currency. If the value here is not the output currency we will calculate how much the recipient is going to get using the exchange rates active when the transaction was created.
|
19
|
+
attr_accessor :requested_amount
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
# the currency of the amount in 3-character alpha ISO 4217 currency format
|
22
|
+
attr_accessor :requested_currency
|
23
23
|
|
24
|
-
|
24
|
+
attr_accessor :payout_method
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
# Additional metadata that can be added to a recipient. These values will be returned on request
|
27
|
+
attr_accessor :metadata
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
# Date and time that the recipient was created.
|
30
|
+
attr_accessor :created_at
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
# Shows whether the recipient can be edited using the PATCH /v1/recipients/{id} endpoint or not
|
33
|
+
attr_accessor :editable
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
# Shows whether the transaction made to the recipient can be retried or not
|
36
|
+
attr_accessor :retriable
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
# Shows how much this payment is worth in USD
|
39
|
+
attr_accessor :input_usd_amount
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
# If true it shows that the payment can be cancelled immediately using the DELETE /v1/recipients/{id} endpoint. If false you can still try to cancel it, however it will only gets cancelled once we have confirmation from our partner that the payment has failed.
|
42
|
+
attr_accessor :may_cancel
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
# In case the payment is unsuccessful it holds the error message associated with the last unsuccessful payout.
|
45
|
+
attr_accessor :state_reason
|
46
46
|
|
47
|
-
|
47
|
+
attr_accessor :state_reason_details
|
48
48
|
|
49
|
-
|
50
|
-
attr_accessor :transaction_id
|
49
|
+
attr_accessor :state
|
51
50
|
|
52
|
-
|
51
|
+
# The ID of the transaction that is related to this recipient
|
52
|
+
attr_accessor :transaction_id
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
# Optional ID that is supplied by partner linking it to the partner's own Transaction ID.
|
55
|
+
attr_accessor :transaction_external_id
|
56
56
|
|
57
|
-
|
58
|
-
attr_accessor :fee_fractional
|
57
|
+
attr_accessor :transaction_state
|
59
58
|
|
60
|
-
|
61
|
-
|
59
|
+
# The exchange rate used in this payment
|
60
|
+
attr_accessor :exchange_rate
|
62
61
|
|
63
|
-
|
64
|
-
|
62
|
+
# The fee for this payment in fractional units (for example cents for USD transactions)
|
63
|
+
attr_accessor :fee_fractional
|
65
64
|
|
66
|
-
|
67
|
-
|
65
|
+
# The amount that had to be paid in for this payment to proceed
|
66
|
+
attr_accessor :input_amount
|
68
67
|
|
69
|
-
|
70
|
-
|
68
|
+
# The currency this payment was paid in
|
69
|
+
attr_accessor :input_currency
|
71
70
|
|
72
|
-
|
71
|
+
# The amount that will be paid to the recipient
|
72
|
+
attr_accessor :output_amount
|
73
73
|
|
74
|
-
|
75
|
-
|
74
|
+
# The currency the payment will be delivered in
|
75
|
+
attr_accessor :output_currency
|
76
76
|
|
77
|
-
|
78
|
-
def self.attribute_map
|
79
|
-
{
|
80
|
-
:'requested_amount' => :'requested_amount',
|
81
|
-
:'requested_currency' => :'requested_currency',
|
82
|
-
:'payout_method' => :'payout_method',
|
83
|
-
:'metadata' => :'metadata',
|
84
|
-
:'created_at' => :'created_at',
|
85
|
-
:'editable' => :'editable',
|
86
|
-
:'retriable' => :'retriable',
|
87
|
-
:'input_usd_amount' => :'input_usd_amount',
|
88
|
-
:'may_cancel' => :'may_cancel',
|
89
|
-
:'state_reason' => :'state_reason',
|
90
|
-
:'state' => :'state',
|
91
|
-
:'transaction_id' => :'transaction_id',
|
92
|
-
:'transaction_state' => :'transaction_state',
|
93
|
-
:'exchange_rate' => :'exchange_rate',
|
94
|
-
:'fee_fractional' => :'fee_fractional',
|
95
|
-
:'input_amount' => :'input_amount',
|
96
|
-
:'input_currency' => :'input_currency',
|
97
|
-
:'output_amount' => :'output_amount',
|
98
|
-
:'output_currency' => :'output_currency',
|
99
|
-
:'id' => :'id',
|
100
|
-
:'errors' => :'errors'
|
101
|
-
}
|
102
|
-
end
|
77
|
+
attr_accessor :id
|
103
78
|
|
104
|
-
|
105
|
-
|
106
|
-
{
|
107
|
-
:'requested_amount' => :'Float',
|
108
|
-
:'requested_currency' => :'String',
|
109
|
-
:'payout_method' => :'PayoutMethod',
|
110
|
-
:'metadata' => :'Object',
|
111
|
-
:'created_at' => :'DateTime',
|
112
|
-
:'editable' => :'Boolean',
|
113
|
-
:'retriable' => :'Boolean',
|
114
|
-
:'input_usd_amount' => :'Float',
|
115
|
-
:'may_cancel' => :'Boolean',
|
116
|
-
:'state_reason' => :'String',
|
117
|
-
:'state' => :'RecipientState',
|
118
|
-
:'transaction_id' => :'String',
|
119
|
-
:'transaction_state' => :'TransactionState',
|
120
|
-
:'exchange_rate' => :'Float',
|
121
|
-
:'fee_fractional' => :'Float',
|
122
|
-
:'input_amount' => :'Float',
|
123
|
-
:'input_currency' => :'String',
|
124
|
-
:'output_amount' => :'Float',
|
125
|
-
:'output_currency' => :'String',
|
126
|
-
:'id' => :'String',
|
127
|
-
:'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
|
128
|
-
}
|
129
|
-
end
|
79
|
+
# The fields that have some problems and don't pass validation
|
80
|
+
attr_accessor :errors
|
130
81
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
83
|
+
def self.attribute_map
|
84
|
+
{
|
85
|
+
:'requested_amount' => :'requested_amount',
|
86
|
+
:'requested_currency' => :'requested_currency',
|
87
|
+
:'payout_method' => :'payout_method',
|
88
|
+
:'metadata' => :'metadata',
|
89
|
+
:'created_at' => :'created_at',
|
90
|
+
:'editable' => :'editable',
|
91
|
+
:'retriable' => :'retriable',
|
92
|
+
:'input_usd_amount' => :'input_usd_amount',
|
93
|
+
:'may_cancel' => :'may_cancel',
|
94
|
+
:'state_reason' => :'state_reason',
|
95
|
+
:'state_reason_details' => :'state_reason_details',
|
96
|
+
:'state' => :'state',
|
97
|
+
:'transaction_id' => :'transaction_id',
|
98
|
+
:'transaction_external_id' => :'transaction_external_id',
|
99
|
+
:'transaction_state' => :'transaction_state',
|
100
|
+
:'exchange_rate' => :'exchange_rate',
|
101
|
+
:'fee_fractional' => :'fee_fractional',
|
102
|
+
:'input_amount' => :'input_amount',
|
103
|
+
:'input_currency' => :'input_currency',
|
104
|
+
:'output_amount' => :'output_amount',
|
105
|
+
:'output_currency' => :'output_currency',
|
106
|
+
:'id' => :'id',
|
107
|
+
:'errors' => :'errors'
|
108
|
+
}
|
109
|
+
end
|
145
110
|
|
146
|
-
|
147
|
-
|
148
|
-
|
111
|
+
# Attribute type mapping.
|
112
|
+
def self.openapi_types
|
113
|
+
{
|
114
|
+
:'requested_amount' => :'Float',
|
115
|
+
:'requested_currency' => :'String',
|
116
|
+
:'payout_method' => :'PayoutMethod',
|
117
|
+
:'metadata' => :'Object',
|
118
|
+
:'created_at' => :'DateTime',
|
119
|
+
:'editable' => :'Boolean',
|
120
|
+
:'retriable' => :'Boolean',
|
121
|
+
:'input_usd_amount' => :'Float',
|
122
|
+
:'may_cancel' => :'Boolean',
|
123
|
+
:'state_reason' => :'String',
|
124
|
+
:'state_reason_details' => :'RecipientStateReasonDetails',
|
125
|
+
:'state' => :'RecipientState',
|
126
|
+
:'transaction_id' => :'String',
|
127
|
+
:'transaction_external_id' => :'String',
|
128
|
+
:'transaction_state' => :'TransactionState',
|
129
|
+
:'exchange_rate' => :'Float',
|
130
|
+
:'fee_fractional' => :'Float',
|
131
|
+
:'input_amount' => :'Float',
|
132
|
+
:'input_currency' => :'String',
|
133
|
+
:'output_amount' => :'Float',
|
134
|
+
:'output_currency' => :'String',
|
135
|
+
:'id' => :'String',
|
136
|
+
:'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
|
137
|
+
}
|
138
|
+
end
|
149
139
|
|
150
|
-
|
151
|
-
|
152
|
-
|
140
|
+
# Initializes the object
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
def initialize(attributes = {})
|
143
|
+
if (!attributes.is_a?(Hash))
|
144
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Recipient` initialize method"
|
145
|
+
end
|
153
146
|
|
154
|
-
|
155
|
-
|
147
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
148
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
149
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
150
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Recipient`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
156
151
|
end
|
152
|
+
h[k.to_sym] = v
|
153
|
+
}
|
157
154
|
|
158
|
-
|
159
|
-
|
160
|
-
|
155
|
+
if attributes.key?(:'requested_amount')
|
156
|
+
self.requested_amount = attributes[:'requested_amount']
|
157
|
+
end
|
161
158
|
|
162
|
-
|
163
|
-
|
164
|
-
|
159
|
+
if attributes.key?(:'requested_currency')
|
160
|
+
self.requested_currency = attributes[:'requested_currency']
|
161
|
+
end
|
165
162
|
|
166
|
-
|
167
|
-
|
168
|
-
|
163
|
+
if attributes.key?(:'payout_method')
|
164
|
+
self.payout_method = attributes[:'payout_method']
|
165
|
+
end
|
169
166
|
|
170
|
-
|
171
|
-
|
172
|
-
|
167
|
+
if attributes.key?(:'metadata')
|
168
|
+
self.metadata = attributes[:'metadata']
|
169
|
+
end
|
173
170
|
|
174
|
-
|
175
|
-
|
176
|
-
|
171
|
+
if attributes.key?(:'created_at')
|
172
|
+
self.created_at = attributes[:'created_at']
|
173
|
+
end
|
177
174
|
|
178
|
-
|
179
|
-
|
180
|
-
|
175
|
+
if attributes.key?(:'editable')
|
176
|
+
self.editable = attributes[:'editable']
|
177
|
+
end
|
181
178
|
|
182
|
-
|
183
|
-
|
184
|
-
|
179
|
+
if attributes.key?(:'retriable')
|
180
|
+
self.retriable = attributes[:'retriable']
|
181
|
+
end
|
185
182
|
|
186
|
-
|
187
|
-
|
188
|
-
|
183
|
+
if attributes.key?(:'input_usd_amount')
|
184
|
+
self.input_usd_amount = attributes[:'input_usd_amount']
|
185
|
+
end
|
189
186
|
|
190
|
-
|
191
|
-
|
192
|
-
|
187
|
+
if attributes.key?(:'may_cancel')
|
188
|
+
self.may_cancel = attributes[:'may_cancel']
|
189
|
+
end
|
193
190
|
|
194
|
-
|
195
|
-
|
196
|
-
|
191
|
+
if attributes.key?(:'state_reason')
|
192
|
+
self.state_reason = attributes[:'state_reason']
|
193
|
+
end
|
197
194
|
|
198
|
-
|
199
|
-
|
200
|
-
|
195
|
+
if attributes.key?(:'state_reason_details')
|
196
|
+
self.state_reason_details = attributes[:'state_reason_details']
|
197
|
+
end
|
201
198
|
|
202
|
-
|
203
|
-
|
204
|
-
|
199
|
+
if attributes.key?(:'state')
|
200
|
+
self.state = attributes[:'state']
|
201
|
+
end
|
205
202
|
|
206
|
-
|
207
|
-
|
208
|
-
|
203
|
+
if attributes.key?(:'transaction_id')
|
204
|
+
self.transaction_id = attributes[:'transaction_id']
|
205
|
+
end
|
209
206
|
|
210
|
-
|
211
|
-
|
212
|
-
|
207
|
+
if attributes.key?(:'transaction_external_id')
|
208
|
+
self.transaction_external_id = attributes[:'transaction_external_id']
|
209
|
+
end
|
213
210
|
|
214
|
-
|
215
|
-
|
216
|
-
|
211
|
+
if attributes.key?(:'transaction_state')
|
212
|
+
self.transaction_state = attributes[:'transaction_state']
|
213
|
+
end
|
217
214
|
|
218
|
-
|
219
|
-
|
220
|
-
|
215
|
+
if attributes.key?(:'exchange_rate')
|
216
|
+
self.exchange_rate = attributes[:'exchange_rate']
|
217
|
+
end
|
221
218
|
|
222
|
-
|
223
|
-
|
224
|
-
|
219
|
+
if attributes.key?(:'fee_fractional')
|
220
|
+
self.fee_fractional = attributes[:'fee_fractional']
|
221
|
+
end
|
225
222
|
|
226
|
-
|
227
|
-
|
228
|
-
self.errors = value
|
229
|
-
end
|
230
|
-
end
|
223
|
+
if attributes.key?(:'input_amount')
|
224
|
+
self.input_amount = attributes[:'input_amount']
|
231
225
|
end
|
232
226
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
invalid_properties = Array.new
|
237
|
-
if @requested_amount.nil?
|
238
|
-
invalid_properties.push('invalid value for "requested_amount", requested_amount cannot be nil.')
|
239
|
-
end
|
227
|
+
if attributes.key?(:'input_currency')
|
228
|
+
self.input_currency = attributes[:'input_currency']
|
229
|
+
end
|
240
230
|
|
241
|
-
|
242
|
-
|
243
|
-
|
231
|
+
if attributes.key?(:'output_amount')
|
232
|
+
self.output_amount = attributes[:'output_amount']
|
233
|
+
end
|
244
234
|
|
245
|
-
|
246
|
-
|
247
|
-
|
235
|
+
if attributes.key?(:'output_currency')
|
236
|
+
self.output_currency = attributes[:'output_currency']
|
237
|
+
end
|
248
238
|
|
249
|
-
|
239
|
+
if attributes.key?(:'id')
|
240
|
+
self.id = attributes[:'id']
|
250
241
|
end
|
251
242
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
return false if @requested_currency.nil?
|
257
|
-
return false if @payout_method.nil?
|
258
|
-
true
|
243
|
+
if attributes.key?(:'errors')
|
244
|
+
if (value = attributes[:'errors']).is_a?(Hash)
|
245
|
+
self.errors = value
|
246
|
+
end
|
259
247
|
end
|
248
|
+
end
|
260
249
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
requested_currency == o.requested_currency &&
|
268
|
-
payout_method == o.payout_method &&
|
269
|
-
metadata == o.metadata &&
|
270
|
-
created_at == o.created_at &&
|
271
|
-
editable == o.editable &&
|
272
|
-
retriable == o.retriable &&
|
273
|
-
input_usd_amount == o.input_usd_amount &&
|
274
|
-
may_cancel == o.may_cancel &&
|
275
|
-
state_reason == o.state_reason &&
|
276
|
-
state == o.state &&
|
277
|
-
transaction_id == o.transaction_id &&
|
278
|
-
transaction_state == o.transaction_state &&
|
279
|
-
exchange_rate == o.exchange_rate &&
|
280
|
-
fee_fractional == o.fee_fractional &&
|
281
|
-
input_amount == o.input_amount &&
|
282
|
-
input_currency == o.input_currency &&
|
283
|
-
output_amount == o.output_amount &&
|
284
|
-
output_currency == o.output_currency &&
|
285
|
-
id == o.id &&
|
286
|
-
errors == o.errors
|
250
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
251
|
+
# @return Array for valid properties with the reasons
|
252
|
+
def list_invalid_properties
|
253
|
+
invalid_properties = Array.new
|
254
|
+
if @requested_amount.nil?
|
255
|
+
invalid_properties.push('invalid value for "requested_amount", requested_amount cannot be nil.')
|
287
256
|
end
|
288
257
|
|
289
|
-
|
290
|
-
|
291
|
-
def eql?(o)
|
292
|
-
self == o
|
258
|
+
if @requested_currency.nil?
|
259
|
+
invalid_properties.push('invalid value for "requested_currency", requested_currency cannot be nil.')
|
293
260
|
end
|
294
261
|
|
295
|
-
|
296
|
-
|
297
|
-
def hash
|
298
|
-
[requested_amount, requested_currency, payout_method, metadata, created_at, editable, retriable, input_usd_amount, may_cancel, state_reason, state, transaction_id, transaction_state, exchange_rate, fee_fractional, input_amount, input_currency, output_amount, output_currency, id, errors].hash
|
262
|
+
if @payout_method.nil?
|
263
|
+
invalid_properties.push('invalid value for "payout_method", payout_method cannot be nil.')
|
299
264
|
end
|
300
265
|
|
266
|
+
invalid_properties
|
267
|
+
end
|
268
|
+
|
269
|
+
# Check to see if the all the properties in the model are valid
|
270
|
+
# @return true if the model is valid
|
271
|
+
def valid?
|
272
|
+
return false if @requested_amount.nil?
|
273
|
+
return false if @requested_currency.nil?
|
274
|
+
return false if @payout_method.nil?
|
275
|
+
true
|
276
|
+
end
|
277
|
+
|
278
|
+
# Checks equality by comparing each attribute.
|
279
|
+
# @param [Object] Object to be compared
|
280
|
+
def ==(o)
|
281
|
+
return true if self.equal?(o)
|
282
|
+
self.class == o.class &&
|
283
|
+
requested_amount == o.requested_amount &&
|
284
|
+
requested_currency == o.requested_currency &&
|
285
|
+
payout_method == o.payout_method &&
|
286
|
+
metadata == o.metadata &&
|
287
|
+
created_at == o.created_at &&
|
288
|
+
editable == o.editable &&
|
289
|
+
retriable == o.retriable &&
|
290
|
+
input_usd_amount == o.input_usd_amount &&
|
291
|
+
may_cancel == o.may_cancel &&
|
292
|
+
state_reason == o.state_reason &&
|
293
|
+
state_reason_details == o.state_reason_details &&
|
294
|
+
state == o.state &&
|
295
|
+
transaction_id == o.transaction_id &&
|
296
|
+
transaction_external_id == o.transaction_external_id &&
|
297
|
+
transaction_state == o.transaction_state &&
|
298
|
+
exchange_rate == o.exchange_rate &&
|
299
|
+
fee_fractional == o.fee_fractional &&
|
300
|
+
input_amount == o.input_amount &&
|
301
|
+
input_currency == o.input_currency &&
|
302
|
+
output_amount == o.output_amount &&
|
303
|
+
output_currency == o.output_currency &&
|
304
|
+
id == o.id &&
|
305
|
+
errors == o.errors
|
306
|
+
end
|
307
|
+
|
308
|
+
# @see the `==` method
|
309
|
+
# @param [Object] Object to be compared
|
310
|
+
def eql?(o)
|
311
|
+
self == o
|
312
|
+
end
|
313
|
+
|
314
|
+
# Calculates hash code according to all attributes.
|
315
|
+
# @return [Integer] Hash code
|
316
|
+
def hash
|
317
|
+
[requested_amount, requested_currency, payout_method, metadata, created_at, editable, retriable, input_usd_amount, may_cancel, state_reason, state_reason_details, state, transaction_id, transaction_external_id, transaction_state, exchange_rate, fee_fractional, input_amount, input_currency, output_amount, output_currency, id, errors].hash
|
318
|
+
end
|
319
|
+
|
301
320
|
require 'active_support/core_ext/hash'
|
302
321
|
require 'active_support/hash_with_indifferent_access.rb'
|
303
322
|
# Builds the object from hash
|
@@ -412,5 +431,6 @@ def _to_hash(value)
|
|
412
431
|
end
|
413
432
|
end
|
414
433
|
|
415
|
-
|
434
|
+
end
|
435
|
+
|
416
436
|
end
|