transferzero-sdk 1.37.6 → 1.37.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e00d6dbf0674d41081f8f7e3e980e1f9245ae246b3cf0aeec9ed5c3590e3b79
4
- data.tar.gz: 42a2a021c4ebeb796eeb0bc558930792fea07072e927661d3da6f8975196db43
3
+ metadata.gz: 6da945181c803c526929be5ba8cb46489c65282f6ac3bd00d45ad1672104b07b
4
+ data.tar.gz: f2d4060b0cb95f5a95a63b8804bd6806ba3f5de439d67efb1323d5e41ca07f62
5
5
  SHA512:
6
- metadata.gz: 4cb98b73c7883f8cb3a63bdce3ffed988f9b12f0f22cf0d8f2d947f61ef156735010c7780efbed39272374fa1eeb00ac6e48cd1911ce9b9b690fc5ef8aadacd4
7
- data.tar.gz: c9e94f681e474e1bf2d736e3cacfb773765361ce3d250d5e09ff68342ff36831c33589edcde9439ff32502c755b0ff1fca0100a311915d2f49c1ac1f846f7ec4
6
+ metadata.gz: fe9d981fd680dfb26d0ba335858c7f08ed28d0363dc54f76304d357da20ed2d8121432b58dfba98fe054b069ab9c5aae192fc8406a11c6e8cd48cd1aaeb7eb35
7
+ data.tar.gz: f0827b0fe10394b37bfc7be2bb1db8adb572d5489c78691c120021674b8172ef8845868c3b2f67b2383fe35289cbf1b69ccf206227d2546478820f47ec94a1bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transferzero-sdk (1.37.6)
4
+ transferzero-sdk (1.37.7)
5
5
  activesupport (>= 4)
6
6
  faraday (~> 1.0, >= 1.0.1)
7
7
  json (>= 1.4)
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.37.6
10
+ - Package version: 1.37.7
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.37.6.gem
34
+ gem install ./transferzero-sdk-1.37.7.gem
35
35
  ```
36
- (for development, run `gem install --dev ./transferzero-sdk-1.37.6.gem` to install the development dependencies)
36
+ (for development, run `gem install --dev ./transferzero-sdk-1.37.7.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.37.6'
42
+ gem 'transferzero-sdk', '~> 1.37.7'
43
43
 
44
44
  ### Install from Git
45
45
 
@@ -119,6 +119,7 @@ Class | Method | HTTP request | Description
119
119
  *TransferZero::DocumentsApi* | [**post_documents**](docs/DocumentsApi.md#post_documents) | **POST** /documents | Creating a document
120
120
  *TransferZero::LogsApi* | [**get_webhook_log**](docs/LogsApi.md#get_webhook_log) | **GET** /logs/{Webhook Log ID} | Fetch an individual webhook log
121
121
  *TransferZero::LogsApi* | [**get_webhook_logs**](docs/LogsApi.md#get_webhook_logs) | **GET** /logs/webhooks | Fetch a list of webhook logs
122
+ *TransferZero::MandatesApi* | [**get_mandate**](docs/MandatesApi.md#get_mandate) | **GET** /mandates/{Mandate ID} | Fetch a single mandate
122
123
  *TransferZero::PayinMethodsApi* | [**delete_payin_method**](docs/PayinMethodsApi.md#delete_payin_method) | **DELETE** /payin_methods/{PayinMethod ID} | Deleting a payin method
123
124
  *TransferZero::PayinMethodsApi* | [**get_payin_method**](docs/PayinMethodsApi.md#get_payin_method) | **GET** /payin_methods/{PayinMethod ID} | Fetching a payin method
124
125
  *TransferZero::PayinMethodsApi* | [**patch_payin_method**](docs/PayinMethodsApi.md#patch_payin_method) | **PATCH** /payin_methods/{PayinMethod ID} | Updating a payin method
@@ -188,6 +189,8 @@ Class | Method | HTTP request | Description
188
189
  - [TransferZero::FieldDescription](docs/FieldDescription.md)
189
190
  - [TransferZero::FieldSelectValidation](docs/FieldSelectValidation.md)
190
191
  - [TransferZero::FieldValidation](docs/FieldValidation.md)
192
+ - [TransferZero::Mandate](docs/Mandate.md)
193
+ - [TransferZero::MandateResponse](docs/MandateResponse.md)
191
194
  - [TransferZero::Pagination](docs/Pagination.md)
192
195
  - [TransferZero::PaginationMeta](docs/PaginationMeta.md)
193
196
  - [TransferZero::PayinMethod](docs/PayinMethod.md)
data/docs/Mandate.md ADDED
@@ -0,0 +1,29 @@
1
+ # TransferZero::Mandate
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | ID of the mandate | [optional]
8
+ **status** | **String** | Current state of the mandate. - `pending` — created, awaiting signing flow - `notified` — recipient has been notified to sign - `signed` — recipient signed; mandate is active - `failed` — signing flow failed (e.g. AVS/CDV rejection) - `bypassed` — administratively bypassed for an inward AZA payment | [optional]
9
+ **type_id** | **Integer** | Numeric beneficiary type identifier. Identifies whether the mandate was issued for a natural person, sole proprietor, partnership, company, etc. | [optional]
10
+ **reference** | **String** | Human-readable reference assigned to the mandate at creation. | [optional]
11
+ **signed_at** | **DateTime** | Timestamp when the mandate transitioned to `signed`. `null` for mandates that are pending, notified, failed, or bypassed. | [optional]
12
+ **created_at** | **DateTime** | Timestamp when the mandate was created. | [optional]
13
+ **updated_at** | **DateTime** | Timestamp when the mandate was last updated. | [optional]
14
+
15
+ ## Code Sample
16
+
17
+ ```ruby
18
+ require 'TransferZero'
19
+
20
+ instance = TransferZero::Mandate.new(id: bf9ff782-e182-45ac-abea-5bce83ad6670,
21
+ status: signed,
22
+ type_id: 1,
23
+ reference: 74a07630,
24
+ signed_at: null,
25
+ created_at: null,
26
+ updated_at: null)
27
+ ```
28
+
29
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::MandateResponse
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object** | [**Mandate**](Mandate.md) | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::MandateResponse.new(object: null)
15
+ ```
16
+
17
+
@@ -0,0 +1,70 @@
1
+ # TransferZero::MandatesApi
2
+
3
+ All URIs are relative to *https://api-sandbox.transferzero.com/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_mandate**](MandatesApi.md#get_mandate) | **GET** /mandates/{Mandate ID} | Fetch a single mandate
8
+
9
+
10
+ # **get_mandate**
11
+ > MandateResponse get_mandate(mandate_id)
12
+
13
+ Fetch a single mandate
14
+
15
+ Finds and returns a Mandate created within the current calendar year, where the mandate is linked to a Recipient owned by the authenticated API key. Returns 404 if the mandate is not owned by the API key or was not issued in the current calendar year — mandates are only valid for the year in which they were issued.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'transferzero-sdk'
21
+
22
+ api_instance = TransferZero::MandatesApi.new
23
+
24
+
25
+ begin
26
+ #Fetch a single mandate
27
+ result = api_instance.get_mandate(mandate_id)
28
+ p result
29
+ rescue TransferZero::ApiError => e
30
+ if e.validation_error
31
+ puts "WARN: Validation error occured when calling the endpoint"
32
+ result = e.response_object("MandateResponse")
33
+ p result
34
+ else
35
+ puts "Exception when calling MandatesApi->get_mandate: #{e}"
36
+ end
37
+ end
38
+ ```
39
+
40
+ ### Parameters
41
+
42
+ Name | Type | Description | Notes
43
+ ------------- | ------------- | ------------- | -------------
44
+ **mandate_id** | [**String**](.md)| ID of the mandate. Example: `/v1/mandates/bf9ff782-e182-45ac-abea-5bce83ad6670` |
45
+
46
+ ### Return type
47
+
48
+ [**MandateResponse**](MandateResponse.md)
49
+
50
+ ### Authorization
51
+
52
+ You can set the API Key and Secret on the TransferZero object when setting it up:
53
+
54
+ ```ruby
55
+
56
+ TransferZero.configure do |config|
57
+ config.api_key = '<key'
58
+ config.api_secret = '<secret>'
59
+ config.host = 'https://api-sandbox.transferzero.com/v1'
60
+ end
61
+
62
+ ```
63
+
64
+ ### HTTP request headers
65
+
66
+ - **Content-Type**: Not defined
67
+ - **Accept**: application/json
68
+
69
+
70
+
@@ -0,0 +1,77 @@
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 'uri'
14
+
15
+ module TransferZero
16
+ class MandatesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+
24
+ # Fetch a single mandate
25
+ # Finds and returns a Mandate created within the current calendar year, where the mandate is linked to a Recipient owned by the authenticated API key. Returns 404 if the mandate is not owned by the API key or was not issued in the current calendar year — mandates are only valid for the year in which they were issued.
26
+ # @param mandate_id ID of the mandate. Example: &#x60;/v1/mandates/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [MandateResponse]
29
+ def get_mandate(mandate_id, opts = {})
30
+ data, _status_code, _headers = get_mandate_with_http_info(mandate_id, opts)
31
+ data
32
+ end
33
+
34
+ # Fetch a single mandate
35
+ # Finds and returns a Mandate created within the current calendar year, where the mandate is linked to a Recipient owned by the authenticated API key. Returns 404 if the mandate is not owned by the API key or was not issued in the current calendar year — mandates are only valid for the year in which they were issued.
36
+ # @param mandate_id ID of the mandate. Example: &#x60;/v1/mandates/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(MandateResponse, Fixnum, Hash)>] MandateResponse data, response status code and response headers
39
+ def get_mandate_with_http_info(mandate_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: MandatesApi.get_mandate ...'
42
+ end
43
+ # verify the required parameter 'mandate_id' is set
44
+ if @api_client.config.client_side_validation && mandate_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'mandate_id' when calling MandatesApi.get_mandate"
46
+ end
47
+ # resource path
48
+ local_var_path = '/mandates/{Mandate ID}'.sub('{' + 'Mandate ID' + '}', mandate_id.to_s)
49
+
50
+ # query parameters
51
+ query_params = {}
52
+
53
+ # header parameters
54
+ header_params = {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = nil
63
+ auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
64
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => 'MandateResponse')
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: MandatesApi#get_mandate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
76
+ end
77
+ end
@@ -36,7 +36,7 @@ module TransferZero
36
36
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
37
37
  def initialize(config = Configuration.default)
38
38
  @config = config
39
- @user_agent = "TransferZero-SDK/Ruby/1.37.6"
39
+ @user_agent = "TransferZero-SDK/Ruby/1.37.7"
40
40
  @default_headers = {
41
41
  'Content-Type' => 'application/json',
42
42
  'User-Agent' => @user_agent
@@ -0,0 +1,298 @@
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
+ # A Mandate authorises payouts to a Recipient. Mandates are issued per calendar year and must be in a `signed` (or `bypassed`) state before the linked Recipient can receive a payout.
17
+ class Mandate
18
+ # ID of the mandate
19
+ attr_accessor :id
20
+
21
+ # Current state of the mandate. - `pending` — created, awaiting signing flow - `notified` — recipient has been notified to sign - `signed` — recipient signed; mandate is active - `failed` — signing flow failed (e.g. AVS/CDV rejection) - `bypassed` — administratively bypassed for an inward AZA payment
22
+ attr_accessor :status
23
+
24
+ # Numeric beneficiary type identifier. Identifies whether the mandate was issued for a natural person, sole proprietor, partnership, company, etc.
25
+ attr_accessor :type_id
26
+
27
+ # Human-readable reference assigned to the mandate at creation.
28
+ attr_accessor :reference
29
+
30
+ # Timestamp when the mandate transitioned to `signed`. `null` for mandates that are pending, notified, failed, or bypassed.
31
+ attr_accessor :signed_at
32
+
33
+ # Timestamp when the mandate was created.
34
+ attr_accessor :created_at
35
+
36
+ # Timestamp when the mandate was last updated.
37
+ attr_accessor :updated_at
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'id' => :'id',
65
+ :'status' => :'status',
66
+ :'type_id' => :'type_id',
67
+ :'reference' => :'reference',
68
+ :'signed_at' => :'signed_at',
69
+ :'created_at' => :'created_at',
70
+ :'updated_at' => :'updated_at'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'id' => :'String',
78
+ :'status' => :'String',
79
+ :'type_id' => :'Integer',
80
+ :'reference' => :'String',
81
+ :'signed_at' => :'DateTime',
82
+ :'created_at' => :'DateTime',
83
+ :'updated_at' => :'DateTime'
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Mandate` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Mandate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ end
105
+
106
+ if attributes.key?(:'status')
107
+ self.status = attributes[:'status']
108
+ end
109
+
110
+ if attributes.key?(:'type_id')
111
+ self.type_id = attributes[:'type_id']
112
+ end
113
+
114
+ if attributes.key?(:'reference')
115
+ self.reference = attributes[:'reference']
116
+ end
117
+
118
+ if attributes.key?(:'signed_at')
119
+ self.signed_at = attributes[:'signed_at']
120
+ end
121
+
122
+ if attributes.key?(:'created_at')
123
+ self.created_at = attributes[:'created_at']
124
+ end
125
+
126
+ if attributes.key?(:'updated_at')
127
+ self.updated_at = attributes[:'updated_at']
128
+ end
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properties with the reasons
133
+ def list_invalid_properties
134
+ invalid_properties = Array.new
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ status_validator = EnumAttributeValidator.new('String', ["pending", "notified", "signed", "failed", "bypassed"])
142
+ return false unless status_validator.valid?(@status)
143
+ true
144
+ end
145
+
146
+ # Custom attribute writer method checking allowed values (enum).
147
+ # @param [Object] status Object to be assigned
148
+ def status=(status)
149
+ validator = EnumAttributeValidator.new('String', ["pending", "notified", "signed", "failed", "bypassed"])
150
+ unless validator.valid?(status) || status.empty?
151
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
152
+ end
153
+ @status = status
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ id == o.id &&
162
+ status == o.status &&
163
+ type_id == o.type_id &&
164
+ reference == o.reference &&
165
+ signed_at == o.signed_at &&
166
+ created_at == o.created_at &&
167
+ updated_at == o.updated_at
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [id, status, type_id, reference, signed_at, created_at, updated_at].hash
180
+ end
181
+
182
+ require 'active_support/core_ext/hash'
183
+ require 'active_support/hash_with_indifferent_access.rb'
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.openapi_types.each_pair do |key, type|
190
+ if type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
194
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
195
+ end
196
+ elsif !attributes[self.class.attribute_map[key]].nil?
197
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
198
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
199
+ end
200
+
201
+ self
202
+ end
203
+
204
+ # Deserializes the data based on type
205
+ # @param string type Data type
206
+ # @param string value Value to be deserialized
207
+ # @return [Object] Deserialized data
208
+ def _deserialize(type, value)
209
+ case type.to_sym
210
+ when :DateTime
211
+ DateTime.parse(value)
212
+ when :Date
213
+ Date.parse(value)
214
+ when :String
215
+ value.to_s
216
+ when :Integer
217
+ value.to_i
218
+ when :Float
219
+ value.to_f
220
+ when :Boolean
221
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
+ true
223
+ else
224
+ false
225
+ end
226
+ when :Object
227
+ # generic object (usually a Hash), return directly
228
+ value
229
+ when /\AArray<(?<inner_type>.+)>\z/
230
+ inner_type = Regexp.last_match[:inner_type]
231
+ value.map { |v| _deserialize(inner_type, v) }
232
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
+ k_type = Regexp.last_match[:k_type]
234
+ v_type = Regexp.last_match[:v_type]
235
+ {}.tap do |hash|
236
+ value.each do |k, v|
237
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
+ end
239
+ end
240
+ else # model
241
+ temp_model = TransferZero.const_get(type).new
242
+ temp_model.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ next if value.nil?
265
+ hash[param] = _to_hash(value)
266
+ end
267
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
268
+ end
269
+
270
+ def [](key)
271
+ to_hash[key]
272
+ end
273
+
274
+ def dig(*args)
275
+ to_hash.dig(*args)
276
+ end
277
+
278
+ # Outputs non-array value in the form of hash
279
+ # For object, use to_hash. Otherwise, just return the value
280
+ # @param [Object] value Any valid value
281
+ # @return [Hash] Returns the value in the form of hash
282
+ def _to_hash(value)
283
+ if value.is_a?(Array)
284
+ value.compact.map { |v| _to_hash(v) }
285
+ elsif value.is_a?(Hash)
286
+ {}.tap do |hash|
287
+ value.each { |k, v| hash[k] = _to_hash(v) }
288
+ end
289
+ elsif value.respond_to? :to_hash
290
+ value.to_hash
291
+ else
292
+ value
293
+ end
294
+ end
295
+
296
+ end
297
+
298
+ end
@@ -0,0 +1,202 @@
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 MandateResponse
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' => :'Mandate'
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::MandateResponse` 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::MandateResponse`. 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
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.0.0-beta3
11
11
  =end
12
12
 
13
13
  module TransferZero
14
- VERSION = '1.37.6'
14
+ VERSION = '1.37.7'
15
15
  end
@@ -49,6 +49,8 @@ require 'transferzero-sdk/models/error_status'
49
49
  require 'transferzero-sdk/models/field_description'
50
50
  require 'transferzero-sdk/models/field_select_validation'
51
51
  require 'transferzero-sdk/models/field_validation'
52
+ require 'transferzero-sdk/models/mandate'
53
+ require 'transferzero-sdk/models/mandate_response'
52
54
  require 'transferzero-sdk/models/pagination'
53
55
  require 'transferzero-sdk/models/pagination_meta'
54
56
  require 'transferzero-sdk/models/payin_method'
@@ -158,6 +160,7 @@ require 'transferzero-sdk/api/currency_info_api'
158
160
  require 'transferzero-sdk/api/dlocal_balance_api'
159
161
  require 'transferzero-sdk/api/documents_api'
160
162
  require 'transferzero-sdk/api/logs_api'
163
+ require 'transferzero-sdk/api/mandates_api'
161
164
  require 'transferzero-sdk/api/payin_methods_api'
162
165
  require 'transferzero-sdk/api/payment_methods_api'
163
166
  require 'transferzero-sdk/api/payout_methods_api'
@@ -0,0 +1,47 @@
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::MandatesApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'MandatesApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = TransferZero::MandatesApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of MandatesApi' do
30
+ it 'should create an instance of MandatesApi' do
31
+ expect(@api_instance).to be_instance_of(TransferZero::MandatesApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_mandate
36
+ # Fetch a single mandate
37
+ # Finds and returns a Mandate created within the current calendar year, where the mandate is linked to a Recipient owned by the authenticated API key. Returns 404 if the mandate is not owned by the API key or was not issued in the current calendar year — mandates are only valid for the year in which they were issued.
38
+ # @param mandate_id ID of the mandate. Example: &#x60;/v1/mandates/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [MandateResponse]
41
+ describe 'get_mandate test' 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
+ 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::MandateResponse
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'MandateResponse' do
21
+ before do
22
+ # run before each test
23
+ @instance = TransferZero::MandateResponse.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of MandateResponse' do
31
+ it 'should create an instance of MandateResponse' do
32
+ expect(@instance).to be_instance_of(TransferZero::MandateResponse)
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,81 @@
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::Mandate
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'Mandate' do
21
+ before do
22
+ # run before each test
23
+ @instance = TransferZero::Mandate.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of Mandate' do
31
+ it 'should create an instance of Mandate' do
32
+ expect(@instance).to be_instance_of(TransferZero::Mandate)
33
+ end
34
+ end
35
+ describe 'test attribute "id"' 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 "status"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["pending", "notified", "signed", "failed", "bypassed"])
45
+ # validator.allowable_values.each do |value|
46
+ # expect { @instance.status = value }.not_to raise_error
47
+ # end
48
+ end
49
+ end
50
+
51
+ describe 'test attribute "type_id"' do
52
+ it 'should work' do
53
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
+ end
55
+ end
56
+
57
+ describe 'test attribute "reference"' do
58
+ it 'should work' do
59
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
+ end
61
+ end
62
+
63
+ describe 'test attribute "signed_at"' do
64
+ it 'should work' do
65
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
66
+ end
67
+ end
68
+
69
+ describe 'test attribute "created_at"' do
70
+ it 'should work' do
71
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
+ end
73
+ end
74
+
75
+ describe 'test attribute "updated_at"' do
76
+ it 'should work' do
77
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
78
+ end
79
+ end
80
+
81
+ 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.37.6
4
+ version: 1.37.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - TransferZero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-11 00:00:00.000000000 Z
11
+ date: 2026-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -134,6 +134,9 @@ files:
134
134
  - docs/FieldSelectValidation.md
135
135
  - docs/FieldValidation.md
136
136
  - docs/LogsApi.md
137
+ - docs/Mandate.md
138
+ - docs/MandateResponse.md
139
+ - docs/MandatesApi.md
137
140
  - docs/Pagination.md
138
141
  - docs/PaginationMeta.md
139
142
  - docs/PayinMethod.md
@@ -258,6 +261,7 @@ files:
258
261
  - lib/transferzero-sdk/api/dlocal_balance_api.rb
259
262
  - lib/transferzero-sdk/api/documents_api.rb
260
263
  - lib/transferzero-sdk/api/logs_api.rb
264
+ - lib/transferzero-sdk/api/mandates_api.rb
261
265
  - lib/transferzero-sdk/api/payin_methods_api.rb
262
266
  - lib/transferzero-sdk/api/payment_methods_api.rb
263
267
  - lib/transferzero-sdk/api/payout_methods_api.rb
@@ -304,6 +308,8 @@ files:
304
308
  - lib/transferzero-sdk/models/field_description.rb
305
309
  - lib/transferzero-sdk/models/field_select_validation.rb
306
310
  - lib/transferzero-sdk/models/field_validation.rb
311
+ - lib/transferzero-sdk/models/mandate.rb
312
+ - lib/transferzero-sdk/models/mandate_response.rb
307
313
  - lib/transferzero-sdk/models/pagination.rb
308
314
  - lib/transferzero-sdk/models/pagination_meta.rb
309
315
  - lib/transferzero-sdk/models/payin_method.rb
@@ -419,6 +425,7 @@ files:
419
425
  - spec/api/dlocal_balance_api_spec.rb
420
426
  - spec/api/documents_api_spec.rb
421
427
  - spec/api/logs_api_spec.rb
428
+ - spec/api/mandates_api_spec.rb
422
429
  - spec/api/payin_methods_api_spec.rb
423
430
  - spec/api/payment_methods_api_spec.rb
424
431
  - spec/api/payout_methods_api_spec.rb
@@ -463,6 +470,8 @@ files:
463
470
  - spec/models/field_description_spec.rb
464
471
  - spec/models/field_select_validation_spec.rb
465
472
  - spec/models/field_validation_spec.rb
473
+ - spec/models/mandate_response_spec.rb
474
+ - spec/models/mandate_spec.rb
466
475
  - spec/models/pagination_meta_spec.rb
467
476
  - spec/models/pagination_spec.rb
468
477
  - spec/models/payin_method_details_btc_spec.rb
@@ -603,6 +612,7 @@ test_files:
603
612
  - spec/api/dlocal_balance_api_spec.rb
604
613
  - spec/api/payment_methods_api_spec.rb
605
614
  - spec/api/transactions_api_spec.rb
615
+ - spec/api/mandates_api_spec.rb
606
616
  - spec/api/recipients_api_spec.rb
607
617
  - spec/api/logs_api_spec.rb
608
618
  - spec/api/documents_api_spec.rb
@@ -635,6 +645,7 @@ test_files:
635
645
  - spec/models/sender_request_spec.rb
636
646
  - spec/models/sender_webhook_spec.rb
637
647
  - spec/models/webhook_log_metadata_request_spec.rb
648
+ - spec/models/mandate_spec.rb
638
649
  - spec/models/currency_exchange_list_response_spec.rb
639
650
  - spec/models/field_validation_spec.rb
640
651
  - spec/models/account_response_spec.rb
@@ -656,6 +667,7 @@ test_files:
656
667
  - spec/models/transaction_response_existing_spec.rb
657
668
  - spec/models/recipient_state_reason_details_spec.rb
658
669
  - spec/models/currency_opposite_all_of_spec.rb
670
+ - spec/models/mandate_response_spec.rb
659
671
  - spec/models/proof_of_payment_spec.rb
660
672
  - spec/models/payin_method_state_spec.rb
661
673
  - spec/models/payout_method_details_iban_spec.rb