transferzero-sdk 1.19.3 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -11
- data/docs/Document.md +1 -1
- data/docs/Sender.md +2 -2
- data/lib/transferzero-sdk/api/account_debits_api.rb +2 -2
- data/lib/transferzero-sdk/api/account_validation_api.rb +2 -2
- data/lib/transferzero-sdk/api/accounts_api.rb +2 -2
- data/lib/transferzero-sdk/api/api_logs_api.rb +2 -2
- data/lib/transferzero-sdk/api/currency_info_api.rb +2 -2
- data/lib/transferzero-sdk/api/documents_api.rb +2 -2
- data/lib/transferzero-sdk/api/logs_api.rb +2 -2
- data/lib/transferzero-sdk/api/payin_methods_api.rb +2 -2
- data/lib/transferzero-sdk/api/payment_methods_api.rb +2 -2
- data/lib/transferzero-sdk/api/payout_methods_api.rb +2 -2
- data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
- data/lib/transferzero-sdk/api/senders_api.rb +2 -2
- data/lib/transferzero-sdk/api/transactions_api.rb +2 -2
- data/lib/transferzero-sdk/api/webhooks_api.rb +2 -2
- data/lib/transferzero-sdk/api_client.rb +126 -91
- data/lib/transferzero-sdk/api_error.rb +2 -2
- data/lib/transferzero-sdk/configuration.rb +97 -21
- data/lib/transferzero-sdk/models/account.rb +2 -2
- data/lib/transferzero-sdk/models/account_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/account_meta.rb +2 -2
- data/lib/transferzero-sdk/models/account_response.rb +2 -2
- data/lib/transferzero-sdk/models/account_validation_error.rb +2 -2
- data/lib/transferzero-sdk/models/account_validation_request.rb +2 -2
- data/lib/transferzero-sdk/models/account_validation_response.rb +2 -2
- data/lib/transferzero-sdk/models/account_validation_result.rb +2 -2
- data/lib/transferzero-sdk/models/api_log.rb +2 -2
- data/lib/transferzero-sdk/models/api_log_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/api_log_response.rb +2 -2
- data/lib/transferzero-sdk/models/currency.rb +2 -2
- data/lib/transferzero-sdk/models/currency_exchange.rb +3 -4
- data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/currency_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/currency_opposite.rb +3 -4
- data/lib/transferzero-sdk/models/debit.rb +2 -2
- data/lib/transferzero-sdk/models/debit_list_request.rb +2 -2
- data/lib/transferzero-sdk/models/debit_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/debit_request.rb +2 -2
- data/lib/transferzero-sdk/models/debit_request_wrapper.rb +2 -2
- data/lib/transferzero-sdk/models/debit_response.rb +2 -2
- data/lib/transferzero-sdk/models/document.rb +2 -2
- data/lib/transferzero-sdk/models/document_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/document_request.rb +2 -2
- data/lib/transferzero-sdk/models/document_response.rb +2 -2
- data/lib/transferzero-sdk/models/document_webhook.rb +2 -3
- data/lib/transferzero-sdk/models/error_status.rb +2 -2
- data/lib/transferzero-sdk/models/field_description.rb +2 -2
- data/lib/transferzero-sdk/models/field_select_validation.rb +2 -2
- data/lib/transferzero-sdk/models/field_validation.rb +2 -2
- data/lib/transferzero-sdk/models/pagination.rb +2 -2
- data/lib/transferzero-sdk/models/pagination_meta.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_details.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_details_btc.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_request.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_response.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_state.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +2 -2
- data/lib/transferzero-sdk/models/payment_method.rb +2 -2
- data/lib/transferzero-sdk/models/payment_method_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/payment_method_opposite.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_country_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_balance.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_btc.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_ghs_cash.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_iban.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +3 -3
- data/lib/transferzero-sdk/models/payout_method_details_usd_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_usd_cash.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +3 -3
- data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_legal_entity_type_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +5 -2
- data/lib/transferzero-sdk/models/payout_method_nature_of_business_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_request.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_response.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_webhook.rb +2 -3
- data/lib/transferzero-sdk/models/politically_exposed_person.rb +2 -2
- data/lib/transferzero-sdk/models/proof_of_payment.rb +2 -2
- data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/recipient.rb +2 -2
- data/lib/transferzero-sdk/models/recipient_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/recipient_request.rb +2 -2
- data/lib/transferzero-sdk/models/recipient_response.rb +2 -2
- data/lib/transferzero-sdk/models/recipient_state.rb +2 -2
- data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +2 -2
- data/lib/transferzero-sdk/models/recipient_webhook.rb +2 -3
- data/lib/transferzero-sdk/models/sender.rb +2 -2
- data/lib/transferzero-sdk/models/sender_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/sender_request.rb +2 -2
- data/lib/transferzero-sdk/models/sender_response.rb +2 -2
- data/lib/transferzero-sdk/models/sender_response_existing.rb +2 -2
- data/lib/transferzero-sdk/models/sender_response_meta.rb +2 -2
- data/lib/transferzero-sdk/models/sender_state.rb +2 -2
- data/lib/transferzero-sdk/models/sender_webhook.rb +2 -3
- data/lib/transferzero-sdk/models/state_reason_details.rb +2 -2
- data/lib/transferzero-sdk/models/transaction.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_request.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_response.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_response_existing.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_response_meta.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_state.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_traits.rb +2 -2
- data/lib/transferzero-sdk/models/transaction_webhook.rb +2 -3
- data/lib/transferzero-sdk/models/validation_error_description.rb +2 -2
- data/lib/transferzero-sdk/models/webhook.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_definition.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_definition_request.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_definition_response.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_log.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_log_list_response.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_log_metadata.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +2 -2
- data/lib/transferzero-sdk/models/webhook_log_response.rb +2 -2
- data/lib/transferzero-sdk/version.rb +3 -3
- data/lib/transferzero-sdk.rb +2 -9
- data/spec/api/documents_api_spec.rb +0 -15
- data/spec/api/payin_methods_api_spec.rb +2 -2
- data/spec/api/payout_methods_api_spec.rb +1 -1
- data/spec/api/recipients_api_spec.rb +13 -1
- data/spec/api/senders_api_spec.rb +1 -1
- data/spec/api/transactions_api_spec.rb +1 -0
- data/spec/models/account_validation_request_spec.rb +14 -2
- data/spec/models/currency_exchange_spec.rb +0 -6
- data/spec/models/currency_opposite_spec.rb +4 -4
- data/spec/models/currency_spec.rb +0 -6
- data/spec/models/document_spec.rb +20 -2
- data/spec/models/payin_method_details_mobile_spec.rb +7 -1
- data/spec/models/payin_method_details_spec.rb +13 -1
- data/spec/models/payin_method_spec.rb +25 -1
- data/spec/models/payout_method_details_kes_bank_spec.rb +6 -0
- data/spec/models/payout_method_details_kes_mobile_spec.rb +6 -0
- data/spec/models/payout_method_details_mobile_spec.rb +6 -0
- data/spec/models/payout_method_details_spec.rb +108 -0
- data/spec/models/payout_method_details_xof_bank_spec.rb +12 -0
- data/spec/models/payout_method_details_xof_cash_spec.rb +3 -9
- data/spec/models/payout_method_details_xof_mobile_spec.rb +12 -0
- data/spec/models/payout_method_details_zar_bank_spec.rb +48 -0
- data/spec/models/recipient_spec.rb +22 -0
- data/spec/models/sender_spec.rb +169 -19
- data/transferzero-sdk.gemspec +3 -9
- metadata +6 -157
- data/Gemfile.lock +0 -92
- data/docs/CurrencyExchangeAllOf.md +0 -17
- data/docs/CurrencyOppositeAllOf.md +0 -21
- data/docs/DocumentWebhookAllOf.md +0 -17
- data/docs/PayoutMethodWebhookAllOf.md +0 -17
- data/docs/RecipientWebhookAllOf.md +0 -17
- data/docs/SenderWebhookAllOf.md +0 -17
- data/docs/TransactionWebhookAllOf.md +0 -17
- data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +0 -205
- data/lib/transferzero-sdk/models/currency_opposite_all_of.rb +0 -223
- data/lib/transferzero-sdk/models/document_webhook_all_of.rb +0 -202
- data/lib/transferzero-sdk/models/payout_method_webhook_all_of.rb +0 -202
- data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +0 -202
- data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +0 -202
- data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +0 -202
- data/spec/models/currency_exchange_all_of_spec.rb +0 -41
- data/spec/models/currency_opposite_all_of_spec.rb +0 -53
- data/spec/models/document_webhook_all_of_spec.rb +0 -41
- data/spec/models/payout_method_webhook_all_of_spec.rb +0 -41
- data/spec/models/recipient_webhook_all_of_spec.rb +0 -41
- data/spec/models/sender_webhook_all_of_spec.rb +0 -41
- data/spec/models/transaction_webhook_all_of_spec.rb +0 -41
- data/transferzero-sdk-1.19.0.gem +0 -0
- data/transferzero-sdk-1.19.2.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad2b80146846ea62f697f5fa5c3c3703b7c0bf37f62c23a1b4a2887920a2d2c
|
4
|
+
data.tar.gz: 68b63fb6c09778cdb4323687f9ceb007b2cb1b64943817f020eb95009e9e4cf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4708e12409f99988b5b1d11ed029d0167e6fd8cd210d4645f1504558b85b1c0886d8c3e959b66658c801e4fece8c6209b62f4555b247f933847f663cb6562fd
|
7
|
+
data.tar.gz: 741236413d4435ad7d8700975a81adf739248f89294a812dd41eb4734e3197e4b967be68775cf5aab5d614211ba77b820922fd0241b215f445b0755d5622a9bb
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Reference documentation for the TransferZero API V1
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 1.0
|
10
|
-
- Package version: 1.
|
10
|
+
- Package version: 1.20.0
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
|
13
13
|
For more information, please visit:
|
@@ -31,15 +31,15 @@ gem build transferzero-sdk.gemspec
|
|
31
31
|
Then either install the gem locally:
|
32
32
|
|
33
33
|
```shell
|
34
|
-
gem install ./transferzero-sdk-1.
|
34
|
+
gem install ./transferzero-sdk-1.20.0.gem
|
35
35
|
```
|
36
|
-
(for development, run `gem install --dev ./transferzero-sdk-1.
|
36
|
+
(for development, run `gem install --dev ./transferzero-sdk-1.20.0.gem` to install the development dependencies)
|
37
37
|
|
38
38
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
39
39
|
|
40
40
|
Finally add this to the Gemfile:
|
41
41
|
|
42
|
-
gem 'transferzero-sdk', '~> 1.
|
42
|
+
gem 'transferzero-sdk', '~> 1.20.0'
|
43
43
|
|
44
44
|
### Install from Git
|
45
45
|
|
@@ -170,11 +170,9 @@ Class | Method | HTTP request | Description
|
|
170
170
|
- [TransferZero::ApiLogResponse](docs/ApiLogResponse.md)
|
171
171
|
- [TransferZero::Currency](docs/Currency.md)
|
172
172
|
- [TransferZero::CurrencyExchange](docs/CurrencyExchange.md)
|
173
|
-
- [TransferZero::CurrencyExchangeAllOf](docs/CurrencyExchangeAllOf.md)
|
174
173
|
- [TransferZero::CurrencyExchangeListResponse](docs/CurrencyExchangeListResponse.md)
|
175
174
|
- [TransferZero::CurrencyListResponse](docs/CurrencyListResponse.md)
|
176
175
|
- [TransferZero::CurrencyOpposite](docs/CurrencyOpposite.md)
|
177
|
-
- [TransferZero::CurrencyOppositeAllOf](docs/CurrencyOppositeAllOf.md)
|
178
176
|
- [TransferZero::Debit](docs/Debit.md)
|
179
177
|
- [TransferZero::DebitListRequest](docs/DebitListRequest.md)
|
180
178
|
- [TransferZero::DebitListResponse](docs/DebitListResponse.md)
|
@@ -186,7 +184,6 @@ Class | Method | HTTP request | Description
|
|
186
184
|
- [TransferZero::DocumentRequest](docs/DocumentRequest.md)
|
187
185
|
- [TransferZero::DocumentResponse](docs/DocumentResponse.md)
|
188
186
|
- [TransferZero::DocumentWebhook](docs/DocumentWebhook.md)
|
189
|
-
- [TransferZero::DocumentWebhookAllOf](docs/DocumentWebhookAllOf.md)
|
190
187
|
- [TransferZero::ErrorStatus](docs/ErrorStatus.md)
|
191
188
|
- [TransferZero::FieldDescription](docs/FieldDescription.md)
|
192
189
|
- [TransferZero::FieldSelectValidation](docs/FieldSelectValidation.md)
|
@@ -239,7 +236,6 @@ Class | Method | HTTP request | Description
|
|
239
236
|
- [TransferZero::PayoutMethodResponse](docs/PayoutMethodResponse.md)
|
240
237
|
- [TransferZero::PayoutMethodTransferReasonEnum](docs/PayoutMethodTransferReasonEnum.md)
|
241
238
|
- [TransferZero::PayoutMethodWebhook](docs/PayoutMethodWebhook.md)
|
242
|
-
- [TransferZero::PayoutMethodWebhookAllOf](docs/PayoutMethodWebhookAllOf.md)
|
243
239
|
- [TransferZero::PoliticallyExposedPerson](docs/PoliticallyExposedPerson.md)
|
244
240
|
- [TransferZero::ProofOfPayment](docs/ProofOfPayment.md)
|
245
241
|
- [TransferZero::ProofOfPaymentListResponse](docs/ProofOfPaymentListResponse.md)
|
@@ -250,7 +246,6 @@ Class | Method | HTTP request | Description
|
|
250
246
|
- [TransferZero::RecipientState](docs/RecipientState.md)
|
251
247
|
- [TransferZero::RecipientStateReasonDetails](docs/RecipientStateReasonDetails.md)
|
252
248
|
- [TransferZero::RecipientWebhook](docs/RecipientWebhook.md)
|
253
|
-
- [TransferZero::RecipientWebhookAllOf](docs/RecipientWebhookAllOf.md)
|
254
249
|
- [TransferZero::Sender](docs/Sender.md)
|
255
250
|
- [TransferZero::SenderListResponse](docs/SenderListResponse.md)
|
256
251
|
- [TransferZero::SenderRequest](docs/SenderRequest.md)
|
@@ -259,7 +254,6 @@ Class | Method | HTTP request | Description
|
|
259
254
|
- [TransferZero::SenderResponseMeta](docs/SenderResponseMeta.md)
|
260
255
|
- [TransferZero::SenderState](docs/SenderState.md)
|
261
256
|
- [TransferZero::SenderWebhook](docs/SenderWebhook.md)
|
262
|
-
- [TransferZero::SenderWebhookAllOf](docs/SenderWebhookAllOf.md)
|
263
257
|
- [TransferZero::StateReasonDetails](docs/StateReasonDetails.md)
|
264
258
|
- [TransferZero::Transaction](docs/Transaction.md)
|
265
259
|
- [TransferZero::TransactionListResponse](docs/TransactionListResponse.md)
|
@@ -270,7 +264,6 @@ Class | Method | HTTP request | Description
|
|
270
264
|
- [TransferZero::TransactionState](docs/TransactionState.md)
|
271
265
|
- [TransferZero::TransactionTraits](docs/TransactionTraits.md)
|
272
266
|
- [TransferZero::TransactionWebhook](docs/TransactionWebhook.md)
|
273
|
-
- [TransferZero::TransactionWebhookAllOf](docs/TransactionWebhookAllOf.md)
|
274
267
|
- [TransferZero::ValidationErrorDescription](docs/ValidationErrorDescription.md)
|
275
268
|
- [TransferZero::Webhook](docs/Webhook.md)
|
276
269
|
- [TransferZero::WebhookDefinition](docs/WebhookDefinition.md)
|
data/docs/Document.md
CHANGED
@@ -37,7 +37,7 @@ instance = TransferZero::Document.new(upload: data:image/png;base64,iVBORw0KGg..
|
|
37
37
|
issuing_country: NG,
|
38
38
|
id: ebe9bc0b-f2f6-4ce8-802a-8b79912d041e,
|
39
39
|
document_id: XYZ12345,
|
40
|
-
expiry_date:
|
40
|
+
expiry_date: null,
|
41
41
|
source: Manual,
|
42
42
|
errors: {"phone_number":[{"error":"invalid"}],"documents":[{"error":"blank"}]})
|
43
43
|
```
|
data/docs/Sender.md
CHANGED
@@ -80,11 +80,11 @@ instance = TransferZero::Sender.new(id: bf9ff782-e182-45ac-abea-5bce83ad6670,
|
|
80
80
|
first_name: Johnny,
|
81
81
|
middle_name: Johnny,
|
82
82
|
last_name: English,
|
83
|
-
birth_date:
|
83
|
+
birth_date: null,
|
84
84
|
occupation: Accountant,
|
85
85
|
nationality: NG,
|
86
86
|
legal_entity_type: privately_owned_company,
|
87
|
-
registration_date:
|
87
|
+
registration_date: null,
|
88
88
|
registration_number: null,
|
89
89
|
nature_of_business: null,
|
90
90
|
source_of_funds: null,
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,7 +14,8 @@ require 'date'
|
|
14
14
|
require 'json'
|
15
15
|
require 'logger'
|
16
16
|
require 'tempfile'
|
17
|
-
require '
|
17
|
+
require 'time'
|
18
|
+
require 'faraday'
|
18
19
|
require 'uri'
|
19
20
|
require 'openssl'
|
20
21
|
require 'securerandom'
|
@@ -35,7 +36,7 @@ module TransferZero
|
|
35
36
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
36
37
|
def initialize(config = Configuration.default)
|
37
38
|
@config = config
|
38
|
-
@user_agent = "TransferZero-SDK/Ruby/1.
|
39
|
+
@user_agent = "TransferZero-SDK/Ruby/1.20.0"
|
39
40
|
@default_headers = {
|
40
41
|
'Content-Type' => 'application/json',
|
41
42
|
'User-Agent' => @user_agent
|
@@ -51,33 +52,51 @@ module TransferZero
|
|
51
52
|
# @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
|
52
53
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
53
54
|
def call_api(http_method, path, opts = {})
|
54
|
-
|
55
|
-
|
55
|
+
ssl_options = {
|
56
|
+
:ca_file => @config.ssl_ca_file,
|
57
|
+
:verify => @config.ssl_verify,
|
58
|
+
:verify_mode => @config.ssl_verify_mode,
|
59
|
+
:client_cert => @config.ssl_client_cert,
|
60
|
+
:client_key => @config.ssl_client_key
|
61
|
+
}
|
56
62
|
|
57
|
-
|
58
|
-
|
63
|
+
connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
|
64
|
+
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
65
|
+
conn.request :multipart
|
66
|
+
conn.request :url_encoded
|
67
|
+
end
|
68
|
+
conn.adapter(Faraday.default_adapter)
|
59
69
|
end
|
60
70
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
71
|
+
begin
|
72
|
+
response = connection.public_send(http_method.to_sym.downcase) do |req|
|
73
|
+
build_request(http_method, path, req, opts)
|
74
|
+
end
|
75
|
+
|
76
|
+
if @config.debugging
|
77
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
78
|
+
end
|
79
|
+
|
80
|
+
unless response.success?
|
81
|
+
if response.status == 0 || response.status.nil?
|
82
|
+
# Errors from libcurl will be made visible here
|
83
|
+
fail ApiError.new(:code => 0,
|
84
|
+
:message => response.return_message)
|
85
|
+
elsif response.status == 422
|
86
|
+
fail ApiError.new(:code => response.status,
|
87
|
+
:response_headers => response.headers,
|
88
|
+
:response_body => response.body,
|
89
|
+
:validation_error => true
|
90
|
+
)
|
91
|
+
else
|
92
|
+
fail ApiError.new(:code => response.status,
|
93
|
+
:response_headers => response.headers,
|
94
|
+
:response_body => response.body),
|
95
|
+
response.reason_phrase
|
96
|
+
end
|
80
97
|
end
|
98
|
+
rescue Faraday::TimeoutError
|
99
|
+
fail ApiError.new('Connection timed out')
|
81
100
|
end
|
82
101
|
|
83
102
|
if opts[:return_type]
|
@@ -85,7 +104,7 @@ module TransferZero
|
|
85
104
|
else
|
86
105
|
data = nil
|
87
106
|
end
|
88
|
-
return data, response.
|
107
|
+
return data, response.status, response.headers
|
89
108
|
end
|
90
109
|
|
91
110
|
# Builds the HTTP request
|
@@ -97,57 +116,49 @@ module TransferZero
|
|
97
116
|
# @option opts [Hash] :form_params Query parameters
|
98
117
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
99
118
|
# @return [Typhoeus::Request] A Typhoeus Request
|
100
|
-
def build_request(http_method, path, opts = {})
|
101
|
-
url = build_request_url(path)
|
119
|
+
def build_request(http_method, path, request, opts = {})
|
120
|
+
url = build_request_url(path, opts)
|
102
121
|
http_method = http_method.to_sym.downcase
|
103
122
|
|
104
123
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
105
124
|
query_params = opts[:query_params] || {}
|
106
|
-
url_with_params = add_query(url, query_params)
|
107
125
|
form_params = opts[:form_params] || {}
|
108
|
-
|
109
|
-
request_body = opts[:body].to_s.gsub(/[[:space:]]+/, ' ').strip
|
110
|
-
|
111
|
-
request_nonce = SecureRandom.uuid
|
112
|
-
request_signature = sign_request([
|
113
|
-
request_nonce,
|
114
|
-
http_method.to_s.upcase,
|
115
|
-
url_with_params,
|
116
|
-
DIGEST.hexdigest(request_body)
|
117
|
-
])
|
118
|
-
|
119
|
-
header_params['Authorization-Nonce'] = request_nonce
|
120
|
-
header_params['Authorization-Signature'] = request_signature
|
121
|
-
header_params['Authorization-Key'] = @config.api_key
|
122
|
-
|
123
|
-
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
124
|
-
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
126
|
+
url_with_params = add_query(url, query_params)
|
125
127
|
|
126
128
|
req_opts = {
|
127
129
|
:method => http_method,
|
128
130
|
:headers => header_params,
|
129
|
-
:params =>
|
131
|
+
:params => query_params,
|
130
132
|
:params_encoding => @config.params_encoding,
|
131
133
|
:timeout => @config.timeout,
|
132
|
-
:ssl_verifypeer => @config.verify_ssl,
|
133
|
-
:ssl_verifyhost => _verify_ssl_host,
|
134
|
-
:sslcert => @config.cert_file,
|
135
|
-
:sslkey => @config.key_file,
|
136
134
|
:verbose => @config.debugging
|
137
135
|
}
|
138
136
|
|
139
|
-
|
140
|
-
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
141
|
-
|
137
|
+
req_body = ''
|
142
138
|
if [:post, :patch, :put, :delete].include?(http_method)
|
143
|
-
req_body = build_request_body(header_params, form_params,
|
139
|
+
req_body = build_request_body(header_params, form_params, opts[:body])
|
144
140
|
req_opts.update :body => req_body
|
145
141
|
if @config.debugging
|
146
142
|
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
147
143
|
end
|
148
144
|
end
|
149
145
|
|
150
|
-
|
146
|
+
request_nonce = SecureRandom.uuid
|
147
|
+
request_signature = sign_request([
|
148
|
+
request_nonce,
|
149
|
+
http_method.to_s.upcase,
|
150
|
+
url_with_params,
|
151
|
+
DIGEST.hexdigest(req_body)
|
152
|
+
])
|
153
|
+
|
154
|
+
header_params['Authorization-Nonce'] = request_nonce
|
155
|
+
header_params['Authorization-Signature'] = request_signature
|
156
|
+
header_params['Authorization-Key'] = @config.api_key
|
157
|
+
|
158
|
+
request.headers = header_params
|
159
|
+
request.body = req_body
|
160
|
+
request.url url
|
161
|
+
request.params = query_params
|
151
162
|
download_file(request) if opts[:return_type] == 'File'
|
152
163
|
request
|
153
164
|
end
|
@@ -214,7 +225,25 @@ module TransferZero
|
|
214
225
|
|
215
226
|
# handle file downloading - return the File instance processed in request callbacks
|
216
227
|
# note that response body is empty when the file is written in chunks in request on_body callback
|
217
|
-
|
228
|
+
if return_type == 'File'
|
229
|
+
content_disposition = response.headers['Content-Disposition']
|
230
|
+
if content_disposition && content_disposition =~ /filename=/i
|
231
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
232
|
+
prefix = sanitize_filename(filename)
|
233
|
+
else
|
234
|
+
prefix = 'download-'
|
235
|
+
end
|
236
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
237
|
+
encoding = body.encoding
|
238
|
+
@tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
239
|
+
@tempfile.write(@stream.join.force_encoding(encoding))
|
240
|
+
@tempfile.close
|
241
|
+
@config.logger.info "Temp file written to #{@tempfile.path}, please copy the file to a proper folder "\
|
242
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
243
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
244
|
+
"explicitly with `tempfile.delete`"
|
245
|
+
return @tempfile
|
246
|
+
end
|
218
247
|
|
219
248
|
return nil if body.nil? || body.empty?
|
220
249
|
|
@@ -281,39 +310,45 @@ module TransferZero
|
|
281
310
|
end
|
282
311
|
end
|
283
312
|
|
284
|
-
|
285
|
-
#
|
286
|
-
# The response body is written to the file in chunks in order to handle files which
|
287
|
-
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
288
|
-
# process can use.
|
313
|
+
|
314
|
+
# Builds the HTTP request body
|
289
315
|
#
|
290
|
-
# @
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
316
|
+
# @param [Hash] header_params Header parameters
|
317
|
+
# @param [Hash] form_params Query parameters
|
318
|
+
# @param [Object] body HTTP body (JSON/XML)
|
319
|
+
# @return [String] HTTP body data in the form of string
|
320
|
+
def build_request_body(header_params, form_params, body)
|
321
|
+
# http form
|
322
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
323
|
+
data = URI.encode_www_form(form_params)
|
324
|
+
elsif header_params['Content-Type'] == 'multipart/form-data'
|
325
|
+
data = {}
|
326
|
+
form_params.each do |key, value|
|
327
|
+
case value
|
328
|
+
when ::File, ::Tempfile
|
329
|
+
# TODO hardcode to application/octet-stream, need better way to detect content type
|
330
|
+
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
331
|
+
when ::Array, nil
|
332
|
+
# let Faraday handle Array and nil parameters
|
333
|
+
data[key] = value
|
334
|
+
else
|
335
|
+
data[key] = value.to_s
|
336
|
+
end
|
301
337
|
end
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
end
|
307
|
-
request.on_body do |chunk|
|
308
|
-
chunk.force_encoding(encoding)
|
309
|
-
tempfile.write(chunk)
|
338
|
+
elsif body
|
339
|
+
data = body.is_a?(String) ? body : body.to_json
|
340
|
+
else
|
341
|
+
data = nil
|
310
342
|
end
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
343
|
+
data
|
344
|
+
end
|
345
|
+
|
346
|
+
def download_file(request)
|
347
|
+
@stream = []
|
348
|
+
|
349
|
+
# handle streaming Responses
|
350
|
+
request.options.on_data = Proc.new do |chunk, overall_received_bytes|
|
351
|
+
@stream << chunk
|
317
352
|
end
|
318
353
|
end
|
319
354
|
|
@@ -326,10 +361,10 @@ module TransferZero
|
|
326
361
|
filename.gsub(/.*[\/\\]/, '')
|
327
362
|
end
|
328
363
|
|
329
|
-
def build_request_url(path)
|
364
|
+
def build_request_url(path, opts = {})
|
330
365
|
# Add leading and trailing slashes to path
|
331
366
|
path = "/#{path}".gsub(/\/+/, '/')
|
332
|
-
|
367
|
+
@config.base_url(opts[:operation]) + path
|
333
368
|
end
|
334
369
|
|
335
370
|
# Builds the HTTP request body
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Reference documentation for the TransferZero API V1
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI spec version: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|