transferzero-sdk 1.19.5 → 1.21.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 -4
- data/docs/PayinMethodDetails.md +2 -0
- data/docs/PayinMethodDetailsMobile.md +2 -0
- data/lib/transferzero-sdk/api_client.rb +2 -30
- data/lib/transferzero-sdk/models/payin_method_details.rb +10 -1
- data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +10 -1
- data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +3 -0
- data/lib/transferzero-sdk/version.rb +1 -1
- 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-1.19.5.gem +0 -0
- data/transferzero-sdk-1.20.1.gem +0 -0
- metadata +4 -30
- 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
@@ -1,202 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#TransferZero API
|
3
|
-
|
4
|
-
#Reference documentation for the TransferZero API V1
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.1.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module TransferZero
|
16
|
-
class RecipientWebhookAllOf
|
17
|
-
attr_accessor :object
|
18
|
-
|
19
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
-
def self.attribute_map
|
21
|
-
{
|
22
|
-
:'object' => :'object'
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
# Attribute type mapping.
|
27
|
-
def self.openapi_types
|
28
|
-
{
|
29
|
-
:'object' => :'Recipient'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# Initializes the object
|
34
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
-
def initialize(attributes = {})
|
36
|
-
if (!attributes.is_a?(Hash))
|
37
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::RecipientWebhookAllOf` initialize method"
|
38
|
-
end
|
39
|
-
|
40
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
41
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
42
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
43
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::RecipientWebhookAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
44
|
-
end
|
45
|
-
h[k.to_sym] = v
|
46
|
-
}
|
47
|
-
|
48
|
-
if attributes.key?(:'object')
|
49
|
-
self.object = attributes[:'object']
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
54
|
-
# @return Array for valid properties with the reasons
|
55
|
-
def list_invalid_properties
|
56
|
-
invalid_properties = Array.new
|
57
|
-
invalid_properties
|
58
|
-
end
|
59
|
-
|
60
|
-
# Check to see if the all the properties in the model are valid
|
61
|
-
# @return true if the model is valid
|
62
|
-
def valid?
|
63
|
-
true
|
64
|
-
end
|
65
|
-
|
66
|
-
# Checks equality by comparing each attribute.
|
67
|
-
# @param [Object] Object to be compared
|
68
|
-
def ==(o)
|
69
|
-
return true if self.equal?(o)
|
70
|
-
self.class == o.class &&
|
71
|
-
object == o.object
|
72
|
-
end
|
73
|
-
|
74
|
-
# @see the `==` method
|
75
|
-
# @param [Object] Object to be compared
|
76
|
-
def eql?(o)
|
77
|
-
self == o
|
78
|
-
end
|
79
|
-
|
80
|
-
# Calculates hash code according to all attributes.
|
81
|
-
# @return [Integer] Hash code
|
82
|
-
def hash
|
83
|
-
[object].hash
|
84
|
-
end
|
85
|
-
|
86
|
-
require 'active_support/core_ext/hash'
|
87
|
-
require 'active_support/hash_with_indifferent_access.rb'
|
88
|
-
# Builds the object from hash
|
89
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
-
# @return [Object] Returns the model itself
|
91
|
-
def build_from_hash(attributes)
|
92
|
-
return nil unless attributes.is_a?(Hash)
|
93
|
-
self.class.openapi_types.each_pair do |key, type|
|
94
|
-
if type =~ /\AArray<(.*)>/i
|
95
|
-
# check to ensure the input is an array given that the the attribute
|
96
|
-
# is documented as an array but the input is not
|
97
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
-
end
|
100
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
-
end
|
104
|
-
|
105
|
-
self
|
106
|
-
end
|
107
|
-
|
108
|
-
# Deserializes the data based on type
|
109
|
-
# @param string type Data type
|
110
|
-
# @param string value Value to be deserialized
|
111
|
-
# @return [Object] Deserialized data
|
112
|
-
def _deserialize(type, value)
|
113
|
-
case type.to_sym
|
114
|
-
when :DateTime
|
115
|
-
DateTime.parse(value)
|
116
|
-
when :Date
|
117
|
-
Date.parse(value)
|
118
|
-
when :String
|
119
|
-
value.to_s
|
120
|
-
when :Integer
|
121
|
-
value.to_i
|
122
|
-
when :Float
|
123
|
-
value.to_f
|
124
|
-
when :Boolean
|
125
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
-
true
|
127
|
-
else
|
128
|
-
false
|
129
|
-
end
|
130
|
-
when :Object
|
131
|
-
# generic object (usually a Hash), return directly
|
132
|
-
value
|
133
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
-
inner_type = Regexp.last_match[:inner_type]
|
135
|
-
value.map { |v| _deserialize(inner_type, v) }
|
136
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
-
k_type = Regexp.last_match[:k_type]
|
138
|
-
v_type = Regexp.last_match[:v_type]
|
139
|
-
{}.tap do |hash|
|
140
|
-
value.each do |k, v|
|
141
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
else # model
|
145
|
-
temp_model = TransferZero.const_get(type).new
|
146
|
-
temp_model.build_from_hash(value)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
# Returns the string representation of the object
|
151
|
-
# @return [String] String presentation of the object
|
152
|
-
def to_s
|
153
|
-
to_hash.to_s
|
154
|
-
end
|
155
|
-
|
156
|
-
# to_body is an alias to to_hash (backward compatibility)
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_body
|
159
|
-
to_hash
|
160
|
-
end
|
161
|
-
|
162
|
-
# Returns the object in the form of hash
|
163
|
-
# @return [Hash] Returns the object in the form of hash
|
164
|
-
def to_hash
|
165
|
-
hash = {}
|
166
|
-
self.class.attribute_map.each_pair do |attr, param|
|
167
|
-
value = self.send(attr)
|
168
|
-
next if value.nil?
|
169
|
-
hash[param] = _to_hash(value)
|
170
|
-
end
|
171
|
-
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
172
|
-
end
|
173
|
-
|
174
|
-
def [](key)
|
175
|
-
to_hash[key]
|
176
|
-
end
|
177
|
-
|
178
|
-
def dig(*args)
|
179
|
-
to_hash.dig(*args)
|
180
|
-
end
|
181
|
-
|
182
|
-
# Outputs non-array value in the form of hash
|
183
|
-
# For object, use to_hash. Otherwise, just return the value
|
184
|
-
# @param [Object] value Any valid value
|
185
|
-
# @return [Hash] Returns the value in the form of hash
|
186
|
-
def _to_hash(value)
|
187
|
-
if value.is_a?(Array)
|
188
|
-
value.compact.map { |v| _to_hash(v) }
|
189
|
-
elsif value.is_a?(Hash)
|
190
|
-
{}.tap do |hash|
|
191
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
192
|
-
end
|
193
|
-
elsif value.respond_to? :to_hash
|
194
|
-
value.to_hash
|
195
|
-
else
|
196
|
-
value
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|
@@ -1,202 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#TransferZero API
|
3
|
-
|
4
|
-
#Reference documentation for the TransferZero API V1
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.1.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module TransferZero
|
16
|
-
class SenderWebhookAllOf
|
17
|
-
attr_accessor :object
|
18
|
-
|
19
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
-
def self.attribute_map
|
21
|
-
{
|
22
|
-
:'object' => :'object'
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
# Attribute type mapping.
|
27
|
-
def self.openapi_types
|
28
|
-
{
|
29
|
-
:'object' => :'Sender'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# Initializes the object
|
34
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
-
def initialize(attributes = {})
|
36
|
-
if (!attributes.is_a?(Hash))
|
37
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::SenderWebhookAllOf` initialize method"
|
38
|
-
end
|
39
|
-
|
40
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
41
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
42
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
43
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::SenderWebhookAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
44
|
-
end
|
45
|
-
h[k.to_sym] = v
|
46
|
-
}
|
47
|
-
|
48
|
-
if attributes.key?(:'object')
|
49
|
-
self.object = attributes[:'object']
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
54
|
-
# @return Array for valid properties with the reasons
|
55
|
-
def list_invalid_properties
|
56
|
-
invalid_properties = Array.new
|
57
|
-
invalid_properties
|
58
|
-
end
|
59
|
-
|
60
|
-
# Check to see if the all the properties in the model are valid
|
61
|
-
# @return true if the model is valid
|
62
|
-
def valid?
|
63
|
-
true
|
64
|
-
end
|
65
|
-
|
66
|
-
# Checks equality by comparing each attribute.
|
67
|
-
# @param [Object] Object to be compared
|
68
|
-
def ==(o)
|
69
|
-
return true if self.equal?(o)
|
70
|
-
self.class == o.class &&
|
71
|
-
object == o.object
|
72
|
-
end
|
73
|
-
|
74
|
-
# @see the `==` method
|
75
|
-
# @param [Object] Object to be compared
|
76
|
-
def eql?(o)
|
77
|
-
self == o
|
78
|
-
end
|
79
|
-
|
80
|
-
# Calculates hash code according to all attributes.
|
81
|
-
# @return [Integer] Hash code
|
82
|
-
def hash
|
83
|
-
[object].hash
|
84
|
-
end
|
85
|
-
|
86
|
-
require 'active_support/core_ext/hash'
|
87
|
-
require 'active_support/hash_with_indifferent_access.rb'
|
88
|
-
# Builds the object from hash
|
89
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
-
# @return [Object] Returns the model itself
|
91
|
-
def build_from_hash(attributes)
|
92
|
-
return nil unless attributes.is_a?(Hash)
|
93
|
-
self.class.openapi_types.each_pair do |key, type|
|
94
|
-
if type =~ /\AArray<(.*)>/i
|
95
|
-
# check to ensure the input is an array given that the the attribute
|
96
|
-
# is documented as an array but the input is not
|
97
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
-
end
|
100
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
-
end
|
104
|
-
|
105
|
-
self
|
106
|
-
end
|
107
|
-
|
108
|
-
# Deserializes the data based on type
|
109
|
-
# @param string type Data type
|
110
|
-
# @param string value Value to be deserialized
|
111
|
-
# @return [Object] Deserialized data
|
112
|
-
def _deserialize(type, value)
|
113
|
-
case type.to_sym
|
114
|
-
when :DateTime
|
115
|
-
DateTime.parse(value)
|
116
|
-
when :Date
|
117
|
-
Date.parse(value)
|
118
|
-
when :String
|
119
|
-
value.to_s
|
120
|
-
when :Integer
|
121
|
-
value.to_i
|
122
|
-
when :Float
|
123
|
-
value.to_f
|
124
|
-
when :Boolean
|
125
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
-
true
|
127
|
-
else
|
128
|
-
false
|
129
|
-
end
|
130
|
-
when :Object
|
131
|
-
# generic object (usually a Hash), return directly
|
132
|
-
value
|
133
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
-
inner_type = Regexp.last_match[:inner_type]
|
135
|
-
value.map { |v| _deserialize(inner_type, v) }
|
136
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
-
k_type = Regexp.last_match[:k_type]
|
138
|
-
v_type = Regexp.last_match[:v_type]
|
139
|
-
{}.tap do |hash|
|
140
|
-
value.each do |k, v|
|
141
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
else # model
|
145
|
-
temp_model = TransferZero.const_get(type).new
|
146
|
-
temp_model.build_from_hash(value)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
# Returns the string representation of the object
|
151
|
-
# @return [String] String presentation of the object
|
152
|
-
def to_s
|
153
|
-
to_hash.to_s
|
154
|
-
end
|
155
|
-
|
156
|
-
# to_body is an alias to to_hash (backward compatibility)
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_body
|
159
|
-
to_hash
|
160
|
-
end
|
161
|
-
|
162
|
-
# Returns the object in the form of hash
|
163
|
-
# @return [Hash] Returns the object in the form of hash
|
164
|
-
def to_hash
|
165
|
-
hash = {}
|
166
|
-
self.class.attribute_map.each_pair do |attr, param|
|
167
|
-
value = self.send(attr)
|
168
|
-
next if value.nil?
|
169
|
-
hash[param] = _to_hash(value)
|
170
|
-
end
|
171
|
-
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
172
|
-
end
|
173
|
-
|
174
|
-
def [](key)
|
175
|
-
to_hash[key]
|
176
|
-
end
|
177
|
-
|
178
|
-
def dig(*args)
|
179
|
-
to_hash.dig(*args)
|
180
|
-
end
|
181
|
-
|
182
|
-
# Outputs non-array value in the form of hash
|
183
|
-
# For object, use to_hash. Otherwise, just return the value
|
184
|
-
# @param [Object] value Any valid value
|
185
|
-
# @return [Hash] Returns the value in the form of hash
|
186
|
-
def _to_hash(value)
|
187
|
-
if value.is_a?(Array)
|
188
|
-
value.compact.map { |v| _to_hash(v) }
|
189
|
-
elsif value.is_a?(Hash)
|
190
|
-
{}.tap do |hash|
|
191
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
192
|
-
end
|
193
|
-
elsif value.respond_to? :to_hash
|
194
|
-
value.to_hash
|
195
|
-
else
|
196
|
-
value
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|
@@ -1,202 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#TransferZero API
|
3
|
-
|
4
|
-
#Reference documentation for the TransferZero API V1
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.1.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module TransferZero
|
16
|
-
class TransactionWebhookAllOf
|
17
|
-
attr_accessor :object
|
18
|
-
|
19
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
-
def self.attribute_map
|
21
|
-
{
|
22
|
-
:'object' => :'object'
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
# Attribute type mapping.
|
27
|
-
def self.openapi_types
|
28
|
-
{
|
29
|
-
:'object' => :'Transaction'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# Initializes the object
|
34
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
-
def initialize(attributes = {})
|
36
|
-
if (!attributes.is_a?(Hash))
|
37
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::TransactionWebhookAllOf` initialize method"
|
38
|
-
end
|
39
|
-
|
40
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
41
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
42
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
43
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::TransactionWebhookAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
44
|
-
end
|
45
|
-
h[k.to_sym] = v
|
46
|
-
}
|
47
|
-
|
48
|
-
if attributes.key?(:'object')
|
49
|
-
self.object = attributes[:'object']
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
54
|
-
# @return Array for valid properties with the reasons
|
55
|
-
def list_invalid_properties
|
56
|
-
invalid_properties = Array.new
|
57
|
-
invalid_properties
|
58
|
-
end
|
59
|
-
|
60
|
-
# Check to see if the all the properties in the model are valid
|
61
|
-
# @return true if the model is valid
|
62
|
-
def valid?
|
63
|
-
true
|
64
|
-
end
|
65
|
-
|
66
|
-
# Checks equality by comparing each attribute.
|
67
|
-
# @param [Object] Object to be compared
|
68
|
-
def ==(o)
|
69
|
-
return true if self.equal?(o)
|
70
|
-
self.class == o.class &&
|
71
|
-
object == o.object
|
72
|
-
end
|
73
|
-
|
74
|
-
# @see the `==` method
|
75
|
-
# @param [Object] Object to be compared
|
76
|
-
def eql?(o)
|
77
|
-
self == o
|
78
|
-
end
|
79
|
-
|
80
|
-
# Calculates hash code according to all attributes.
|
81
|
-
# @return [Integer] Hash code
|
82
|
-
def hash
|
83
|
-
[object].hash
|
84
|
-
end
|
85
|
-
|
86
|
-
require 'active_support/core_ext/hash'
|
87
|
-
require 'active_support/hash_with_indifferent_access.rb'
|
88
|
-
# Builds the object from hash
|
89
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
-
# @return [Object] Returns the model itself
|
91
|
-
def build_from_hash(attributes)
|
92
|
-
return nil unless attributes.is_a?(Hash)
|
93
|
-
self.class.openapi_types.each_pair do |key, type|
|
94
|
-
if type =~ /\AArray<(.*)>/i
|
95
|
-
# check to ensure the input is an array given that the the attribute
|
96
|
-
# is documented as an array but the input is not
|
97
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
-
end
|
100
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
-
end
|
104
|
-
|
105
|
-
self
|
106
|
-
end
|
107
|
-
|
108
|
-
# Deserializes the data based on type
|
109
|
-
# @param string type Data type
|
110
|
-
# @param string value Value to be deserialized
|
111
|
-
# @return [Object] Deserialized data
|
112
|
-
def _deserialize(type, value)
|
113
|
-
case type.to_sym
|
114
|
-
when :DateTime
|
115
|
-
DateTime.parse(value)
|
116
|
-
when :Date
|
117
|
-
Date.parse(value)
|
118
|
-
when :String
|
119
|
-
value.to_s
|
120
|
-
when :Integer
|
121
|
-
value.to_i
|
122
|
-
when :Float
|
123
|
-
value.to_f
|
124
|
-
when :Boolean
|
125
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
-
true
|
127
|
-
else
|
128
|
-
false
|
129
|
-
end
|
130
|
-
when :Object
|
131
|
-
# generic object (usually a Hash), return directly
|
132
|
-
value
|
133
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
-
inner_type = Regexp.last_match[:inner_type]
|
135
|
-
value.map { |v| _deserialize(inner_type, v) }
|
136
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
-
k_type = Regexp.last_match[:k_type]
|
138
|
-
v_type = Regexp.last_match[:v_type]
|
139
|
-
{}.tap do |hash|
|
140
|
-
value.each do |k, v|
|
141
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
else # model
|
145
|
-
temp_model = TransferZero.const_get(type).new
|
146
|
-
temp_model.build_from_hash(value)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
# Returns the string representation of the object
|
151
|
-
# @return [String] String presentation of the object
|
152
|
-
def to_s
|
153
|
-
to_hash.to_s
|
154
|
-
end
|
155
|
-
|
156
|
-
# to_body is an alias to to_hash (backward compatibility)
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_body
|
159
|
-
to_hash
|
160
|
-
end
|
161
|
-
|
162
|
-
# Returns the object in the form of hash
|
163
|
-
# @return [Hash] Returns the object in the form of hash
|
164
|
-
def to_hash
|
165
|
-
hash = {}
|
166
|
-
self.class.attribute_map.each_pair do |attr, param|
|
167
|
-
value = self.send(attr)
|
168
|
-
next if value.nil?
|
169
|
-
hash[param] = _to_hash(value)
|
170
|
-
end
|
171
|
-
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
172
|
-
end
|
173
|
-
|
174
|
-
def [](key)
|
175
|
-
to_hash[key]
|
176
|
-
end
|
177
|
-
|
178
|
-
def dig(*args)
|
179
|
-
to_hash.dig(*args)
|
180
|
-
end
|
181
|
-
|
182
|
-
# Outputs non-array value in the form of hash
|
183
|
-
# For object, use to_hash. Otherwise, just return the value
|
184
|
-
# @param [Object] value Any valid value
|
185
|
-
# @return [Hash] Returns the value in the form of hash
|
186
|
-
def _to_hash(value)
|
187
|
-
if value.is_a?(Array)
|
188
|
-
value.compact.map { |v| _to_hash(v) }
|
189
|
-
elsif value.is_a?(Hash)
|
190
|
-
{}.tap do |hash|
|
191
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
192
|
-
end
|
193
|
-
elsif value.respond_to? :to_hash
|
194
|
-
value.to_hash
|
195
|
-
else
|
196
|
-
value
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#TransferZero API
|
3
|
-
|
4
|
-
#Reference documentation for the TransferZero API V1
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.1.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
16
|
-
|
17
|
-
# Unit tests for TransferZero::CurrencyExchangeAllOf
|
18
|
-
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
-
# Please update as you see appropriate
|
20
|
-
describe 'CurrencyExchangeAllOf' do
|
21
|
-
before do
|
22
|
-
# run before each test
|
23
|
-
@instance = TransferZero::CurrencyExchangeAllOf.new
|
24
|
-
end
|
25
|
-
|
26
|
-
after do
|
27
|
-
# run after each test
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'test an instance of CurrencyExchangeAllOf' do
|
31
|
-
it 'should create an instance of CurrencyExchangeAllOf' do
|
32
|
-
expect(@instance).to be_instance_of(TransferZero::CurrencyExchangeAllOf)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
describe 'test attribute "opposites"' do
|
36
|
-
it 'should work' do
|
37
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#TransferZero API
|
3
|
-
|
4
|
-
#Reference documentation for the TransferZero API V1
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.1.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
16
|
-
|
17
|
-
# Unit tests for TransferZero::CurrencyOppositeAllOf
|
18
|
-
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
-
# Please update as you see appropriate
|
20
|
-
describe 'CurrencyOppositeAllOf' do
|
21
|
-
before do
|
22
|
-
# run before each test
|
23
|
-
@instance = TransferZero::CurrencyOppositeAllOf.new
|
24
|
-
end
|
25
|
-
|
26
|
-
after do
|
27
|
-
# run after each test
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'test an instance of CurrencyOppositeAllOf' do
|
31
|
-
it 'should create an instance of CurrencyOppositeAllOf' do
|
32
|
-
expect(@instance).to be_instance_of(TransferZero::CurrencyOppositeAllOf)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
describe 'test attribute "rate"' do
|
36
|
-
it 'should work' do
|
37
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'test attribute "mtm_rate"' do
|
42
|
-
it 'should work' do
|
43
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe 'test attribute "margin"' do
|
48
|
-
it 'should work' do
|
49
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|