transferzero-sdk 1.0.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -11
- data/docs/AccountMeta.md +1 -1
- data/docs/AccountValidationApi.md +4 -4
- data/docs/AccountValidationRequest.md +6 -4
- data/docs/Currency.md +1 -1
- data/docs/CurrencyExchange.md +1 -1
- data/docs/CurrencyInfoApi.md +20 -6
- data/docs/CurrencyOpposite.md +4 -2
- data/docs/Debit.md +2 -2
- data/docs/Document.md +4 -0
- data/docs/FieldSelectValidation.md +1 -1
- data/docs/FieldValidation.md +1 -1
- data/docs/PayinMethod.md +4 -4
- data/docs/PayinMethodDetails.md +7 -3
- data/docs/PayinMethodDetailsBTC.md +17 -0
- data/docs/PayinMethodDetailsMobile.md +1 -1
- data/docs/PayinMethodDetailsNGNBank.md +4 -2
- data/docs/PaymentMethod.md +2 -2
- data/docs/PaymentMethodOpposite.md +2 -2
- data/docs/PayoutMethod.md +1 -1
- data/docs/PayoutMethodDetails.md +12 -4
- data/docs/PayoutMethodDetailsBTC.md +23 -0
- data/docs/PayoutMethodDetailsGBPBank.md +29 -0
- data/docs/PayoutMethodDetailsIBAN.md +1 -1
- data/docs/PayoutMethodDetailsNGNBank.md +1 -1
- data/docs/PayoutMethodDetailsXOFBank.md +25 -0
- data/docs/PoliticallyExposedPerson.md +31 -0
- data/docs/Recipient.md +5 -3
- data/docs/RecipientsApi.md +3 -3
- data/docs/Sender.md +63 -27
- data/docs/Transaction.md +5 -5
- data/docs/TransactionTraits.md +2 -2
- data/docs/TransactionsApi.md +64 -0
- data/example/client.rb +14 -14
- data/git_push.sh +1 -1
- data/lib/transferzero-sdk.rb +5 -0
- data/lib/transferzero-sdk/api/account_validation_api.rb +4 -4
- data/lib/transferzero-sdk/api/currency_info_api.rb +6 -0
- data/lib/transferzero-sdk/api/recipients_api.rb +4 -4
- data/lib/transferzero-sdk/api/transactions_api.rb +59 -0
- data/lib/transferzero-sdk/api_client.rb +5 -5
- 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 +164 -163
- 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 +142 -141
- data/lib/transferzero-sdk/models/currency_exchange.rb +158 -157
- 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 -155
- data/lib/transferzero-sdk/models/debit.rb +151 -155
- 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 +181 -160
- 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 -105
- 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 -65
- 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_details.rb +338 -288
- 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 +86 -85
- data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -108
- data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +264 -0
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
- 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 +14 -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 +272 -0
- data/lib/transferzero-sdk/models/recipient.rb +230 -219
- 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_webhook.rb +96 -95
- data/lib/transferzero-sdk/models/sender.rb +529 -322
- 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 -23
- 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 -27
- 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/api/account_validation_api_spec.rb +2 -2
- data/spec/api/currency_info_api_spec.rb +2 -0
- data/spec/api/documents_api_spec.rb +15 -0
- data/spec/api/recipients_api_spec.rb +1 -1
- data/spec/api/transactions_api_spec.rb +13 -0
- data/spec/models/account_validation_request_spec.rb +7 -1
- data/spec/models/currency_opposite_spec.rb +6 -0
- data/spec/models/document_spec.rb +12 -0
- data/spec/models/payin_method_details_btc_spec.rb +41 -0
- data/spec/models/payin_method_details_ngn_bank_spec.rb +6 -0
- data/spec/models/payin_method_details_spec.rb +6 -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_spec.rb +7 -1
- data/spec/models/payout_method_details_xof_bank_spec.rb +65 -0
- data/spec/models/politically_exposed_person_spec.rb +83 -0
- data/spec/models/recipient_spec.rb +6 -0
- data/spec/models/sender_spec.rb +16 -0
- data/transferzero-sdk.gemspec +2 -2
- metadata +35 -24
- data/spec/api_client_spec.rb +0 -189
|
@@ -0,0 +1,272 @@
|
|
|
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 PoliticallyExposedPerson
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
# Full name of the politically exposed person
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# The office held by the politically exposed person
|
|
23
|
+
attr_accessor :position
|
|
24
|
+
|
|
25
|
+
# The date on which the person started holding the office
|
|
26
|
+
attr_accessor :started_date
|
|
27
|
+
|
|
28
|
+
# The date on which the person ended holding the office
|
|
29
|
+
attr_accessor :ended_date
|
|
30
|
+
|
|
31
|
+
# The ID of the Sender to whom the person is attached to
|
|
32
|
+
attr_accessor :sender_id
|
|
33
|
+
|
|
34
|
+
# Date and time the person was created
|
|
35
|
+
attr_accessor :created_at
|
|
36
|
+
|
|
37
|
+
# Date and time the person was updated
|
|
38
|
+
attr_accessor :updated_at
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'id' => :'id',
|
|
44
|
+
:'name' => :'name',
|
|
45
|
+
:'position' => :'position',
|
|
46
|
+
:'started_date' => :'started_date',
|
|
47
|
+
:'ended_date' => :'ended_date',
|
|
48
|
+
:'sender_id' => :'sender_id',
|
|
49
|
+
:'created_at' => :'created_at',
|
|
50
|
+
:'updated_at' => :'updated_at'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute type mapping.
|
|
55
|
+
def self.openapi_types
|
|
56
|
+
{
|
|
57
|
+
:'id' => :'Integer',
|
|
58
|
+
:'name' => :'String',
|
|
59
|
+
:'position' => :'String',
|
|
60
|
+
:'started_date' => :'DateTime',
|
|
61
|
+
:'ended_date' => :'DateTime',
|
|
62
|
+
:'sender_id' => :'String',
|
|
63
|
+
:'created_at' => :'DateTime',
|
|
64
|
+
:'updated_at' => :'DateTime'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Initializes the object
|
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
70
|
+
def initialize(attributes = {})
|
|
71
|
+
if (!attributes.is_a?(Hash))
|
|
72
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PoliticallyExposedPerson` initialize method"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PoliticallyExposedPerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'id')
|
|
84
|
+
self.id = attributes[:'id']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'name')
|
|
88
|
+
self.name = attributes[:'name']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'position')
|
|
92
|
+
self.position = attributes[:'position']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'started_date')
|
|
96
|
+
self.started_date = attributes[:'started_date']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'ended_date')
|
|
100
|
+
self.ended_date = attributes[:'ended_date']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'sender_id')
|
|
104
|
+
self.sender_id = attributes[:'sender_id']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'created_at')
|
|
108
|
+
self.created_at = attributes[:'created_at']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'updated_at')
|
|
112
|
+
self.updated_at = attributes[:'updated_at']
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
117
|
+
# @return Array for valid properties with the reasons
|
|
118
|
+
def list_invalid_properties
|
|
119
|
+
invalid_properties = Array.new
|
|
120
|
+
invalid_properties
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Check to see if the all the properties in the model are valid
|
|
124
|
+
# @return true if the model is valid
|
|
125
|
+
def valid?
|
|
126
|
+
true
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Checks equality by comparing each attribute.
|
|
130
|
+
# @param [Object] Object to be compared
|
|
131
|
+
def ==(o)
|
|
132
|
+
return true if self.equal?(o)
|
|
133
|
+
self.class == o.class &&
|
|
134
|
+
id == o.id &&
|
|
135
|
+
name == o.name &&
|
|
136
|
+
position == o.position &&
|
|
137
|
+
started_date == o.started_date &&
|
|
138
|
+
ended_date == o.ended_date &&
|
|
139
|
+
sender_id == o.sender_id &&
|
|
140
|
+
created_at == o.created_at &&
|
|
141
|
+
updated_at == o.updated_at
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# @see the `==` method
|
|
145
|
+
# @param [Object] Object to be compared
|
|
146
|
+
def eql?(o)
|
|
147
|
+
self == o
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Calculates hash code according to all attributes.
|
|
151
|
+
# @return [Integer] Hash code
|
|
152
|
+
def hash
|
|
153
|
+
[id, name, position, started_date, ended_date, sender_id, created_at, updated_at].hash
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
require 'active_support/core_ext/hash'
|
|
157
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
164
|
+
if type =~ /\AArray<(.*)>/i
|
|
165
|
+
# check to ensure the input is an array given that the the attribute
|
|
166
|
+
# is documented as an array but the input is not
|
|
167
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
168
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
169
|
+
end
|
|
170
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
171
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
172
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
self
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Deserializes the data based on type
|
|
179
|
+
# @param string type Data type
|
|
180
|
+
# @param string value Value to be deserialized
|
|
181
|
+
# @return [Object] Deserialized data
|
|
182
|
+
def _deserialize(type, value)
|
|
183
|
+
case type.to_sym
|
|
184
|
+
when :DateTime
|
|
185
|
+
DateTime.parse(value)
|
|
186
|
+
when :Date
|
|
187
|
+
Date.parse(value)
|
|
188
|
+
when :String
|
|
189
|
+
value.to_s
|
|
190
|
+
when :Integer
|
|
191
|
+
value.to_i
|
|
192
|
+
when :Float
|
|
193
|
+
value.to_f
|
|
194
|
+
when :Boolean
|
|
195
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
196
|
+
true
|
|
197
|
+
else
|
|
198
|
+
false
|
|
199
|
+
end
|
|
200
|
+
when :Object
|
|
201
|
+
# generic object (usually a Hash), return directly
|
|
202
|
+
value
|
|
203
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
204
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
205
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
206
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
207
|
+
k_type = Regexp.last_match[:k_type]
|
|
208
|
+
v_type = Regexp.last_match[:v_type]
|
|
209
|
+
{}.tap do |hash|
|
|
210
|
+
value.each do |k, v|
|
|
211
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
else # model
|
|
215
|
+
temp_model = TransferZero.const_get(type).new
|
|
216
|
+
temp_model.build_from_hash(value)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Returns the string representation of the object
|
|
221
|
+
# @return [String] String presentation of the object
|
|
222
|
+
def to_s
|
|
223
|
+
to_hash.to_s
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
|
228
|
+
def to_body
|
|
229
|
+
to_hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Returns the object in the form of hash
|
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
|
234
|
+
def to_hash
|
|
235
|
+
hash = {}
|
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
237
|
+
value = self.send(attr)
|
|
238
|
+
next if value.nil?
|
|
239
|
+
hash[param] = _to_hash(value)
|
|
240
|
+
end
|
|
241
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def [](key)
|
|
245
|
+
to_hash[key]
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def dig(*args)
|
|
249
|
+
to_hash.dig(*args)
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Outputs non-array value in the form of hash
|
|
253
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
254
|
+
# @param [Object] value Any valid value
|
|
255
|
+
# @return [Hash] Returns the value in the form of hash
|
|
256
|
+
def _to_hash(value)
|
|
257
|
+
if value.is_a?(Array)
|
|
258
|
+
value.compact.map { |v| _to_hash(v) }
|
|
259
|
+
elsif value.is_a?(Hash)
|
|
260
|
+
{}.tap do |hash|
|
|
261
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
262
|
+
end
|
|
263
|
+
elsif value.respond_to? :to_hash
|
|
264
|
+
value.to_hash
|
|
265
|
+
else
|
|
266
|
+
value
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
end
|
|
@@ -13,280 +13,290 @@ 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
|
-
|
|
44
|
+
# In case the payment is unsuccessful it holds the error message associated with the last unsuccessful payout.
|
|
45
|
+
attr_accessor :state_reason
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
attr_accessor :transaction_id
|
|
47
|
+
attr_accessor :state
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
# The ID of the transaction that is related to this recipient
|
|
50
|
+
attr_accessor :transaction_id
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
attr_accessor :exchange_rate
|
|
52
|
+
attr_accessor :transaction_state
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
# The exchange rate used in this payment
|
|
55
|
+
attr_accessor :exchange_rate
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
# The fee for this payment in fractional units (for example cents for USD transactions)
|
|
58
|
+
attr_accessor :fee_fractional
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
# The amount that had to be paid in for this payment to proceed
|
|
61
|
+
attr_accessor :input_amount
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
# The currency this payment was paid in
|
|
64
|
+
attr_accessor :input_currency
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
# The amount that will be paid to the recipient
|
|
67
|
+
attr_accessor :output_amount
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
# The currency the payment will be delivered in
|
|
70
|
+
attr_accessor :output_currency
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
attr_accessor :errors
|
|
72
|
+
attr_accessor :id
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
:'requested_amount' => :'requested_amount',
|
|
78
|
-
:'requested_currency' => :'requested_currency',
|
|
79
|
-
:'payout_method' => :'payout_method',
|
|
80
|
-
:'metadata' => :'metadata',
|
|
81
|
-
:'created_at' => :'created_at',
|
|
82
|
-
:'editable' => :'editable',
|
|
83
|
-
:'input_usd_amount' => :'input_usd_amount',
|
|
84
|
-
:'may_cancel' => :'may_cancel',
|
|
85
|
-
:'state_reason' => :'state_reason',
|
|
86
|
-
:'state' => :'state',
|
|
87
|
-
:'transaction_id' => :'transaction_id',
|
|
88
|
-
:'transaction_state' => :'transaction_state',
|
|
89
|
-
:'exchange_rate' => :'exchange_rate',
|
|
90
|
-
:'fee_fractional' => :'fee_fractional',
|
|
91
|
-
:'input_amount' => :'input_amount',
|
|
92
|
-
:'input_currency' => :'input_currency',
|
|
93
|
-
:'output_amount' => :'output_amount',
|
|
94
|
-
:'output_currency' => :'output_currency',
|
|
95
|
-
:'id' => :'id',
|
|
96
|
-
:'errors' => :'errors'
|
|
97
|
-
}
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# Attribute type mapping.
|
|
101
|
-
def self.openapi_types
|
|
102
|
-
{
|
|
103
|
-
:'requested_amount' => :'Float',
|
|
104
|
-
:'requested_currency' => :'String',
|
|
105
|
-
:'payout_method' => :'PayoutMethod',
|
|
106
|
-
:'metadata' => :'Object',
|
|
107
|
-
:'created_at' => :'DateTime',
|
|
108
|
-
:'editable' => :'Boolean',
|
|
109
|
-
:'input_usd_amount' => :'Float',
|
|
110
|
-
:'may_cancel' => :'Boolean',
|
|
111
|
-
:'state_reason' => :'String',
|
|
112
|
-
:'state' => :'RecipientState',
|
|
113
|
-
:'transaction_id' => :'String',
|
|
114
|
-
:'transaction_state' => :'TransactionState',
|
|
115
|
-
:'exchange_rate' => :'Float',
|
|
116
|
-
:'fee_fractional' => :'Float',
|
|
117
|
-
:'input_amount' => :'Float',
|
|
118
|
-
:'input_currency' => :'String',
|
|
119
|
-
:'output_amount' => :'Float',
|
|
120
|
-
:'output_currency' => :'String',
|
|
121
|
-
:'id' => :'String',
|
|
122
|
-
:'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
|
|
123
|
-
}
|
|
124
|
-
end
|
|
74
|
+
# The fields that have some problems and don't pass validation
|
|
75
|
+
attr_accessor :errors
|
|
125
76
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
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
|
|
132
103
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
104
|
+
# Attribute type mapping.
|
|
105
|
+
def self.openapi_types
|
|
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
|
|
140
130
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
# Initializes the object
|
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
133
|
+
def initialize(attributes = {})
|
|
134
|
+
if (!attributes.is_a?(Hash))
|
|
135
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Recipient` initialize method"
|
|
136
|
+
end
|
|
144
137
|
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
139
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
140
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
141
|
+
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
|
|
147
142
|
end
|
|
143
|
+
h[k.to_sym] = v
|
|
144
|
+
}
|
|
148
145
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
if attributes.key?(:'requested_amount')
|
|
147
|
+
self.requested_amount = attributes[:'requested_amount']
|
|
148
|
+
end
|
|
152
149
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
if attributes.key?(:'requested_currency')
|
|
151
|
+
self.requested_currency = attributes[:'requested_currency']
|
|
152
|
+
end
|
|
156
153
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
if attributes.key?(:'payout_method')
|
|
155
|
+
self.payout_method = attributes[:'payout_method']
|
|
156
|
+
end
|
|
160
157
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
if attributes.key?(:'metadata')
|
|
159
|
+
self.metadata = attributes[:'metadata']
|
|
160
|
+
end
|
|
164
161
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
if attributes.key?(:'created_at')
|
|
163
|
+
self.created_at = attributes[:'created_at']
|
|
164
|
+
end
|
|
168
165
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
if attributes.key?(:'editable')
|
|
167
|
+
self.editable = attributes[:'editable']
|
|
168
|
+
end
|
|
172
169
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
if attributes.key?(:'retriable')
|
|
171
|
+
self.retriable = attributes[:'retriable']
|
|
172
|
+
end
|
|
176
173
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
if attributes.key?(:'input_usd_amount')
|
|
175
|
+
self.input_usd_amount = attributes[:'input_usd_amount']
|
|
176
|
+
end
|
|
180
177
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
if attributes.key?(:'may_cancel')
|
|
179
|
+
self.may_cancel = attributes[:'may_cancel']
|
|
180
|
+
end
|
|
184
181
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
if attributes.key?(:'state_reason')
|
|
183
|
+
self.state_reason = attributes[:'state_reason']
|
|
184
|
+
end
|
|
188
185
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
if attributes.key?(:'state')
|
|
187
|
+
self.state = attributes[:'state']
|
|
188
|
+
end
|
|
192
189
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
if attributes.key?(:'transaction_id')
|
|
191
|
+
self.transaction_id = attributes[:'transaction_id']
|
|
192
|
+
end
|
|
196
193
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
if attributes.key?(:'transaction_state')
|
|
195
|
+
self.transaction_state = attributes[:'transaction_state']
|
|
196
|
+
end
|
|
200
197
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
if attributes.key?(:'exchange_rate')
|
|
199
|
+
self.exchange_rate = attributes[:'exchange_rate']
|
|
200
|
+
end
|
|
204
201
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
202
|
+
if attributes.key?(:'fee_fractional')
|
|
203
|
+
self.fee_fractional = attributes[:'fee_fractional']
|
|
204
|
+
end
|
|
208
205
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
206
|
+
if attributes.key?(:'input_amount')
|
|
207
|
+
self.input_amount = attributes[:'input_amount']
|
|
208
|
+
end
|
|
212
209
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
if attributes.key?(:'input_currency')
|
|
211
|
+
self.input_currency = attributes[:'input_currency']
|
|
212
|
+
end
|
|
216
213
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
self.errors = value
|
|
220
|
-
end
|
|
221
|
-
end
|
|
214
|
+
if attributes.key?(:'output_amount')
|
|
215
|
+
self.output_amount = attributes[:'output_amount']
|
|
222
216
|
end
|
|
223
217
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
invalid_properties = Array.new
|
|
228
|
-
if @requested_amount.nil?
|
|
229
|
-
invalid_properties.push('invalid value for "requested_amount", requested_amount cannot be nil.')
|
|
230
|
-
end
|
|
218
|
+
if attributes.key?(:'output_currency')
|
|
219
|
+
self.output_currency = attributes[:'output_currency']
|
|
220
|
+
end
|
|
231
221
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
222
|
+
if attributes.key?(:'id')
|
|
223
|
+
self.id = attributes[:'id']
|
|
224
|
+
end
|
|
235
225
|
|
|
236
|
-
|
|
237
|
-
|
|
226
|
+
if attributes.key?(:'errors')
|
|
227
|
+
if (value = attributes[:'errors']).is_a?(Hash)
|
|
228
|
+
self.errors = value
|
|
238
229
|
end
|
|
239
|
-
|
|
240
|
-
invalid_properties
|
|
241
230
|
end
|
|
231
|
+
end
|
|
242
232
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
true
|
|
233
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
234
|
+
# @return Array for valid properties with the reasons
|
|
235
|
+
def list_invalid_properties
|
|
236
|
+
invalid_properties = Array.new
|
|
237
|
+
if @requested_amount.nil?
|
|
238
|
+
invalid_properties.push('invalid value for "requested_amount", requested_amount cannot be nil.')
|
|
250
239
|
end
|
|
251
240
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
def ==(o)
|
|
255
|
-
return true if self.equal?(o)
|
|
256
|
-
self.class == o.class &&
|
|
257
|
-
requested_amount == o.requested_amount &&
|
|
258
|
-
requested_currency == o.requested_currency &&
|
|
259
|
-
payout_method == o.payout_method &&
|
|
260
|
-
metadata == o.metadata &&
|
|
261
|
-
created_at == o.created_at &&
|
|
262
|
-
editable == o.editable &&
|
|
263
|
-
input_usd_amount == o.input_usd_amount &&
|
|
264
|
-
may_cancel == o.may_cancel &&
|
|
265
|
-
state_reason == o.state_reason &&
|
|
266
|
-
state == o.state &&
|
|
267
|
-
transaction_id == o.transaction_id &&
|
|
268
|
-
transaction_state == o.transaction_state &&
|
|
269
|
-
exchange_rate == o.exchange_rate &&
|
|
270
|
-
fee_fractional == o.fee_fractional &&
|
|
271
|
-
input_amount == o.input_amount &&
|
|
272
|
-
input_currency == o.input_currency &&
|
|
273
|
-
output_amount == o.output_amount &&
|
|
274
|
-
output_currency == o.output_currency &&
|
|
275
|
-
id == o.id &&
|
|
276
|
-
errors == o.errors
|
|
241
|
+
if @requested_currency.nil?
|
|
242
|
+
invalid_properties.push('invalid value for "requested_currency", requested_currency cannot be nil.')
|
|
277
243
|
end
|
|
278
244
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
def eql?(o)
|
|
282
|
-
self == o
|
|
245
|
+
if @payout_method.nil?
|
|
246
|
+
invalid_properties.push('invalid value for "payout_method", payout_method cannot be nil.')
|
|
283
247
|
end
|
|
284
248
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
249
|
+
invalid_properties
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Check to see if the all the properties in the model are valid
|
|
253
|
+
# @return true if the model is valid
|
|
254
|
+
def valid?
|
|
255
|
+
return false if @requested_amount.nil?
|
|
256
|
+
return false if @requested_currency.nil?
|
|
257
|
+
return false if @payout_method.nil?
|
|
258
|
+
true
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Checks equality by comparing each attribute.
|
|
262
|
+
# @param [Object] Object to be compared
|
|
263
|
+
def ==(o)
|
|
264
|
+
return true if self.equal?(o)
|
|
265
|
+
self.class == o.class &&
|
|
266
|
+
requested_amount == o.requested_amount &&
|
|
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
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# @see the `==` method
|
|
290
|
+
# @param [Object] Object to be compared
|
|
291
|
+
def eql?(o)
|
|
292
|
+
self == o
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Calculates hash code according to all attributes.
|
|
296
|
+
# @return [Integer] Hash code
|
|
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
|
|
299
|
+
end
|
|
290
300
|
|
|
291
301
|
require 'active_support/core_ext/hash'
|
|
292
302
|
require 'active_support/hash_with_indifferent_access.rb'
|
|
@@ -402,5 +412,6 @@ def _to_hash(value)
|
|
|
402
412
|
end
|
|
403
413
|
end
|
|
404
414
|
|
|
405
|
-
|
|
415
|
+
end
|
|
416
|
+
|
|
406
417
|
end
|