transferzero-sdk 1.7.0 → 1.8.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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -7
  3. data/docs/AccountMeta.md +1 -1
  4. data/docs/Currency.md +1 -1
  5. data/docs/CurrencyExchange.md +1 -1
  6. data/docs/CurrencyOpposite.md +1 -1
  7. data/docs/Document.md +3 -3
  8. data/docs/DocumentsApi.md +74 -2
  9. data/docs/FieldSelectValidation.md +1 -1
  10. data/docs/FieldValidation.md +1 -1
  11. data/docs/PayinMethodDetails.md +1 -3
  12. data/docs/PayinMethodDetailsMobile.md +1 -1
  13. data/docs/PaymentMethod.md +2 -2
  14. data/docs/PaymentMethodOpposite.md +2 -2
  15. data/docs/PayoutMethodDetails.md +1 -7
  16. data/docs/PayoutMethodDetailsIBAN.md +1 -1
  17. data/docs/Recipient.md +4 -4
  18. data/docs/RecipientsApi.md +1 -1
  19. data/docs/Sender.md +33 -63
  20. data/lib/transferzero-sdk.rb +0 -3
  21. data/lib/transferzero-sdk/api/documents_api.rb +63 -0
  22. data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
  23. data/lib/transferzero-sdk/api_client.rb +3 -5
  24. data/lib/transferzero-sdk/models/account.rb +69 -70
  25. data/lib/transferzero-sdk/models/account_list_response.rb +66 -67
  26. data/lib/transferzero-sdk/models/account_meta.rb +60 -61
  27. data/lib/transferzero-sdk/models/account_response.rb +65 -66
  28. data/lib/transferzero-sdk/models/account_validation_error.rb +60 -61
  29. data/lib/transferzero-sdk/models/account_validation_request.rb +163 -164
  30. data/lib/transferzero-sdk/models/account_validation_response.rb +65 -66
  31. data/lib/transferzero-sdk/models/account_validation_result.rb +60 -61
  32. data/lib/transferzero-sdk/models/api_log.rb +135 -136
  33. data/lib/transferzero-sdk/models/api_log_list_response.rb +69 -70
  34. data/lib/transferzero-sdk/models/api_log_response.rb +59 -60
  35. data/lib/transferzero-sdk/models/currency.rb +141 -142
  36. data/lib/transferzero-sdk/models/currency_exchange.rb +157 -158
  37. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +61 -62
  38. data/lib/transferzero-sdk/models/currency_list_response.rb +61 -62
  39. data/lib/transferzero-sdk/models/currency_opposite.rb +165 -166
  40. data/lib/transferzero-sdk/models/debit.rb +150 -151
  41. data/lib/transferzero-sdk/models/debit_list_request.rb +60 -61
  42. data/lib/transferzero-sdk/models/debit_list_response.rb +66 -67
  43. data/lib/transferzero-sdk/models/debit_request.rb +59 -60
  44. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +79 -80
  45. data/lib/transferzero-sdk/models/debit_response.rb +59 -60
  46. data/lib/transferzero-sdk/models/document.rb +177 -179
  47. data/lib/transferzero-sdk/models/document_list_response.rb +66 -67
  48. data/lib/transferzero-sdk/models/document_request.rb +59 -60
  49. data/lib/transferzero-sdk/models/document_response.rb +59 -60
  50. data/lib/transferzero-sdk/models/document_webhook.rb +95 -96
  51. data/lib/transferzero-sdk/models/error_status.rb +65 -66
  52. data/lib/transferzero-sdk/models/field_description.rb +94 -95
  53. data/lib/transferzero-sdk/models/field_select_validation.rb +69 -70
  54. data/lib/transferzero-sdk/models/field_validation.rb +77 -78
  55. data/lib/transferzero-sdk/models/pagination.rb +96 -97
  56. data/lib/transferzero-sdk/models/pagination_meta.rb +59 -60
  57. data/lib/transferzero-sdk/models/payin_method.rb +96 -97
  58. data/lib/transferzero-sdk/models/payin_method_details.rb +110 -122
  59. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +74 -75
  60. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +70 -71
  61. data/lib/transferzero-sdk/models/payin_method_request.rb +59 -60
  62. data/lib/transferzero-sdk/models/payment_method.rb +108 -109
  63. data/lib/transferzero-sdk/models/payment_method_list_response.rb +60 -61
  64. data/lib/transferzero-sdk/models/payment_method_opposite.rb +123 -124
  65. data/lib/transferzero-sdk/models/payout_method.rb +106 -107
  66. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +19 -14
  67. data/lib/transferzero-sdk/models/payout_method_details.rb +297 -337
  68. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +60 -61
  69. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +96 -97
  70. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +104 -100
  71. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +161 -162
  72. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +85 -86
  73. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +103 -104
  74. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +107 -108
  75. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +96 -97
  76. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +19 -14
  77. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +20 -15
  78. data/lib/transferzero-sdk/models/payout_method_list_response.rb +66 -67
  79. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +19 -14
  80. data/lib/transferzero-sdk/models/payout_method_request.rb +59 -60
  81. data/lib/transferzero-sdk/models/payout_method_response.rb +59 -60
  82. data/lib/transferzero-sdk/models/payout_method_webhook.rb +95 -96
  83. data/lib/transferzero-sdk/models/politically_exposed_person.rb +123 -123
  84. data/lib/transferzero-sdk/models/recipient.rb +229 -230
  85. data/lib/transferzero-sdk/models/recipient_list_response.rb +66 -67
  86. data/lib/transferzero-sdk/models/recipient_request.rb +59 -60
  87. data/lib/transferzero-sdk/models/recipient_response.rb +59 -60
  88. data/lib/transferzero-sdk/models/recipient_state.rb +27 -22
  89. data/lib/transferzero-sdk/models/recipient_webhook.rb +95 -96
  90. data/lib/transferzero-sdk/models/sender.rb +358 -521
  91. data/lib/transferzero-sdk/models/sender_list_response.rb +66 -67
  92. data/lib/transferzero-sdk/models/sender_request.rb +59 -60
  93. data/lib/transferzero-sdk/models/sender_response.rb +65 -66
  94. data/lib/transferzero-sdk/models/sender_response_existing.rb +59 -60
  95. data/lib/transferzero-sdk/models/sender_response_meta.rb +59 -60
  96. data/lib/transferzero-sdk/models/sender_state.rb +24 -19
  97. data/lib/transferzero-sdk/models/sender_webhook.rb +95 -96
  98. data/lib/transferzero-sdk/models/transaction.rb +191 -192
  99. data/lib/transferzero-sdk/models/transaction_list_response.rb +66 -67
  100. data/lib/transferzero-sdk/models/transaction_request.rb +59 -60
  101. data/lib/transferzero-sdk/models/transaction_response.rb +65 -66
  102. data/lib/transferzero-sdk/models/transaction_response_existing.rb +65 -66
  103. data/lib/transferzero-sdk/models/transaction_response_meta.rb +59 -60
  104. data/lib/transferzero-sdk/models/transaction_state.rb +28 -23
  105. data/lib/transferzero-sdk/models/transaction_traits.rb +70 -71
  106. data/lib/transferzero-sdk/models/transaction_webhook.rb +95 -96
  107. data/lib/transferzero-sdk/models/validation_error_description.rb +61 -62
  108. data/lib/transferzero-sdk/models/webhook.rb +91 -92
  109. data/lib/transferzero-sdk/models/webhook_definition.rb +106 -107
  110. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +60 -61
  111. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +66 -67
  112. data/lib/transferzero-sdk/models/webhook_definition_request.rb +59 -60
  113. data/lib/transferzero-sdk/models/webhook_definition_response.rb +59 -60
  114. data/lib/transferzero-sdk/models/webhook_log.rb +96 -97
  115. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +69 -70
  116. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +128 -129
  117. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +79 -80
  118. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +80 -81
  119. data/lib/transferzero-sdk/models/webhook_log_response.rb +59 -60
  120. data/lib/transferzero-sdk/version.rb +1 -1
  121. metadata +3 -15
  122. data/docs/PayinMethodDetailsBTC.md +0 -17
  123. data/docs/PayoutMethodDetailsBTC.md +0 -23
  124. data/docs/PayoutMethodDetailsGBPBank.md +0 -29
  125. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +0 -204
  126. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +0 -250
  127. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +0 -267
  128. data/spec/models/payin_method_details_btc_spec.rb +0 -41
  129. data/spec/models/payout_method_details_btc_spec.rb +0 -59
  130. data/spec/models/payout_method_details_gbp_bank_spec.rb +0 -77
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.0.0-beta3
11
11
  =end
12
12
 
13
13
  module TransferZero
14
- VERSION = '1.7.0'
14
+ VERSION = '1.8.0'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transferzero-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TransferZero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-28 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -251,7 +251,6 @@ files:
251
251
  - docs/PaginationMeta.md
252
252
  - docs/PayinMethod.md
253
253
  - docs/PayinMethodDetails.md
254
- - docs/PayinMethodDetailsBTC.md
255
254
  - docs/PayinMethodDetailsMobile.md
256
255
  - docs/PayinMethodDetailsNGNBank.md
257
256
  - docs/PayinMethodRequest.md
@@ -262,9 +261,7 @@ files:
262
261
  - docs/PayoutMethod.md
263
262
  - docs/PayoutMethodBankAccountTypeEnum.md
264
263
  - docs/PayoutMethodDetails.md
265
- - docs/PayoutMethodDetailsBTC.md
266
264
  - docs/PayoutMethodDetailsBalance.md
267
- - docs/PayoutMethodDetailsGBPBank.md
268
265
  - docs/PayoutMethodDetailsGHSBank.md
269
266
  - docs/PayoutMethodDetailsIBAN.md
270
267
  - docs/PayoutMethodDetailsMADCash.md
@@ -375,7 +372,6 @@ files:
375
372
  - lib/transferzero-sdk/models/pagination_meta.rb
376
373
  - lib/transferzero-sdk/models/payin_method.rb
377
374
  - lib/transferzero-sdk/models/payin_method_details.rb
378
- - lib/transferzero-sdk/models/payin_method_details_btc.rb
379
375
  - lib/transferzero-sdk/models/payin_method_details_mobile.rb
380
376
  - lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb
381
377
  - lib/transferzero-sdk/models/payin_method_request.rb
@@ -386,8 +382,6 @@ files:
386
382
  - lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb
387
383
  - lib/transferzero-sdk/models/payout_method_details.rb
388
384
  - lib/transferzero-sdk/models/payout_method_details_balance.rb
389
- - lib/transferzero-sdk/models/payout_method_details_btc.rb
390
- - lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb
391
385
  - lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb
392
386
  - lib/transferzero-sdk/models/payout_method_details_iban.rb
393
387
  - lib/transferzero-sdk/models/payout_method_details_mad_cash.rb
@@ -487,7 +481,6 @@ files:
487
481
  - spec/models/field_validation_spec.rb
488
482
  - spec/models/pagination_meta_spec.rb
489
483
  - spec/models/pagination_spec.rb
490
- - spec/models/payin_method_details_btc_spec.rb
491
484
  - spec/models/payin_method_details_mobile_spec.rb
492
485
  - spec/models/payin_method_details_ngn_bank_spec.rb
493
486
  - spec/models/payin_method_details_spec.rb
@@ -498,8 +491,6 @@ files:
498
491
  - spec/models/payment_method_spec.rb
499
492
  - spec/models/payout_method_bank_account_type_enum_spec.rb
500
493
  - spec/models/payout_method_details_balance_spec.rb
501
- - spec/models/payout_method_details_btc_spec.rb
502
- - spec/models/payout_method_details_gbp_bank_spec.rb
503
494
  - spec/models/payout_method_details_ghs_bank_spec.rb
504
495
  - spec/models/payout_method_details_iban_spec.rb
505
496
  - spec/models/payout_method_details_mad_cash_spec.rb
@@ -574,7 +565,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
574
565
  - !ruby/object:Gem::Version
575
566
  version: '0'
576
567
  requirements: []
577
- rubygems_version: 3.0.3
568
+ rubygems_version: 3.0.6
578
569
  signing_key:
579
570
  specification_version: 4
580
571
  summary: TransferZero API Ruby Gem
@@ -607,14 +598,12 @@ test_files:
607
598
  - spec/models/debit_response_spec.rb
608
599
  - spec/models/webhook_definition_event_list_response_spec.rb
609
600
  - spec/models/debit_spec.rb
610
- - spec/models/payin_method_details_btc_spec.rb
611
601
  - spec/models/transaction_response_meta_spec.rb
612
602
  - spec/models/transaction_traits_spec.rb
613
603
  - spec/models/account_spec.rb
614
604
  - spec/models/webhook_definition_request_spec.rb
615
605
  - spec/models/sender_state_spec.rb
616
606
  - spec/models/payout_method_request_spec.rb
617
- - spec/models/payout_method_details_gbp_bank_spec.rb
618
607
  - spec/models/webhook_log_metadata_request_spec.rb
619
608
  - spec/models/recipient_webhook_spec.rb
620
609
  - spec/models/api_log_list_response_spec.rb
@@ -630,7 +619,6 @@ test_files:
630
619
  - spec/models/payin_method_details_mobile_spec.rb
631
620
  - spec/models/payout_method_details_mad_cash_spec.rb
632
621
  - spec/models/account_validation_response_spec.rb
633
- - spec/models/payout_method_details_btc_spec.rb
634
622
  - spec/models/api_log_spec.rb
635
623
  - spec/models/document_response_spec.rb
636
624
  - spec/models/currency_exchange_list_response_spec.rb
@@ -1,17 +0,0 @@
1
- # TransferZero::PayinMethodDetailsBTC
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **refund_address** | **String** | Please make sure the refund_address is a valid BTC address belonging to the sender, as that is going to be used in case the transaction has to be refunded. | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::PayinMethodDetailsBTC.new(refund_address: null)
15
- ```
16
-
17
-
@@ -1,23 +0,0 @@
1
- # TransferZero::PayoutMethodDetailsBTC
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **first_name** | **String** | |
8
- **last_name** | **String** | |
9
- **name** | **String** | |
10
- **address** | **String** | |
11
-
12
- ## Code Sample
13
-
14
- ```ruby
15
- require 'TransferZero'
16
-
17
- instance = TransferZero::PayoutMethodDetailsBTC.new(first_name: null,
18
- last_name: null,
19
- name: null,
20
- address: null)
21
- ```
22
-
23
-
@@ -1,29 +0,0 @@
1
- # TransferZero::PayoutMethodDetailsGBPBank
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **first_name** | **String** | |
8
- **last_name** | **String** | |
9
- **bank_name** | **String** | | [optional]
10
- **bank_account** | **String** | | [optional]
11
- **sort_code** | **String** | | [optional]
12
- **iban** | **String** | | [optional]
13
- **bic** | **String** | | [optional]
14
-
15
- ## Code Sample
16
-
17
- ```ruby
18
- require 'TransferZero'
19
-
20
- instance = TransferZero::PayoutMethodDetailsGBPBank.new(first_name: null,
21
- last_name: null,
22
- bank_name: null,
23
- bank_account: null,
24
- sort_code: null,
25
- iban: null,
26
- bic: null)
27
- ```
28
-
29
-
@@ -1,204 +0,0 @@
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
- # ```JSON \"details\": { \"refund_address\": \"n4VQ5YdHf7hLQ2gWQYYrcxoE5B7nWuDFNF\" } ```
17
- class PayinMethodDetailsBTC
18
- # Please make sure the refund_address is a valid BTC address belonging to the sender, as that is going to be used in case the transaction has to be refunded.
19
- attr_accessor :refund_address
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'refund_address' => :'refund_address'
25
- }
26
- end
27
-
28
- # Attribute type mapping.
29
- def self.openapi_types
30
- {
31
- :'refund_address' => :'String'
32
- }
33
- end
34
-
35
- # Initializes the object
36
- # @param [Hash] attributes Model attributes in the form of hash
37
- def initialize(attributes = {})
38
- if (!attributes.is_a?(Hash))
39
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayinMethodDetailsBTC` initialize method"
40
- end
41
-
42
- # check to see if the attribute exists and convert string to symbol for hash key
43
- attributes = attributes.each_with_object({}) { |(k, v), h|
44
- if (!self.class.attribute_map.key?(k.to_sym))
45
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayinMethodDetailsBTC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
46
- end
47
- h[k.to_sym] = v
48
- }
49
-
50
- if attributes.key?(:'refund_address')
51
- self.refund_address = attributes[:'refund_address']
52
- end
53
- end
54
-
55
- # Show invalid properties with the reasons. Usually used together with valid?
56
- # @return Array for valid properties with the reasons
57
- def list_invalid_properties
58
- invalid_properties = Array.new
59
- invalid_properties
60
- end
61
-
62
- # Check to see if the all the properties in the model are valid
63
- # @return true if the model is valid
64
- def valid?
65
- true
66
- end
67
-
68
- # Checks equality by comparing each attribute.
69
- # @param [Object] Object to be compared
70
- def ==(o)
71
- return true if self.equal?(o)
72
- self.class == o.class &&
73
- refund_address == o.refund_address
74
- end
75
-
76
- # @see the `==` method
77
- # @param [Object] Object to be compared
78
- def eql?(o)
79
- self == o
80
- end
81
-
82
- # Calculates hash code according to all attributes.
83
- # @return [Integer] Hash code
84
- def hash
85
- [refund_address].hash
86
- end
87
-
88
- require 'active_support/core_ext/hash'
89
- require 'active_support/hash_with_indifferent_access.rb'
90
- # Builds the object from hash
91
- # @param [Hash] attributes Model attributes in the form of hash
92
- # @return [Object] Returns the model itself
93
- def build_from_hash(attributes)
94
- return nil unless attributes.is_a?(Hash)
95
- self.class.openapi_types.each_pair do |key, type|
96
- if type =~ /\AArray<(.*)>/i
97
- # check to ensure the input is an array given that the the attribute
98
- # is documented as an array but the input is not
99
- if attributes[self.class.attribute_map[key]].is_a?(Array)
100
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
- end
102
- elsif !attributes[self.class.attribute_map[key]].nil?
103
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
- end # or else data not found in attributes(hash), not an issue as the data can be optional
105
- end
106
-
107
- self
108
- end
109
-
110
- # Deserializes the data based on type
111
- # @param string type Data type
112
- # @param string value Value to be deserialized
113
- # @return [Object] Deserialized data
114
- def _deserialize(type, value)
115
- case type.to_sym
116
- when :DateTime
117
- DateTime.parse(value)
118
- when :Date
119
- Date.parse(value)
120
- when :String
121
- value.to_s
122
- when :Integer
123
- value.to_i
124
- when :Float
125
- value.to_f
126
- when :Boolean
127
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
- true
129
- else
130
- false
131
- end
132
- when :Object
133
- # generic object (usually a Hash), return directly
134
- value
135
- when /\AArray<(?<inner_type>.+)>\z/
136
- inner_type = Regexp.last_match[:inner_type]
137
- value.map { |v| _deserialize(inner_type, v) }
138
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
- k_type = Regexp.last_match[:k_type]
140
- v_type = Regexp.last_match[:v_type]
141
- {}.tap do |hash|
142
- value.each do |k, v|
143
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
- end
145
- end
146
- else # model
147
- temp_model = TransferZero.const_get(type).new
148
- temp_model.build_from_hash(value)
149
- end
150
- end
151
-
152
- # Returns the string representation of the object
153
- # @return [String] String presentation of the object
154
- def to_s
155
- to_hash.to_s
156
- end
157
-
158
- # to_body is an alias to to_hash (backward compatibility)
159
- # @return [Hash] Returns the object in the form of hash
160
- def to_body
161
- to_hash
162
- end
163
-
164
- # Returns the object in the form of hash
165
- # @return [Hash] Returns the object in the form of hash
166
- def to_hash
167
- hash = {}
168
- self.class.attribute_map.each_pair do |attr, param|
169
- value = self.send(attr)
170
- next if value.nil?
171
- hash[param] = _to_hash(value)
172
- end
173
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
174
- end
175
-
176
- def [](key)
177
- to_hash[key]
178
- end
179
-
180
- def dig(*args)
181
- to_hash.dig(*args)
182
- end
183
-
184
- # Outputs non-array value in the form of hash
185
- # For object, use to_hash. Otherwise, just return the value
186
- # @param [Object] value Any valid value
187
- # @return [Hash] Returns the value in the form of hash
188
- def _to_hash(value)
189
- if value.is_a?(Array)
190
- value.compact.map { |v| _to_hash(v) }
191
- elsif value.is_a?(Hash)
192
- {}.tap do |hash|
193
- value.each { |k, v| hash[k] = _to_hash(v) }
194
- end
195
- elsif value.respond_to? :to_hash
196
- value.to_hash
197
- else
198
- value
199
- end
200
- end
201
-
202
- end
203
-
204
- end
@@ -1,250 +0,0 @@
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
- # ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"name\": \"Full Name\" \"address\": \"n4VQ5YdHf7hLQ2gWQYYrcxoE5B7nWuDFNF\" }
17
- class PayoutMethodDetailsBTC
18
- attr_accessor :first_name
19
-
20
- attr_accessor :last_name
21
-
22
- attr_accessor :name
23
-
24
- attr_accessor :address
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'first_name' => :'first_name',
30
- :'last_name' => :'last_name',
31
- :'name' => :'name',
32
- :'address' => :'address'
33
- }
34
- end
35
-
36
- # Attribute type mapping.
37
- def self.openapi_types
38
- {
39
- :'first_name' => :'String',
40
- :'last_name' => :'String',
41
- :'name' => :'String',
42
- :'address' => :'String'
43
- }
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsBTC` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsBTC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'first_name')
62
- self.first_name = attributes[:'first_name']
63
- end
64
-
65
- if attributes.key?(:'last_name')
66
- self.last_name = attributes[:'last_name']
67
- end
68
-
69
- if attributes.key?(:'name')
70
- self.name = attributes[:'name']
71
- end
72
-
73
- if attributes.key?(:'address')
74
- self.address = attributes[:'address']
75
- end
76
- end
77
-
78
- # Show invalid properties with the reasons. Usually used together with valid?
79
- # @return Array for valid properties with the reasons
80
- def list_invalid_properties
81
- invalid_properties = Array.new
82
- if @first_name.nil?
83
- invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
84
- end
85
-
86
- if @last_name.nil?
87
- invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
88
- end
89
-
90
- if @name.nil?
91
- invalid_properties.push('invalid value for "name", name cannot be nil.')
92
- end
93
-
94
- if @address.nil?
95
- invalid_properties.push('invalid value for "address", address cannot be nil.')
96
- end
97
-
98
- invalid_properties
99
- end
100
-
101
- # Check to see if the all the properties in the model are valid
102
- # @return true if the model is valid
103
- def valid?
104
- return false if @first_name.nil?
105
- return false if @last_name.nil?
106
- return false if @name.nil?
107
- return false if @address.nil?
108
- true
109
- end
110
-
111
- # Checks equality by comparing each attribute.
112
- # @param [Object] Object to be compared
113
- def ==(o)
114
- return true if self.equal?(o)
115
- self.class == o.class &&
116
- first_name == o.first_name &&
117
- last_name == o.last_name &&
118
- name == o.name &&
119
- address == o.address
120
- end
121
-
122
- # @see the `==` method
123
- # @param [Object] Object to be compared
124
- def eql?(o)
125
- self == o
126
- end
127
-
128
- # Calculates hash code according to all attributes.
129
- # @return [Integer] Hash code
130
- def hash
131
- [first_name, last_name, name, address].hash
132
- end
133
-
134
- require 'active_support/core_ext/hash'
135
- require 'active_support/hash_with_indifferent_access.rb'
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def build_from_hash(attributes)
140
- return nil unless attributes.is_a?(Hash)
141
- self.class.openapi_types.each_pair do |key, type|
142
- if type =~ /\AArray<(.*)>/i
143
- # check to ensure the input is an array given that the the attribute
144
- # is documented as an array but the input is not
145
- if attributes[self.class.attribute_map[key]].is_a?(Array)
146
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
- end
148
- elsif !attributes[self.class.attribute_map[key]].nil?
149
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
- end # or else data not found in attributes(hash), not an issue as the data can be optional
151
- end
152
-
153
- self
154
- end
155
-
156
- # Deserializes the data based on type
157
- # @param string type Data type
158
- # @param string value Value to be deserialized
159
- # @return [Object] Deserialized data
160
- def _deserialize(type, value)
161
- case type.to_sym
162
- when :DateTime
163
- DateTime.parse(value)
164
- when :Date
165
- Date.parse(value)
166
- when :String
167
- value.to_s
168
- when :Integer
169
- value.to_i
170
- when :Float
171
- value.to_f
172
- when :Boolean
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
- true
175
- else
176
- false
177
- end
178
- when :Object
179
- # generic object (usually a Hash), return directly
180
- value
181
- when /\AArray<(?<inner_type>.+)>\z/
182
- inner_type = Regexp.last_match[:inner_type]
183
- value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
- k_type = Regexp.last_match[:k_type]
186
- v_type = Regexp.last_match[:v_type]
187
- {}.tap do |hash|
188
- value.each do |k, v|
189
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
- end
191
- end
192
- else # model
193
- temp_model = TransferZero.const_get(type).new
194
- temp_model.build_from_hash(value)
195
- end
196
- end
197
-
198
- # Returns the string representation of the object
199
- # @return [String] String presentation of the object
200
- def to_s
201
- to_hash.to_s
202
- end
203
-
204
- # to_body is an alias to to_hash (backward compatibility)
205
- # @return [Hash] Returns the object in the form of hash
206
- def to_body
207
- to_hash
208
- end
209
-
210
- # Returns the object in the form of hash
211
- # @return [Hash] Returns the object in the form of hash
212
- def to_hash
213
- hash = {}
214
- self.class.attribute_map.each_pair do |attr, param|
215
- value = self.send(attr)
216
- next if value.nil?
217
- hash[param] = _to_hash(value)
218
- end
219
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
220
- end
221
-
222
- def [](key)
223
- to_hash[key]
224
- end
225
-
226
- def dig(*args)
227
- to_hash.dig(*args)
228
- end
229
-
230
- # Outputs non-array value in the form of hash
231
- # For object, use to_hash. Otherwise, just return the value
232
- # @param [Object] value Any valid value
233
- # @return [Hash] Returns the value in the form of hash
234
- def _to_hash(value)
235
- if value.is_a?(Array)
236
- value.compact.map { |v| _to_hash(v) }
237
- elsif value.is_a?(Hash)
238
- {}.tap do |hash|
239
- value.each { |k, v| hash[k] = _to_hash(v) }
240
- end
241
- elsif value.respond_to? :to_hash
242
- value.to_hash
243
- else
244
- value
245
- end
246
- end
247
-
248
- end
249
-
250
- end