moov_ruby 26.4.0.pre.dev.10 → 26.4.0.pre.dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moov/client.rb +2 -1
  3. data/lib/moov/models/components/createresolutionlink.rb +32 -0
  4. data/lib/moov/models/components/createresolutionlink.rbi +13 -0
  5. data/lib/moov/models/components/resolutionlink.rb +64 -0
  6. data/lib/moov/models/components/resolutionlink.rbi +29 -0
  7. data/lib/moov/models/components/resolutionlinkrecipient.rb +36 -0
  8. data/lib/moov/models/components/resolutionlinkrecipient.rbi +15 -0
  9. data/lib/moov/models/components.rb +3 -0
  10. data/lib/moov/models/errors/createresolutionlinkerror.rb +40 -0
  11. data/lib/moov/models/errors/createresolutionlinkerror.rbi +17 -0
  12. data/lib/moov/models/errors.rb +1 -0
  13. data/lib/moov/models/operations/createresolutionlink_request.rb +49 -0
  14. data/lib/moov/models/operations/createresolutionlink_request.rbi +17 -0
  15. data/lib/moov/models/operations/createresolutionlink_response.rb +48 -0
  16. data/lib/moov/models/operations/createresolutionlink_response.rbi +21 -0
  17. data/lib/moov/models/operations/disableresolutionlink_request.rb +49 -0
  18. data/lib/moov/models/operations/disableresolutionlink_request.rbi +17 -0
  19. data/lib/moov/models/operations/disableresolutionlink_response.rb +44 -0
  20. data/lib/moov/models/operations/disableresolutionlink_response.rbi +19 -0
  21. data/lib/moov/models/operations/getresolutionlink_request.rb +49 -0
  22. data/lib/moov/models/operations/getresolutionlink_request.rbi +17 -0
  23. data/lib/moov/models/operations/getresolutionlink_response.rb +48 -0
  24. data/lib/moov/models/operations/getresolutionlink_response.rbi +21 -0
  25. data/lib/moov/models/operations/listresolutionlinks_request.rb +45 -0
  26. data/lib/moov/models/operations/listresolutionlinks_request.rbi +15 -0
  27. data/lib/moov/models/operations/listresolutionlinks_response.rb +48 -0
  28. data/lib/moov/models/operations/listresolutionlinks_response.rbi +21 -0
  29. data/lib/moov/models/operations.rb +8 -0
  30. data/lib/moov/resolution_links.rb +592 -0
  31. data/lib/moov/sdk_hooks/moov_version.rb +6 -7
  32. data/lib/moov/sdk_hooks/registration.rb +1 -1
  33. data/lib/moov/sdkconfiguration.rb +3 -3
  34. data/lib/moov_ruby.rb +1 -0
  35. metadata +27 -2
@@ -0,0 +1,592 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ require 'faraday'
7
+ require 'faraday/multipart'
8
+ require 'faraday/retry'
9
+ require 'sorbet-runtime'
10
+ require_relative 'sdk_hooks/hooks'
11
+ require_relative 'utils/retries'
12
+
13
+ module Moov
14
+ extend T::Sig
15
+ class ResolutionLinks
16
+ extend T::Sig
17
+
18
+
19
+
20
+ sig { params(sdk_config: SDKConfiguration).void }
21
+ def initialize(sdk_config)
22
+ @sdk_configuration = sdk_config
23
+
24
+ end
25
+
26
+ sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) }
27
+ def get_url(base_url:, url_variables: nil)
28
+ sd_base_url, sd_options = @sdk_configuration.get_server_details
29
+
30
+ if base_url.nil?
31
+ base_url = sd_base_url
32
+ end
33
+
34
+ if url_variables.nil?
35
+ url_variables = sd_options
36
+ end
37
+
38
+ return Utils.template_url base_url, url_variables
39
+ end
40
+
41
+
42
+
43
+
44
+ sig { params(create_resolution_link: Models::Components::CreateResolutionLink, account_id: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::CreateResolutionLinkResponse) }
45
+ def create(create_resolution_link:, account_id:, x_moov_version: nil, timeout_ms: nil, http_headers: nil)
46
+ # create - Create a resolution link for the specified account. Resolution links are temporary, secure links
47
+ # sent to merchants to resolve account requirements such as KYC verification or document uploads. Only one active resolution link
48
+ # is allowed per connected account.
49
+ #
50
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
51
+ # you'll need to specify the `/accounts/{accountID}/profile.write`, `/accounts/{accountID}/representatives.write` and `/accounts/{accountID}/files.write` scopes.
52
+ request = Models::Operations::CreateResolutionLinkRequest.new(
53
+ account_id: account_id,
54
+ create_resolution_link: create_resolution_link,
55
+ x_moov_version: x_moov_version
56
+ )
57
+ url, params = @sdk_configuration.get_server_details
58
+ base_url = Utils.template_url(url, params)
59
+ url = Utils.generate_url(
60
+ Models::Operations::CreateResolutionLinkRequest,
61
+ base_url,
62
+ '/accounts/{accountID}/resolution-links',
63
+ request,
64
+ @sdk_configuration.globals
65
+ )
66
+ headers = Utils.get_headers(request, @sdk_configuration.globals)
67
+ headers = T.cast(headers, T::Hash[String, String])
68
+ req_content_type, data, form = Utils.serialize_request_body(request, false, false, :create_resolution_link, :json)
69
+ headers['content-type'] = req_content_type
70
+ raise StandardError, 'request body is required' if data.nil? && form.nil?
71
+
72
+ if form && !form.empty?
73
+ body = Utils.encode_form(form)
74
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
75
+ body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
76
+ else
77
+ body = data
78
+ end
79
+ headers['Accept'] = 'application/json'
80
+ headers['user-agent'] = @sdk_configuration.user_agent
81
+
82
+ security = @sdk_configuration.security_source&.call
83
+
84
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
85
+ timeout ||= @sdk_configuration.timeout
86
+
87
+
88
+ connection = @sdk_configuration.client
89
+
90
+ hook_ctx = SDKHooks::HookContext.new(
91
+ config: @sdk_configuration,
92
+ base_url: base_url,
93
+ oauth2_scopes: nil,
94
+ operation_id: 'createResolutionLink',
95
+ security_source: @sdk_configuration.security_source
96
+ )
97
+
98
+ error = T.let(nil, T.nilable(StandardError))
99
+ http_response = T.let(nil, T.nilable(Faraday::Response))
100
+
101
+
102
+ begin
103
+ http_response = T.must(connection).post(url) do |req|
104
+ req.body = body
105
+ req.headers.merge!(headers)
106
+ req.options.timeout = timeout unless timeout.nil?
107
+ Utils.configure_request_security(req, security)
108
+ http_headers&.each do |key, value|
109
+ req.headers[key.to_s] = value
110
+ end
111
+
112
+ @sdk_configuration.hooks.before_request(
113
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
114
+ hook_ctx: hook_ctx
115
+ ),
116
+ request: req
117
+ )
118
+ end
119
+ rescue StandardError => e
120
+ error = e
121
+ ensure
122
+ if http_response.nil? || Utils.error_status?(http_response.status)
123
+ http_response = @sdk_configuration.hooks.after_error(
124
+ error: error,
125
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
126
+ hook_ctx: hook_ctx
127
+ ),
128
+ response: http_response
129
+ )
130
+ else
131
+ http_response = @sdk_configuration.hooks.after_success(
132
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
133
+ hook_ctx: hook_ctx
134
+ ),
135
+ response: http_response
136
+ )
137
+ end
138
+
139
+ if http_response.nil?
140
+ raise error if !error.nil?
141
+ raise 'no response'
142
+ end
143
+ end
144
+
145
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
146
+ if Utils.match_status_code(http_response.status, ['200'])
147
+ if Utils.match_content_type(content_type, 'application/json')
148
+ http_response = @sdk_configuration.hooks.after_success(
149
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
150
+ hook_ctx: hook_ctx
151
+ ),
152
+ response: http_response
153
+ )
154
+ response_data = http_response.env.response_body
155
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::ResolutionLink)
156
+ response = Models::Operations::CreateResolutionLinkResponse.new(
157
+ status_code: http_response.status,
158
+ content_type: content_type,
159
+ raw_response: http_response,
160
+ headers: http_response.headers,
161
+ resolution_link: T.unsafe(obj)
162
+ )
163
+
164
+ return response
165
+ else
166
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
167
+ end
168
+ elsif Utils.match_status_code(http_response.status, ['400', '409'])
169
+ if Utils.match_content_type(content_type, 'application/json')
170
+ http_response = @sdk_configuration.hooks.after_success(
171
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
172
+ hook_ctx: hook_ctx
173
+ ),
174
+ response: http_response
175
+ )
176
+ response_data = http_response.env.response_body
177
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
178
+ obj.raw_response = http_response
179
+ raise obj
180
+ else
181
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
182
+ end
183
+ elsif Utils.match_status_code(http_response.status, ['422'])
184
+ if Utils.match_content_type(content_type, 'application/json')
185
+ http_response = @sdk_configuration.hooks.after_success(
186
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
187
+ hook_ctx: hook_ctx
188
+ ),
189
+ response: http_response
190
+ )
191
+ response_data = http_response.env.response_body
192
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::CreateResolutionLinkError)
193
+ obj.raw_response = http_response
194
+ raise obj
195
+ else
196
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
197
+ end
198
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
199
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
200
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
201
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
202
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
203
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
204
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
205
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
206
+ else
207
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
208
+
209
+ end
210
+ end
211
+
212
+
213
+ sig { params(account_id: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::ListResolutionLinksResponse) }
214
+ def list(account_id:, x_moov_version: nil, timeout_ms: nil, http_headers: nil)
215
+ # list - List resolution links for the specified account.
216
+ #
217
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
218
+ # you'll need to specify the `/accounts/{accountID}/profile.read` scope.
219
+ request = Models::Operations::ListResolutionLinksRequest.new(
220
+ account_id: account_id,
221
+ x_moov_version: x_moov_version
222
+ )
223
+ url, params = @sdk_configuration.get_server_details
224
+ base_url = Utils.template_url(url, params)
225
+ url = Utils.generate_url(
226
+ Models::Operations::ListResolutionLinksRequest,
227
+ base_url,
228
+ '/accounts/{accountID}/resolution-links',
229
+ request,
230
+ @sdk_configuration.globals
231
+ )
232
+ headers = Utils.get_headers(request, @sdk_configuration.globals)
233
+ headers = T.cast(headers, T::Hash[String, String])
234
+ headers['Accept'] = 'application/json'
235
+ headers['user-agent'] = @sdk_configuration.user_agent
236
+
237
+ security = @sdk_configuration.security_source&.call
238
+
239
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
240
+ timeout ||= @sdk_configuration.timeout
241
+
242
+
243
+ connection = @sdk_configuration.client
244
+
245
+ hook_ctx = SDKHooks::HookContext.new(
246
+ config: @sdk_configuration,
247
+ base_url: base_url,
248
+ oauth2_scopes: nil,
249
+ operation_id: 'listResolutionLinks',
250
+ security_source: @sdk_configuration.security_source
251
+ )
252
+
253
+ error = T.let(nil, T.nilable(StandardError))
254
+ http_response = T.let(nil, T.nilable(Faraday::Response))
255
+
256
+
257
+ begin
258
+ http_response = T.must(connection).get(url) do |req|
259
+ req.headers.merge!(headers)
260
+ req.options.timeout = timeout unless timeout.nil?
261
+ Utils.configure_request_security(req, security)
262
+ http_headers&.each do |key, value|
263
+ req.headers[key.to_s] = value
264
+ end
265
+
266
+ @sdk_configuration.hooks.before_request(
267
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
268
+ hook_ctx: hook_ctx
269
+ ),
270
+ request: req
271
+ )
272
+ end
273
+ rescue StandardError => e
274
+ error = e
275
+ ensure
276
+ if http_response.nil? || Utils.error_status?(http_response.status)
277
+ http_response = @sdk_configuration.hooks.after_error(
278
+ error: error,
279
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
280
+ hook_ctx: hook_ctx
281
+ ),
282
+ response: http_response
283
+ )
284
+ else
285
+ http_response = @sdk_configuration.hooks.after_success(
286
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
287
+ hook_ctx: hook_ctx
288
+ ),
289
+ response: http_response
290
+ )
291
+ end
292
+
293
+ if http_response.nil?
294
+ raise error if !error.nil?
295
+ raise 'no response'
296
+ end
297
+ end
298
+
299
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
300
+ if Utils.match_status_code(http_response.status, ['200'])
301
+ if Utils.match_content_type(content_type, 'application/json')
302
+ http_response = @sdk_configuration.hooks.after_success(
303
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
304
+ hook_ctx: hook_ctx
305
+ ),
306
+ response: http_response
307
+ )
308
+ response_data = http_response.env.response_body
309
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Components::ResolutionLink))
310
+ response = Models::Operations::ListResolutionLinksResponse.new(
311
+ status_code: http_response.status,
312
+ content_type: content_type,
313
+ raw_response: http_response,
314
+ headers: http_response.headers,
315
+ resolution_links: T.unsafe(obj)
316
+ )
317
+
318
+ return response
319
+ else
320
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
321
+ end
322
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '429'])
323
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
324
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
325
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
326
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
327
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
328
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
329
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
330
+ else
331
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
332
+
333
+ end
334
+ end
335
+
336
+
337
+ sig { params(account_id: ::String, resolution_link_code: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::GetResolutionLinkResponse) }
338
+ def get(account_id:, resolution_link_code:, x_moov_version: nil, timeout_ms: nil, http_headers: nil)
339
+ # get - Get a resolution link by code.
340
+ #
341
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
342
+ # you'll need to specify the `/accounts/{accountID}/profile.read` scope.
343
+ request = Models::Operations::GetResolutionLinkRequest.new(
344
+ account_id: account_id,
345
+ resolution_link_code: resolution_link_code,
346
+ x_moov_version: x_moov_version
347
+ )
348
+ url, params = @sdk_configuration.get_server_details
349
+ base_url = Utils.template_url(url, params)
350
+ url = Utils.generate_url(
351
+ Models::Operations::GetResolutionLinkRequest,
352
+ base_url,
353
+ '/accounts/{accountID}/resolution-links/{resolutionLinkCode}',
354
+ request,
355
+ @sdk_configuration.globals
356
+ )
357
+ headers = Utils.get_headers(request, @sdk_configuration.globals)
358
+ headers = T.cast(headers, T::Hash[String, String])
359
+ headers['Accept'] = 'application/json'
360
+ headers['user-agent'] = @sdk_configuration.user_agent
361
+
362
+ security = @sdk_configuration.security_source&.call
363
+
364
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
365
+ timeout ||= @sdk_configuration.timeout
366
+
367
+
368
+ connection = @sdk_configuration.client
369
+
370
+ hook_ctx = SDKHooks::HookContext.new(
371
+ config: @sdk_configuration,
372
+ base_url: base_url,
373
+ oauth2_scopes: nil,
374
+ operation_id: 'getResolutionLink',
375
+ security_source: @sdk_configuration.security_source
376
+ )
377
+
378
+ error = T.let(nil, T.nilable(StandardError))
379
+ http_response = T.let(nil, T.nilable(Faraday::Response))
380
+
381
+
382
+ begin
383
+ http_response = T.must(connection).get(url) do |req|
384
+ req.headers.merge!(headers)
385
+ req.options.timeout = timeout unless timeout.nil?
386
+ Utils.configure_request_security(req, security)
387
+ http_headers&.each do |key, value|
388
+ req.headers[key.to_s] = value
389
+ end
390
+
391
+ @sdk_configuration.hooks.before_request(
392
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
393
+ hook_ctx: hook_ctx
394
+ ),
395
+ request: req
396
+ )
397
+ end
398
+ rescue StandardError => e
399
+ error = e
400
+ ensure
401
+ if http_response.nil? || Utils.error_status?(http_response.status)
402
+ http_response = @sdk_configuration.hooks.after_error(
403
+ error: error,
404
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
405
+ hook_ctx: hook_ctx
406
+ ),
407
+ response: http_response
408
+ )
409
+ else
410
+ http_response = @sdk_configuration.hooks.after_success(
411
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
412
+ hook_ctx: hook_ctx
413
+ ),
414
+ response: http_response
415
+ )
416
+ end
417
+
418
+ if http_response.nil?
419
+ raise error if !error.nil?
420
+ raise 'no response'
421
+ end
422
+ end
423
+
424
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
425
+ if Utils.match_status_code(http_response.status, ['200'])
426
+ if Utils.match_content_type(content_type, 'application/json')
427
+ http_response = @sdk_configuration.hooks.after_success(
428
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
429
+ hook_ctx: hook_ctx
430
+ ),
431
+ response: http_response
432
+ )
433
+ response_data = http_response.env.response_body
434
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::ResolutionLink)
435
+ response = Models::Operations::GetResolutionLinkResponse.new(
436
+ status_code: http_response.status,
437
+ content_type: content_type,
438
+ raw_response: http_response,
439
+ headers: http_response.headers,
440
+ resolution_link: T.unsafe(obj)
441
+ )
442
+
443
+ return response
444
+ else
445
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
446
+ end
447
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
448
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
449
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
450
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
451
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
452
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
453
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
454
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
455
+ else
456
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
457
+
458
+ end
459
+ end
460
+
461
+
462
+ sig { params(account_id: ::String, resolution_link_code: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::DisableResolutionLinkResponse) }
463
+ def disable(account_id:, resolution_link_code:, x_moov_version: nil, timeout_ms: nil, http_headers: nil)
464
+ # disable - Disable a resolution link. Disabled resolution links can no longer be used by merchants.
465
+ #
466
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
467
+ # you'll need to specify the `/accounts/{accountID}/profile.write` scope.
468
+ request = Models::Operations::DisableResolutionLinkRequest.new(
469
+ account_id: account_id,
470
+ resolution_link_code: resolution_link_code,
471
+ x_moov_version: x_moov_version
472
+ )
473
+ url, params = @sdk_configuration.get_server_details
474
+ base_url = Utils.template_url(url, params)
475
+ url = Utils.generate_url(
476
+ Models::Operations::DisableResolutionLinkRequest,
477
+ base_url,
478
+ '/accounts/{accountID}/resolution-links/{resolutionLinkCode}',
479
+ request,
480
+ @sdk_configuration.globals
481
+ )
482
+ headers = Utils.get_headers(request, @sdk_configuration.globals)
483
+ headers = T.cast(headers, T::Hash[String, String])
484
+ headers['Accept'] = 'application/json'
485
+ headers['user-agent'] = @sdk_configuration.user_agent
486
+
487
+ security = @sdk_configuration.security_source&.call
488
+
489
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
490
+ timeout ||= @sdk_configuration.timeout
491
+
492
+
493
+ connection = @sdk_configuration.client
494
+
495
+ hook_ctx = SDKHooks::HookContext.new(
496
+ config: @sdk_configuration,
497
+ base_url: base_url,
498
+ oauth2_scopes: nil,
499
+ operation_id: 'disableResolutionLink',
500
+ security_source: @sdk_configuration.security_source
501
+ )
502
+
503
+ error = T.let(nil, T.nilable(StandardError))
504
+ http_response = T.let(nil, T.nilable(Faraday::Response))
505
+
506
+
507
+ begin
508
+ http_response = T.must(connection).delete(url) do |req|
509
+ req.headers.merge!(headers)
510
+ req.options.timeout = timeout unless timeout.nil?
511
+ Utils.configure_request_security(req, security)
512
+ http_headers&.each do |key, value|
513
+ req.headers[key.to_s] = value
514
+ end
515
+
516
+ @sdk_configuration.hooks.before_request(
517
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
518
+ hook_ctx: hook_ctx
519
+ ),
520
+ request: req
521
+ )
522
+ end
523
+ rescue StandardError => e
524
+ error = e
525
+ ensure
526
+ if http_response.nil? || Utils.error_status?(http_response.status)
527
+ http_response = @sdk_configuration.hooks.after_error(
528
+ error: error,
529
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
530
+ hook_ctx: hook_ctx
531
+ ),
532
+ response: http_response
533
+ )
534
+ else
535
+ http_response = @sdk_configuration.hooks.after_success(
536
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
537
+ hook_ctx: hook_ctx
538
+ ),
539
+ response: http_response
540
+ )
541
+ end
542
+
543
+ if http_response.nil?
544
+ raise error if !error.nil?
545
+ raise 'no response'
546
+ end
547
+ end
548
+
549
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
550
+ if Utils.match_status_code(http_response.status, ['204'])
551
+ http_response = @sdk_configuration.hooks.after_success(
552
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
553
+ hook_ctx: hook_ctx
554
+ ),
555
+ response: http_response
556
+ )
557
+ return Models::Operations::DisableResolutionLinkResponse.new(
558
+ status_code: http_response.status,
559
+ content_type: content_type,
560
+ raw_response: http_response,
561
+ headers: {}
562
+ )
563
+ elsif Utils.match_status_code(http_response.status, ['400', '409'])
564
+ if Utils.match_content_type(content_type, 'application/json')
565
+ http_response = @sdk_configuration.hooks.after_success(
566
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
567
+ hook_ctx: hook_ctx
568
+ ),
569
+ response: http_response
570
+ )
571
+ response_data = http_response.env.response_body
572
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
573
+ obj.raw_response = http_response
574
+ raise obj
575
+ else
576
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
577
+ end
578
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
579
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
580
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
581
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
582
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
583
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
584
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
585
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
586
+ else
587
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
588
+
589
+ end
590
+ end
591
+ end
592
+ end
@@ -11,14 +11,13 @@ module Moov
11
11
 
12
12
  sig do
13
13
  override.params(
14
- config: SDKConfiguration
15
- ).returns(SDKConfiguration)
14
+ hook_ctx: BeforeRequestHookContext,
15
+ request: Faraday::Request
16
+ ).returns(Faraday::Request)
16
17
  end
17
- def sdk_init(config:)
18
- parameters = (config.globals[:parameters] ||= {})
19
- header = (parameters[:header] ||= {})
20
- header[:x_moov_version] = config.openapi_doc_version
21
- config
18
+ def before_request(hook_ctx:, request:)
19
+ request.headers['X-Moov-Version'] = hook_ctx.config.openapi_doc_version
20
+ request
22
21
  end
23
22
 
24
23
  end
@@ -24,7 +24,7 @@ module Moov
24
24
  end
25
25
  def self.init_hooks(hooks)
26
26
  version_hook = MoovVersionHook.new
27
- hooks.register_sdk_init_hook version_hook
27
+ hooks.register_before_request_hook version_hook
28
28
  end
29
29
  end
30
30
  end
@@ -95,9 +95,9 @@ module Moov
95
95
  @globals = globals.nil? ? {} : globals
96
96
  @language = 'ruby'
97
97
  @openapi_doc_version = 'v2026.04.00'
98
- @sdk_version = '26.4.0-dev.10'
99
- @gen_version = '2.856.1'
100
- @user_agent = 'speakeasy-sdk/ruby 26.4.0-dev.10 2.856.1 v2026.04.00 moov_ruby'
98
+ @sdk_version = '26.4.0-dev.11'
99
+ @gen_version = '2.859.2'
100
+ @user_agent = 'speakeasy-sdk/ruby 26.4.0-dev.11 2.859.2 v2026.04.00 moov_ruby'
101
101
  end
102
102
 
103
103
  sig { returns([String, T::Hash[Symbol, String]]) }
data/lib/moov_ruby.rb CHANGED
@@ -21,6 +21,7 @@ module Moov
21
21
  autoload :PaymentMethods, 'moov/payment_methods'
22
22
  autoload :Products, 'moov/products'
23
23
  autoload :Representatives, 'moov/representatives'
24
+ autoload :ResolutionLinks, 'moov/resolution_links'
24
25
  autoload :Scheduling, 'moov/scheduling'
25
26
  autoload :Statements, 'moov/statements'
26
27
  autoload :Sweeps, 'moov/sweeps'