transferzero-sdk 1.37.3 → 1.37.5

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.
@@ -0,0 +1,204 @@
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 DlocalBalanceResponse
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' => :'Array<DlocalBalance>'
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::DlocalBalanceResponse` 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::DlocalBalanceResponse`. 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
+ if (value = attributes[:'object']).is_a?(Array)
50
+ self.object = value
51
+ end
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
+ object == o.object
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
+ [object].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
@@ -123,6 +123,21 @@ class PayoutMethodTransferReasonEnum
123
123
  OTHER_BUSINESS_SERVICES = "other_business_services".freeze
124
124
  INSTITUTIONAL_INVESTOR_DISINVESTMENT = "institutional_investor_disinvestment".freeze
125
125
  GOVERNMENT_SERVICES = "government_services".freeze
126
+ OWN_ACCOUNT = "own_account".freeze
127
+ DONATIONS_GIFTS = "donations_gifts".freeze
128
+ FAMILY_SUPPORT = "family_support".freeze
129
+ MORTGAGE_REPAYMENT = "mortgage_repayment".freeze
130
+ BUSINESS_TRAVEL = "business_travel".freeze
131
+ PERSONAL_TRAVEL = "personal_travel".freeze
132
+ MANAGEMENT_CONSULTING = "management_consulting".freeze
133
+ ADVERTISING_MARKET_RESEARCH = "advertising_market_research".freeze
134
+ CULTURAL_RECREATIONAL = "cultural_recreational".freeze
135
+ SALARY_RESIDENT_ABROAD = "salary_resident_abroad".freeze
136
+ SALARY_NON_RESIDENT_IN_SA = "salary_non_resident_in_sa".freeze
137
+ SALARY_FOREIGN_CONTRACT_IN_SA = "salary_foreign_contract_in_sa".freeze
138
+ COMMISSION_BROKERAGE = "commission_brokerage".freeze
139
+ INVESTMENT_INCOME = "investment_income".freeze
140
+ ARCHITECTURAL_ENGINEERING = "architectural_engineering".freeze
126
141
 
127
142
  # Builds the enum from string
128
143
  # @param [String] The enum value in the form of the string
@@ -82,6 +82,9 @@ class Recipient
82
82
  # The fields that have some problems and don't pass validation
83
83
  attr_accessor :errors
84
84
 
85
+ # The ID of the mandate that is related to this recipient. This field is present when a ZAR bank mandate signing is required or has been completed.
86
+ attr_accessor :mandate_id
87
+
85
88
  class EnumAttributeValidator
86
89
  attr_reader :datatype
87
90
  attr_reader :allowable_values
@@ -130,7 +133,8 @@ class Recipient
130
133
  :'output_currency' => :'output_currency',
131
134
  :'id' => :'id',
132
135
  :'type' => :'type',
133
- :'errors' => :'errors'
136
+ :'errors' => :'errors',
137
+ :'mandate_id' => :'mandate_id'
134
138
  }
135
139
  end
136
140
 
@@ -160,7 +164,8 @@ class Recipient
160
164
  :'output_currency' => :'String',
161
165
  :'id' => :'String',
162
166
  :'type' => :'String',
163
- :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
167
+ :'errors' => :'Hash<String, Array<ValidationErrorDescription>>',
168
+ :'mandate_id' => :'String'
164
169
  }
165
170
  end
166
171
 
@@ -276,6 +281,10 @@ class Recipient
276
281
  self.errors = value
277
282
  end
278
283
  end
284
+
285
+ if attributes.key?(:'mandate_id')
286
+ self.mandate_id = attributes[:'mandate_id']
287
+ end
279
288
  end
280
289
 
281
290
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -346,7 +355,8 @@ class Recipient
346
355
  output_currency == o.output_currency &&
347
356
  id == o.id &&
348
357
  type == o.type &&
349
- errors == o.errors
358
+ errors == o.errors &&
359
+ mandate_id == o.mandate_id
350
360
  end
351
361
 
352
362
  # @see the `==` method
@@ -358,7 +368,7 @@ class Recipient
358
368
  # Calculates hash code according to all attributes.
359
369
  # @return [Integer] Hash code
360
370
  def hash
361
- [requested_amount, requested_currency, payout_method, metadata, created_at, editable, retriable, input_usd_amount, may_cancel, state_reason, state_reason_details, state, transaction_id, transaction_external_id, transaction_state, exchange_rate, fee_fractional, input_amount, input_currency, output_amount, output_currency, id, type, errors].hash
371
+ [requested_amount, requested_currency, payout_method, metadata, created_at, editable, retriable, input_usd_amount, may_cancel, state_reason, state_reason_details, state, transaction_id, transaction_external_id, transaction_state, exchange_rate, fee_fractional, input_amount, input_currency, output_amount, output_currency, id, type, errors, mandate_id].hash
362
372
  end
363
373
 
364
374
  require 'active_support/core_ext/hash'
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.0.0-beta3
11
11
  =end
12
12
 
13
13
  module TransferZero
14
- VERSION = '1.37.3'
14
+ VERSION = '1.37.5'
15
15
  end
@@ -38,6 +38,8 @@ require 'transferzero-sdk/models/debit_list_request'
38
38
  require 'transferzero-sdk/models/debit_list_response'
39
39
  require 'transferzero-sdk/models/debit_request'
40
40
  require 'transferzero-sdk/models/debit_request_wrapper'
41
+ require 'transferzero-sdk/models/dlocal_balance'
42
+ require 'transferzero-sdk/models/dlocal_balance_response'
41
43
  require 'transferzero-sdk/models/document'
42
44
  require 'transferzero-sdk/models/document_list_response'
43
45
  require 'transferzero-sdk/models/document_request'
@@ -153,6 +155,7 @@ require 'transferzero-sdk/api/account_debits_api'
153
155
  require 'transferzero-sdk/api/account_validation_api'
154
156
  require 'transferzero-sdk/api/accounts_api'
155
157
  require 'transferzero-sdk/api/currency_info_api'
158
+ require 'transferzero-sdk/api/dlocal_balance_api'
156
159
  require 'transferzero-sdk/api/documents_api'
157
160
  require 'transferzero-sdk/api/logs_api'
158
161
  require 'transferzero-sdk/api/payin_methods_api'
@@ -0,0 +1,46 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for TransferZero::DlocalBalanceApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'DlocalBalanceApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = TransferZero::DlocalBalanceApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of DlocalBalanceApi' do
30
+ it 'should create an instance of DlocalBalanceApi' do
31
+ expect(@api_instance).to be_instance_of(TransferZero::DlocalBalanceApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_balance
36
+ # Get dlocal balances
37
+ # This endpoint retrieves dlocal account balances
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [DlocalBalanceResponse]
40
+ describe 'get_balance test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ end
@@ -0,0 +1,41 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for TransferZero::DlocalBalanceResponse
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'DlocalBalanceResponse' do
21
+ before do
22
+ # run before each test
23
+ @instance = TransferZero::DlocalBalanceResponse.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DlocalBalanceResponse' do
31
+ it 'should create an instance of DlocalBalanceResponse' do
32
+ expect(@instance).to be_instance_of(TransferZero::DlocalBalanceResponse)
33
+ end
34
+ end
35
+ describe 'test attribute "object"' 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
@@ -0,0 +1,59 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for TransferZero::DlocalBalance
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'DlocalBalance' do
21
+ before do
22
+ # run before each test
23
+ @instance = TransferZero::DlocalBalance.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DlocalBalance' do
31
+ it 'should create an instance of DlocalBalance' do
32
+ expect(@instance).to be_instance_of(TransferZero::DlocalBalance)
33
+ end
34
+ end
35
+ describe 'test attribute "currency"' 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 "available_balance"' 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 "previous_day_closing_balance"' 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
+ describe 'test attribute "current_balance_date"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ end