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.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -11
  3. data/docs/Document.md +1 -1
  4. data/docs/Sender.md +2 -2
  5. data/lib/transferzero-sdk/api/account_debits_api.rb +2 -2
  6. data/lib/transferzero-sdk/api/account_validation_api.rb +2 -2
  7. data/lib/transferzero-sdk/api/accounts_api.rb +2 -2
  8. data/lib/transferzero-sdk/api/api_logs_api.rb +2 -2
  9. data/lib/transferzero-sdk/api/currency_info_api.rb +2 -2
  10. data/lib/transferzero-sdk/api/documents_api.rb +2 -2
  11. data/lib/transferzero-sdk/api/logs_api.rb +2 -2
  12. data/lib/transferzero-sdk/api/payin_methods_api.rb +2 -2
  13. data/lib/transferzero-sdk/api/payment_methods_api.rb +2 -2
  14. data/lib/transferzero-sdk/api/payout_methods_api.rb +2 -2
  15. data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
  16. data/lib/transferzero-sdk/api/senders_api.rb +2 -2
  17. data/lib/transferzero-sdk/api/transactions_api.rb +2 -2
  18. data/lib/transferzero-sdk/api/webhooks_api.rb +2 -2
  19. data/lib/transferzero-sdk/api_client.rb +126 -91
  20. data/lib/transferzero-sdk/api_error.rb +2 -2
  21. data/lib/transferzero-sdk/configuration.rb +97 -21
  22. data/lib/transferzero-sdk/models/account.rb +2 -2
  23. data/lib/transferzero-sdk/models/account_list_response.rb +2 -2
  24. data/lib/transferzero-sdk/models/account_meta.rb +2 -2
  25. data/lib/transferzero-sdk/models/account_response.rb +2 -2
  26. data/lib/transferzero-sdk/models/account_validation_error.rb +2 -2
  27. data/lib/transferzero-sdk/models/account_validation_request.rb +2 -2
  28. data/lib/transferzero-sdk/models/account_validation_response.rb +2 -2
  29. data/lib/transferzero-sdk/models/account_validation_result.rb +2 -2
  30. data/lib/transferzero-sdk/models/api_log.rb +2 -2
  31. data/lib/transferzero-sdk/models/api_log_list_response.rb +2 -2
  32. data/lib/transferzero-sdk/models/api_log_response.rb +2 -2
  33. data/lib/transferzero-sdk/models/currency.rb +2 -2
  34. data/lib/transferzero-sdk/models/currency_exchange.rb +3 -4
  35. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +2 -2
  36. data/lib/transferzero-sdk/models/currency_list_response.rb +2 -2
  37. data/lib/transferzero-sdk/models/currency_opposite.rb +3 -4
  38. data/lib/transferzero-sdk/models/debit.rb +2 -2
  39. data/lib/transferzero-sdk/models/debit_list_request.rb +2 -2
  40. data/lib/transferzero-sdk/models/debit_list_response.rb +2 -2
  41. data/lib/transferzero-sdk/models/debit_request.rb +2 -2
  42. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +2 -2
  43. data/lib/transferzero-sdk/models/debit_response.rb +2 -2
  44. data/lib/transferzero-sdk/models/document.rb +2 -2
  45. data/lib/transferzero-sdk/models/document_list_response.rb +2 -2
  46. data/lib/transferzero-sdk/models/document_request.rb +2 -2
  47. data/lib/transferzero-sdk/models/document_response.rb +2 -2
  48. data/lib/transferzero-sdk/models/document_webhook.rb +2 -3
  49. data/lib/transferzero-sdk/models/error_status.rb +2 -2
  50. data/lib/transferzero-sdk/models/field_description.rb +2 -2
  51. data/lib/transferzero-sdk/models/field_select_validation.rb +2 -2
  52. data/lib/transferzero-sdk/models/field_validation.rb +2 -2
  53. data/lib/transferzero-sdk/models/pagination.rb +2 -2
  54. data/lib/transferzero-sdk/models/pagination_meta.rb +2 -2
  55. data/lib/transferzero-sdk/models/payin_method.rb +2 -2
  56. data/lib/transferzero-sdk/models/payin_method_details.rb +2 -2
  57. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +2 -2
  58. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +2 -2
  59. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
  60. data/lib/transferzero-sdk/models/payin_method_request.rb +2 -2
  61. data/lib/transferzero-sdk/models/payin_method_response.rb +2 -2
  62. data/lib/transferzero-sdk/models/payin_method_state.rb +2 -2
  63. data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +2 -2
  64. data/lib/transferzero-sdk/models/payment_method.rb +2 -2
  65. data/lib/transferzero-sdk/models/payment_method_list_response.rb +2 -2
  66. data/lib/transferzero-sdk/models/payment_method_opposite.rb +2 -2
  67. data/lib/transferzero-sdk/models/payout_method.rb +2 -2
  68. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +2 -2
  69. data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +2 -2
  70. data/lib/transferzero-sdk/models/payout_method_country_enum.rb +2 -2
  71. data/lib/transferzero-sdk/models/payout_method_details.rb +2 -2
  72. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +2 -2
  73. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +2 -2
  74. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +2 -2
  75. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +2 -2
  76. data/lib/transferzero-sdk/models/payout_method_details_ghs_cash.rb +2 -2
  77. data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +2 -2
  78. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +2 -2
  79. data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +2 -2
  80. data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +2 -2
  81. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +2 -2
  82. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +2 -2
  83. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +3 -3
  84. data/lib/transferzero-sdk/models/payout_method_details_usd_bank.rb +2 -2
  85. data/lib/transferzero-sdk/models/payout_method_details_usd_cash.rb +2 -2
  86. data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +2 -2
  87. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +2 -2
  88. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +2 -2
  89. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +3 -3
  90. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +2 -2
  91. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +2 -2
  92. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +2 -2
  93. data/lib/transferzero-sdk/models/payout_method_legal_entity_type_enum.rb +2 -2
  94. data/lib/transferzero-sdk/models/payout_method_list_response.rb +2 -2
  95. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +5 -2
  96. data/lib/transferzero-sdk/models/payout_method_nature_of_business_enum.rb +2 -2
  97. data/lib/transferzero-sdk/models/payout_method_request.rb +2 -2
  98. data/lib/transferzero-sdk/models/payout_method_response.rb +2 -2
  99. data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +2 -2
  100. data/lib/transferzero-sdk/models/payout_method_webhook.rb +2 -3
  101. data/lib/transferzero-sdk/models/politically_exposed_person.rb +2 -2
  102. data/lib/transferzero-sdk/models/proof_of_payment.rb +2 -2
  103. data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +2 -2
  104. data/lib/transferzero-sdk/models/recipient.rb +2 -2
  105. data/lib/transferzero-sdk/models/recipient_list_response.rb +2 -2
  106. data/lib/transferzero-sdk/models/recipient_request.rb +2 -2
  107. data/lib/transferzero-sdk/models/recipient_response.rb +2 -2
  108. data/lib/transferzero-sdk/models/recipient_state.rb +2 -2
  109. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +2 -2
  110. data/lib/transferzero-sdk/models/recipient_webhook.rb +2 -3
  111. data/lib/transferzero-sdk/models/sender.rb +2 -2
  112. data/lib/transferzero-sdk/models/sender_list_response.rb +2 -2
  113. data/lib/transferzero-sdk/models/sender_request.rb +2 -2
  114. data/lib/transferzero-sdk/models/sender_response.rb +2 -2
  115. data/lib/transferzero-sdk/models/sender_response_existing.rb +2 -2
  116. data/lib/transferzero-sdk/models/sender_response_meta.rb +2 -2
  117. data/lib/transferzero-sdk/models/sender_state.rb +2 -2
  118. data/lib/transferzero-sdk/models/sender_webhook.rb +2 -3
  119. data/lib/transferzero-sdk/models/state_reason_details.rb +2 -2
  120. data/lib/transferzero-sdk/models/transaction.rb +2 -2
  121. data/lib/transferzero-sdk/models/transaction_list_response.rb +2 -2
  122. data/lib/transferzero-sdk/models/transaction_request.rb +2 -2
  123. data/lib/transferzero-sdk/models/transaction_response.rb +2 -2
  124. data/lib/transferzero-sdk/models/transaction_response_existing.rb +2 -2
  125. data/lib/transferzero-sdk/models/transaction_response_meta.rb +2 -2
  126. data/lib/transferzero-sdk/models/transaction_state.rb +2 -2
  127. data/lib/transferzero-sdk/models/transaction_traits.rb +2 -2
  128. data/lib/transferzero-sdk/models/transaction_webhook.rb +2 -3
  129. data/lib/transferzero-sdk/models/validation_error_description.rb +2 -2
  130. data/lib/transferzero-sdk/models/webhook.rb +2 -2
  131. data/lib/transferzero-sdk/models/webhook_definition.rb +2 -2
  132. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +2 -2
  133. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +2 -2
  134. data/lib/transferzero-sdk/models/webhook_definition_request.rb +2 -2
  135. data/lib/transferzero-sdk/models/webhook_definition_response.rb +2 -2
  136. data/lib/transferzero-sdk/models/webhook_log.rb +2 -2
  137. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +2 -2
  138. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +2 -2
  139. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +2 -2
  140. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +2 -2
  141. data/lib/transferzero-sdk/models/webhook_log_response.rb +2 -2
  142. data/lib/transferzero-sdk/version.rb +3 -3
  143. data/lib/transferzero-sdk.rb +2 -9
  144. data/spec/api/documents_api_spec.rb +0 -15
  145. data/spec/api/payin_methods_api_spec.rb +2 -2
  146. data/spec/api/payout_methods_api_spec.rb +1 -1
  147. data/spec/api/recipients_api_spec.rb +13 -1
  148. data/spec/api/senders_api_spec.rb +1 -1
  149. data/spec/api/transactions_api_spec.rb +1 -0
  150. data/spec/models/account_validation_request_spec.rb +14 -2
  151. data/spec/models/currency_exchange_spec.rb +0 -6
  152. data/spec/models/currency_opposite_spec.rb +4 -4
  153. data/spec/models/currency_spec.rb +0 -6
  154. data/spec/models/document_spec.rb +20 -2
  155. data/spec/models/payin_method_details_mobile_spec.rb +7 -1
  156. data/spec/models/payin_method_details_spec.rb +13 -1
  157. data/spec/models/payin_method_spec.rb +25 -1
  158. data/spec/models/payout_method_details_kes_bank_spec.rb +6 -0
  159. data/spec/models/payout_method_details_kes_mobile_spec.rb +6 -0
  160. data/spec/models/payout_method_details_mobile_spec.rb +6 -0
  161. data/spec/models/payout_method_details_spec.rb +108 -0
  162. data/spec/models/payout_method_details_xof_bank_spec.rb +12 -0
  163. data/spec/models/payout_method_details_xof_cash_spec.rb +3 -9
  164. data/spec/models/payout_method_details_xof_mobile_spec.rb +12 -0
  165. data/spec/models/payout_method_details_zar_bank_spec.rb +48 -0
  166. data/spec/models/recipient_spec.rb +22 -0
  167. data/spec/models/sender_spec.rb +169 -19
  168. data/transferzero-sdk.gemspec +3 -9
  169. metadata +6 -157
  170. data/Gemfile.lock +0 -92
  171. data/docs/CurrencyExchangeAllOf.md +0 -17
  172. data/docs/CurrencyOppositeAllOf.md +0 -21
  173. data/docs/DocumentWebhookAllOf.md +0 -17
  174. data/docs/PayoutMethodWebhookAllOf.md +0 -17
  175. data/docs/RecipientWebhookAllOf.md +0 -17
  176. data/docs/SenderWebhookAllOf.md +0 -17
  177. data/docs/TransactionWebhookAllOf.md +0 -17
  178. data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +0 -205
  179. data/lib/transferzero-sdk/models/currency_opposite_all_of.rb +0 -223
  180. data/lib/transferzero-sdk/models/document_webhook_all_of.rb +0 -202
  181. data/lib/transferzero-sdk/models/payout_method_webhook_all_of.rb +0 -202
  182. data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +0 -202
  183. data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +0 -202
  184. data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +0 -202
  185. data/spec/models/currency_exchange_all_of_spec.rb +0 -41
  186. data/spec/models/currency_opposite_all_of_spec.rb +0 -53
  187. data/spec/models/document_webhook_all_of_spec.rb +0 -41
  188. data/spec/models/payout_method_webhook_all_of_spec.rb +0 -41
  189. data/spec/models/recipient_webhook_all_of_spec.rb +0 -41
  190. data/spec/models/sender_webhook_all_of_spec.rb +0 -41
  191. data/spec/models/transaction_webhook_all_of_spec.rb +0 -41
  192. data/transferzero-sdk-1.19.0.gem +0 -0
  193. data/transferzero-sdk-1.19.2.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7898d724bae73aa1cedc43503f1b25171572b88202d615745f6e038d15c1eaee
4
- data.tar.gz: dbac5d3b4a5b44b323699bf912172ace6071ab421d8ed29c2ed93755b211c72a
3
+ metadata.gz: 7ad2b80146846ea62f697f5fa5c3c3703b7c0bf37f62c23a1b4a2887920a2d2c
4
+ data.tar.gz: 68b63fb6c09778cdb4323687f9ceb007b2cb1b64943817f020eb95009e9e4cf7
5
5
  SHA512:
6
- metadata.gz: 8cda1de7634911055202b496ceb0d9ec4f25e15b5cefb14bf930b456d047bbd2ca0a0bcbd69aa62720f922abd0ac445d73ba92735b5988bd8e9d57c5371024b5
7
- data.tar.gz: 5f6090a481bb286a3b1da884e2c87597754f967c860061131330af3ea4ac627c4d818145b4e872072320b42be798daefd7f871379aadd38b3c407ad50ed6d7fc
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.19.3
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.19.3.gem
34
+ gem install ./transferzero-sdk-1.20.0.gem
35
35
  ```
36
- (for development, run `gem install --dev ./transferzero-sdk-1.19.3.gem` to install the development dependencies)
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.19.3'
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: Wed Jun 07 00:00:00 UTC 2028,
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: Thu Jan 01 00:00:00 UTC 1970,
83
+ birth_date: null,
84
84
  occupation: Accountant,
85
85
  nationality: NG,
86
86
  legal_entity_type: privately_owned_company,
87
- registration_date: Thu Jan 01 00:00:00 UTC 1970,
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
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 'typhoeus'
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.19.3"
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
- request = build_request(http_method, path, opts)
55
- response = request.run
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
- if @config.debugging
58
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
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
- unless response.success?
62
- if response.timed_out?
63
- fail ApiError.new('Connection timed out')
64
- elsif response.code == 0
65
- # Errors from libcurl will be made visible here
66
- fail ApiError.new(:code => 0,
67
- :message => response.return_message)
68
- elsif response.code == 422
69
- fail ApiError.new(:code => response.code,
70
- :response_headers => response.headers,
71
- :response_body => response.body,
72
- :validation_error => true
73
- )
74
- else
75
- fail ApiError.new(:code => response.code,
76
- :response_headers => response.headers,
77
- :response_body => response.body,
78
- :validation_error => false),
79
- response.status_message
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.code, response.headers
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 => {}, # removed and params added to url string
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
- # set custom cert, if provided
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, request_body)
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
- request = Typhoeus::Request.new(url_with_params, req_opts)
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
- return @tempfile if return_type == 'File'
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
- # Save response body into a file in (the defined) temporary folder, using the filename
285
- # from the "Content-Disposition" header if provided, otherwise a random filename.
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
- # @see Configuration#temp_folder_path
291
- def download_file(request)
292
- tempfile = nil
293
- encoding = nil
294
- request.on_headers do |response|
295
- content_disposition = response.headers['Content-Disposition']
296
- if content_disposition && content_disposition =~ /filename=/i
297
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
298
- prefix = sanitize_filename(filename)
299
- else
300
- prefix = 'download-'
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
- prefix = prefix + '-' unless prefix.end_with?('-')
303
- encoding = response.body.encoding
304
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
305
- @tempfile = tempfile
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
- request.on_complete do |response|
312
- tempfile.close
313
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
314
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
315
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
316
- "explicitly with `tempfile.delete`"
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
- URI.encode(@config.base_url + path)
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
- The version of the OpenAPI document: 1.0
6
+ OpenAPI spec version: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.1
9
+ OpenAPI Generator version: 4.0.0-beta3
10
10
 
11
11
  =end
12
12