transferzero-sdk 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -15
  3. data/docs/Document.md +5 -1
  4. data/docs/DocumentsApi.md +74 -2
  5. data/docs/PayinMethod.md +4 -4
  6. data/docs/PayinMethodDetails.md +4 -2
  7. data/docs/PayinMethodDetailsNGNBank.md +4 -2
  8. data/docs/PayoutMethod.md +1 -1
  9. data/docs/RecipientsApi.md +2 -2
  10. data/docs/Transaction.md +1 -1
  11. data/docs/TransactionTraits.md +2 -2
  12. data/example/client.rb +14 -14
  13. data/lib/transferzero-sdk.rb +0 -7
  14. data/lib/transferzero-sdk/api/documents_api.rb +63 -0
  15. data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
  16. data/lib/transferzero-sdk/api_client.rb +1 -1
  17. data/lib/transferzero-sdk/models/currency_exchange.rb +1 -2
  18. data/lib/transferzero-sdk/models/currency_opposite.rb +1 -2
  19. data/lib/transferzero-sdk/models/document.rb +20 -1
  20. data/lib/transferzero-sdk/models/document_webhook.rb +0 -1
  21. data/lib/transferzero-sdk/models/payin_method.rb +4 -4
  22. data/lib/transferzero-sdk/models/payin_method_details.rb +12 -7
  23. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +11 -6
  24. data/lib/transferzero-sdk/models/payout_method.rb +1 -1
  25. data/lib/transferzero-sdk/models/payout_method_webhook.rb +0 -1
  26. data/lib/transferzero-sdk/models/recipient_webhook.rb +0 -1
  27. data/lib/transferzero-sdk/models/sender.rb +1 -1
  28. data/lib/transferzero-sdk/models/sender_state.rb +1 -0
  29. data/lib/transferzero-sdk/models/sender_webhook.rb +0 -1
  30. data/lib/transferzero-sdk/models/transaction.rb +1 -1
  31. data/lib/transferzero-sdk/models/transaction_traits.rb +3 -3
  32. data/lib/transferzero-sdk/models/transaction_webhook.rb +0 -1
  33. data/lib/transferzero-sdk/models/webhook.rb +1 -1
  34. data/lib/transferzero-sdk/version.rb +1 -1
  35. data/spec/api/account_validation_api_spec.rb +2 -2
  36. data/spec/api/currency_info_api_spec.rb +2 -0
  37. data/spec/api/documents_api_spec.rb +15 -0
  38. data/spec/api/recipients_api_spec.rb +1 -1
  39. data/spec/api/transactions_api_spec.rb +13 -0
  40. data/spec/models/account_validation_request_spec.rb +7 -1
  41. data/spec/models/currency_opposite_spec.rb +6 -0
  42. data/spec/models/document_spec.rb +12 -0
  43. data/spec/models/payin_method_details_ngn_bank_spec.rb +6 -0
  44. data/spec/models/payin_method_details_spec.rb +6 -0
  45. data/spec/models/payout_method_details_spec.rb +7 -1
  46. data/spec/models/payout_method_details_xof_bank_spec.rb +1 -1
  47. data/spec/models/recipient_spec.rb +6 -0
  48. data/spec/models/sender_spec.rb +16 -0
  49. data/transferzero-sdk-1.4.0.gem +0 -0
  50. metadata +3 -32
  51. data/docs/CurrencyExchangeAllOf.md +0 -17
  52. data/docs/CurrencyOppositeAllOf.md +0 -19
  53. data/docs/DocumentWebhookAllOf.md +0 -17
  54. data/docs/PayoutMethodWebhookAllOf.md +0 -17
  55. data/docs/RecipientWebhookAllOf.md +0 -17
  56. data/docs/SenderWebhookAllOf.md +0 -17
  57. data/docs/TransactionWebhookAllOf.md +0 -17
  58. data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +0 -204
  59. data/lib/transferzero-sdk/models/currency_opposite_all_of.rb +0 -212
  60. data/lib/transferzero-sdk/models/document_webhook_all_of.rb +0 -201
  61. data/lib/transferzero-sdk/models/payout_method_webhook_all_of.rb +0 -201
  62. data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +0 -201
  63. data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +0 -201
  64. data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +0 -201
  65. data/spec/api_client_spec.rb +0 -189
  66. data/spec/models/currency_exchange_all_of_spec.rb +0 -41
  67. data/spec/models/currency_opposite_all_of_spec.rb +0 -41
  68. data/spec/models/document_webhook_all_of_spec.rb +0 -41
  69. data/spec/models/payout_method_webhook_all_of_spec.rb +0 -41
  70. data/spec/models/recipient_webhook_all_of_spec.rb +0 -41
  71. data/spec/models/sender_webhook_all_of_spec.rb +0 -41
  72. data/spec/models/transaction_webhook_all_of_spec.rb +0 -41
@@ -1,17 +0,0 @@
1
- # TransferZero::CurrencyExchangeAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **opposites** | [**Array<CurrencyOpposite>**](CurrencyOpposite.md) | Lists the currencies where you can exchange from this one | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::CurrencyExchangeAllOf.new(opposites: null)
15
- ```
16
-
17
-
@@ -1,19 +0,0 @@
1
- # TransferZero::CurrencyOppositeAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **rate** | **Float** | The rate of this particular currency with the base one | [optional]
8
- **mtm_rate** | **Float** | Mark to market rate of this particular currency against the base one with the margin factored in | [optional]
9
-
10
- ## Code Sample
11
-
12
- ```ruby
13
- require 'TransferZero'
14
-
15
- instance = TransferZero::CurrencyOppositeAllOf.new(rate: null,
16
- mtm_rate: null)
17
- ```
18
-
19
-
@@ -1,17 +0,0 @@
1
- # TransferZero::DocumentWebhookAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **object** | [**Document**](Document.md) | | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::DocumentWebhookAllOf.new(object: null)
15
- ```
16
-
17
-
@@ -1,17 +0,0 @@
1
- # TransferZero::PayoutMethodWebhookAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **object** | [**PayoutMethod**](PayoutMethod.md) | | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::PayoutMethodWebhookAllOf.new(object: null)
15
- ```
16
-
17
-
@@ -1,17 +0,0 @@
1
- # TransferZero::RecipientWebhookAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **object** | [**Recipient**](Recipient.md) | | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::RecipientWebhookAllOf.new(object: null)
15
- ```
16
-
17
-
@@ -1,17 +0,0 @@
1
- # TransferZero::SenderWebhookAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **object** | [**Sender**](Sender.md) | | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::SenderWebhookAllOf.new(object: null)
15
- ```
16
-
17
-
@@ -1,17 +0,0 @@
1
- # TransferZero::TransactionWebhookAllOf
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **object** | [**Transaction**](Transaction.md) | | [optional]
8
-
9
- ## Code Sample
10
-
11
- ```ruby
12
- require 'TransferZero'
13
-
14
- instance = TransferZero::TransactionWebhookAllOf.new(object: null)
15
- ```
16
-
17
-
@@ -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
- class CurrencyExchangeAllOf
17
- # Lists the currencies where you can exchange from this one
18
- attr_accessor :opposites
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'opposites' => :'opposites'
24
- }
25
- end
26
-
27
- # Attribute type mapping.
28
- def self.openapi_types
29
- {
30
- :'opposites' => :'Array<CurrencyOpposite>'
31
- }
32
- end
33
-
34
- # Initializes the object
35
- # @param [Hash] attributes Model attributes in the form of hash
36
- def initialize(attributes = {})
37
- if (!attributes.is_a?(Hash))
38
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::CurrencyExchangeAllOf` initialize method"
39
- end
40
-
41
- # check to see if the attribute exists and convert string to symbol for hash key
42
- attributes = attributes.each_with_object({}) { |(k, v), h|
43
- if (!self.class.attribute_map.key?(k.to_sym))
44
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::CurrencyExchangeAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
45
- end
46
- h[k.to_sym] = v
47
- }
48
-
49
- if attributes.key?(:'opposites')
50
- if (value = attributes[:'opposites']).is_a?(Array)
51
- self.opposites = value
52
- end
53
- end
54
- end
55
-
56
- # Show invalid properties with the reasons. Usually used together with valid?
57
- # @return Array for valid properties with the reasons
58
- def list_invalid_properties
59
- invalid_properties = Array.new
60
- invalid_properties
61
- end
62
-
63
- # Check to see if the all the properties in the model are valid
64
- # @return true if the model is valid
65
- def valid?
66
- true
67
- end
68
-
69
- # Checks equality by comparing each attribute.
70
- # @param [Object] Object to be compared
71
- def ==(o)
72
- return true if self.equal?(o)
73
- self.class == o.class &&
74
- opposites == o.opposites
75
- end
76
-
77
- # @see the `==` method
78
- # @param [Object] Object to be compared
79
- def eql?(o)
80
- self == o
81
- end
82
-
83
- # Calculates hash code according to all attributes.
84
- # @return [Integer] Hash code
85
- def hash
86
- [opposites].hash
87
- end
88
-
89
- require 'active_support/core_ext/hash'
90
- require 'active_support/hash_with_indifferent_access.rb'
91
- # Builds the object from hash
92
- # @param [Hash] attributes Model attributes in the form of hash
93
- # @return [Object] Returns the model itself
94
- def build_from_hash(attributes)
95
- return nil unless attributes.is_a?(Hash)
96
- self.class.openapi_types.each_pair do |key, type|
97
- if type =~ /\AArray<(.*)>/i
98
- # check to ensure the input is an array given that the the attribute
99
- # is documented as an array but the input is not
100
- if attributes[self.class.attribute_map[key]].is_a?(Array)
101
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
- end
103
- elsif !attributes[self.class.attribute_map[key]].nil?
104
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
- end # or else data not found in attributes(hash), not an issue as the data can be optional
106
- end
107
-
108
- self
109
- end
110
-
111
- # Deserializes the data based on type
112
- # @param string type Data type
113
- # @param string value Value to be deserialized
114
- # @return [Object] Deserialized data
115
- def _deserialize(type, value)
116
- case type.to_sym
117
- when :DateTime
118
- DateTime.parse(value)
119
- when :Date
120
- Date.parse(value)
121
- when :String
122
- value.to_s
123
- when :Integer
124
- value.to_i
125
- when :Float
126
- value.to_f
127
- when :Boolean
128
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
- true
130
- else
131
- false
132
- end
133
- when :Object
134
- # generic object (usually a Hash), return directly
135
- value
136
- when /\AArray<(?<inner_type>.+)>\z/
137
- inner_type = Regexp.last_match[:inner_type]
138
- value.map { |v| _deserialize(inner_type, v) }
139
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
- k_type = Regexp.last_match[:k_type]
141
- v_type = Regexp.last_match[:v_type]
142
- {}.tap do |hash|
143
- value.each do |k, v|
144
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
- end
146
- end
147
- else # model
148
- temp_model = TransferZero.const_get(type).new
149
- temp_model.build_from_hash(value)
150
- end
151
- end
152
-
153
- # Returns the string representation of the object
154
- # @return [String] String presentation of the object
155
- def to_s
156
- to_hash.to_s
157
- end
158
-
159
- # to_body is an alias to to_hash (backward compatibility)
160
- # @return [Hash] Returns the object in the form of hash
161
- def to_body
162
- to_hash
163
- end
164
-
165
- # Returns the object in the form of hash
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_hash
168
- hash = {}
169
- self.class.attribute_map.each_pair do |attr, param|
170
- value = self.send(attr)
171
- next if value.nil?
172
- hash[param] = _to_hash(value)
173
- end
174
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
175
- end
176
-
177
- def [](key)
178
- to_hash[key]
179
- end
180
-
181
- def dig(*args)
182
- to_hash.dig(*args)
183
- end
184
-
185
- # Outputs non-array value in the form of hash
186
- # For object, use to_hash. Otherwise, just return the value
187
- # @param [Object] value Any valid value
188
- # @return [Hash] Returns the value in the form of hash
189
- def _to_hash(value)
190
- if value.is_a?(Array)
191
- value.compact.map { |v| _to_hash(v) }
192
- elsif value.is_a?(Hash)
193
- {}.tap do |hash|
194
- value.each { |k, v| hash[k] = _to_hash(v) }
195
- end
196
- elsif value.respond_to? :to_hash
197
- value.to_hash
198
- else
199
- value
200
- end
201
- end
202
-
203
- end
204
- end
@@ -1,212 +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
- class CurrencyOppositeAllOf
17
- # The rate of this particular currency with the base one
18
- attr_accessor :rate
19
-
20
- # Mark to market rate of this particular currency against the base one with the margin factored in
21
- attr_accessor :mtm_rate
22
-
23
- # Attribute mapping from ruby-style variable name to JSON key.
24
- def self.attribute_map
25
- {
26
- :'rate' => :'rate',
27
- :'mtm_rate' => :'mtm_rate'
28
- }
29
- end
30
-
31
- # Attribute type mapping.
32
- def self.openapi_types
33
- {
34
- :'rate' => :'Float',
35
- :'mtm_rate' => :'Float'
36
- }
37
- end
38
-
39
- # Initializes the object
40
- # @param [Hash] attributes Model attributes in the form of hash
41
- def initialize(attributes = {})
42
- if (!attributes.is_a?(Hash))
43
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::CurrencyOppositeAllOf` initialize method"
44
- end
45
-
46
- # check to see if the attribute exists and convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}) { |(k, v), h|
48
- if (!self.class.attribute_map.key?(k.to_sym))
49
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::CurrencyOppositeAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
- end
51
- h[k.to_sym] = v
52
- }
53
-
54
- if attributes.key?(:'rate')
55
- self.rate = attributes[:'rate']
56
- end
57
-
58
- if attributes.key?(:'mtm_rate')
59
- self.mtm_rate = attributes[:'mtm_rate']
60
- end
61
- end
62
-
63
- # Show invalid properties with the reasons. Usually used together with valid?
64
- # @return Array for valid properties with the reasons
65
- def list_invalid_properties
66
- invalid_properties = Array.new
67
- invalid_properties
68
- end
69
-
70
- # Check to see if the all the properties in the model are valid
71
- # @return true if the model is valid
72
- def valid?
73
- true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- rate == o.rate &&
82
- mtm_rate == o.mtm_rate
83
- end
84
-
85
- # @see the `==` method
86
- # @param [Object] Object to be compared
87
- def eql?(o)
88
- self == o
89
- end
90
-
91
- # Calculates hash code according to all attributes.
92
- # @return [Integer] Hash code
93
- def hash
94
- [rate, mtm_rate].hash
95
- end
96
-
97
- require 'active_support/core_ext/hash'
98
- require 'active_support/hash_with_indifferent_access.rb'
99
- # Builds the object from hash
100
- # @param [Hash] attributes Model attributes in the form of hash
101
- # @return [Object] Returns the model itself
102
- def build_from_hash(attributes)
103
- return nil unless attributes.is_a?(Hash)
104
- self.class.openapi_types.each_pair do |key, type|
105
- if type =~ /\AArray<(.*)>/i
106
- # check to ensure the input is an array given that the the attribute
107
- # is documented as an array but the input is not
108
- if attributes[self.class.attribute_map[key]].is_a?(Array)
109
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
- end
111
- elsif !attributes[self.class.attribute_map[key]].nil?
112
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
- end # or else data not found in attributes(hash), not an issue as the data can be optional
114
- end
115
-
116
- self
117
- end
118
-
119
- # Deserializes the data based on type
120
- # @param string type Data type
121
- # @param string value Value to be deserialized
122
- # @return [Object] Deserialized data
123
- def _deserialize(type, value)
124
- case type.to_sym
125
- when :DateTime
126
- DateTime.parse(value)
127
- when :Date
128
- Date.parse(value)
129
- when :String
130
- value.to_s
131
- when :Integer
132
- value.to_i
133
- when :Float
134
- value.to_f
135
- when :Boolean
136
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
- true
138
- else
139
- false
140
- end
141
- when :Object
142
- # generic object (usually a Hash), return directly
143
- value
144
- when /\AArray<(?<inner_type>.+)>\z/
145
- inner_type = Regexp.last_match[:inner_type]
146
- value.map { |v| _deserialize(inner_type, v) }
147
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
- k_type = Regexp.last_match[:k_type]
149
- v_type = Regexp.last_match[:v_type]
150
- {}.tap do |hash|
151
- value.each do |k, v|
152
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
- end
154
- end
155
- else # model
156
- temp_model = TransferZero.const_get(type).new
157
- temp_model.build_from_hash(value)
158
- end
159
- end
160
-
161
- # Returns the string representation of the object
162
- # @return [String] String presentation of the object
163
- def to_s
164
- to_hash.to_s
165
- end
166
-
167
- # to_body is an alias to to_hash (backward compatibility)
168
- # @return [Hash] Returns the object in the form of hash
169
- def to_body
170
- to_hash
171
- end
172
-
173
- # Returns the object in the form of hash
174
- # @return [Hash] Returns the object in the form of hash
175
- def to_hash
176
- hash = {}
177
- self.class.attribute_map.each_pair do |attr, param|
178
- value = self.send(attr)
179
- next if value.nil?
180
- hash[param] = _to_hash(value)
181
- end
182
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
183
- end
184
-
185
- def [](key)
186
- to_hash[key]
187
- end
188
-
189
- def dig(*args)
190
- to_hash.dig(*args)
191
- end
192
-
193
- # Outputs non-array value in the form of hash
194
- # For object, use to_hash. Otherwise, just return the value
195
- # @param [Object] value Any valid value
196
- # @return [Hash] Returns the value in the form of hash
197
- def _to_hash(value)
198
- if value.is_a?(Array)
199
- value.compact.map { |v| _to_hash(v) }
200
- elsif value.is_a?(Hash)
201
- {}.tap do |hash|
202
- value.each { |k, v| hash[k] = _to_hash(v) }
203
- end
204
- elsif value.respond_to? :to_hash
205
- value.to_hash
206
- else
207
- value
208
- end
209
- end
210
-
211
- end
212
- end