moov_ruby 26.7.0.pre.dev.6 → 26.7.1

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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moov/avatars.rb +276 -1
  3. data/lib/moov/card_issuing.rb +116 -0
  4. data/lib/moov/client.rb +2 -2
  5. data/lib/moov/enriched_address.rb +1 -1
  6. data/lib/moov/enriched_profile.rb +1 -1
  7. data/lib/moov/institutions.rb +1 -1
  8. data/lib/moov/models/components/allowedscheduleerror.rb +36 -0
  9. data/lib/moov/models/components/allowedscheduleerror.rbi +15 -0
  10. data/lib/moov/models/components/avataruploadrequest.rb +32 -0
  11. data/lib/moov/models/components/avataruploadrequest.rbi +13 -0
  12. data/lib/moov/models/components/avataruploadrequest_file.rb +36 -0
  13. data/lib/moov/models/components/avataruploadrequest_file.rbi +15 -0
  14. data/lib/moov/models/components/capabilityid.rb +1 -0
  15. data/lib/moov/models/components/createdtransfer.rb +6 -2
  16. data/lib/moov/models/components/createdtransfer.rbi +2 -0
  17. data/lib/moov/models/components/createrefund.rb +2 -2
  18. data/lib/moov/models/components/createreversal.rb +1 -1
  19. data/lib/moov/models/components/createtransfer.rb +6 -2
  20. data/lib/moov/models/components/createtransfer.rbi +2 -0
  21. data/lib/moov/models/components/feepaidby.rb +19 -0
  22. data/lib/moov/models/components/feepaidby.rbi +11 -0
  23. data/lib/moov/models/components/fullissuedcard.rb +3 -3
  24. data/lib/moov/models/components/incurredfee.rb +6 -2
  25. data/lib/moov/models/components/incurredfee.rbi +2 -0
  26. data/lib/moov/models/components/issuedcard.rb +3 -3
  27. data/lib/moov/models/components/issuedcontrols.rb +52 -0
  28. data/lib/moov/models/components/issuedcontrols.rbi +23 -0
  29. data/lib/moov/models/components/issuedcontrols_allowedschedule.rb +36 -0
  30. data/lib/moov/models/components/issuedcontrols_allowedschedule.rbi +15 -0
  31. data/lib/moov/models/components/issuedvelocitylimit.rb +60 -0
  32. data/lib/moov/models/components/issuedvelocitylimit.rbi +27 -0
  33. data/lib/moov/models/components/issuingcontrols.rb +18 -2
  34. data/lib/moov/models/components/issuingcontrols.rbi +8 -0
  35. data/lib/moov/models/components/issuingcontrols_allowedschedule.rb +36 -0
  36. data/lib/moov/models/components/issuingcontrols_allowedschedule.rbi +15 -0
  37. data/lib/moov/models/components/issuingcontrolserror.rb +18 -2
  38. data/lib/moov/models/components/issuingcontrolserror.rbi +8 -0
  39. data/lib/moov/models/components/issuingcontrolsrestrictionmode.rb +19 -0
  40. data/lib/moov/models/components/issuingcontrolsrestrictionmode.rbi +11 -0
  41. data/lib/moov/models/components/issuingintervallimit.rb +4 -1
  42. data/lib/moov/models/components/issuingmerchantcategory.rb +43 -0
  43. data/lib/moov/models/components/issuingmerchantcategory.rbi +11 -0
  44. data/lib/moov/models/components/issuingscheduleday.rb +24 -0
  45. data/lib/moov/models/components/issuingscheduleday.rbi +11 -0
  46. data/lib/moov/models/components/issuingvelocitylimit.rb +11 -7
  47. data/lib/moov/models/components/issuingvelocitylimit.rbi +4 -2
  48. data/lib/moov/models/components/issuingvelocitylimiterror.rb +6 -2
  49. data/lib/moov/models/components/issuingvelocitylimiterror.rbi +2 -0
  50. data/lib/moov/models/components/merchantcategories.rb +32 -0
  51. data/lib/moov/models/components/merchantcategories.rbi +13 -0
  52. data/lib/moov/models/components/merchantcategory.rb +37 -0
  53. data/lib/moov/models/components/merchantcategory.rbi +15 -0
  54. data/lib/moov/models/components/merchantcategoryrestrictions.rb +44 -0
  55. data/lib/moov/models/components/merchantcategoryrestrictions.rbi +19 -0
  56. data/lib/moov/models/components/merchantcategoryrestrictionserror.rb +44 -0
  57. data/lib/moov/models/components/merchantcategoryrestrictionserror.rbi +19 -0
  58. data/lib/moov/models/components/merchantentry.rb +40 -0
  59. data/lib/moov/models/components/merchantentry.rbi +17 -0
  60. data/lib/moov/models/components/merchantentryerror.rb +36 -0
  61. data/lib/moov/models/components/merchantentryerror.rbi +15 -0
  62. data/lib/moov/models/components/merchantrestrictions.rb +36 -0
  63. data/lib/moov/models/components/merchantrestrictions.rbi +15 -0
  64. data/lib/moov/models/components/merchantrestrictionserror.rb +36 -0
  65. data/lib/moov/models/components/merchantrestrictionserror.rbi +15 -0
  66. data/lib/moov/models/components/paymentlinkpayoutdetails.rb +8 -2
  67. data/lib/moov/models/components/paymentlinkpayoutdetails.rbi +2 -0
  68. data/lib/moov/models/components/paymentlinkpayoutdetailsupdate.rb +8 -2
  69. data/lib/moov/models/components/paymentlinkpayoutdetailsupdate.rbi +2 -0
  70. data/lib/moov/models/components/paymentmethodswallet.rb +1 -0
  71. data/lib/moov/models/components/payoutdetailserror.rb +6 -2
  72. data/lib/moov/models/components/payoutdetailserror.rbi +2 -0
  73. data/lib/moov/models/components/product.rb +6 -2
  74. data/lib/moov/models/components/product.rbi +2 -0
  75. data/lib/moov/models/components/productcategories.rb +32 -0
  76. data/lib/moov/models/components/productcategories.rbi +13 -0
  77. data/lib/moov/models/components/productcategory.rb +48 -0
  78. data/lib/moov/models/components/productcategory.rbi +21 -0
  79. data/lib/moov/models/components/productrequest.rb +6 -2
  80. data/lib/moov/models/components/productrequest.rbi +2 -0
  81. data/lib/moov/models/components/schedulewindow.rb +40 -0
  82. data/lib/moov/models/components/schedulewindow.rbi +17 -0
  83. data/lib/moov/models/components/schedulewindowerror.rb +40 -0
  84. data/lib/moov/models/components/schedulewindowerror.rbi +17 -0
  85. data/lib/moov/models/components/schemebasicauth.rb +36 -0
  86. data/lib/moov/models/components/schemebasicauth.rbi +15 -0
  87. data/lib/moov/models/components/schemeoauth2auth.rb +40 -0
  88. data/lib/moov/models/components/schemeoauth2auth.rbi +17 -0
  89. data/lib/moov/models/components/sendfunds.rb +6 -2
  90. data/lib/moov/models/components/sendfunds.rbi +2 -0
  91. data/lib/moov/models/components/sendfundserror.rb +6 -2
  92. data/lib/moov/models/components/sendfundserror.rbi +2 -0
  93. data/lib/moov/models/components/sendfundswire.rb +32 -0
  94. data/lib/moov/models/components/sendfundswire.rbi +13 -0
  95. data/lib/moov/models/components/sendfundswireerror.rb +32 -0
  96. data/lib/moov/models/components/sendfundswireerror.rbi +13 -0
  97. data/lib/moov/models/components/transfer.rb +6 -2
  98. data/lib/moov/models/components/transfer.rbi +2 -0
  99. data/lib/moov/models/components/transfercapture.rb +36 -0
  100. data/lib/moov/models/components/transfercapture.rbi +15 -0
  101. data/lib/moov/models/components/transferfeepaidby.rb +32 -0
  102. data/lib/moov/models/components/transferfeepaidby.rbi +13 -0
  103. data/lib/moov/models/components/transferpaymentmethodswallet.rb +1 -0
  104. data/lib/moov/models/components/updateissuedcard.rb +6 -2
  105. data/lib/moov/models/components/updateissuedcard.rbi +2 -0
  106. data/lib/moov/models/components/updateissuingcontrols.rb +48 -0
  107. data/lib/moov/models/components/updateissuingcontrols.rbi +21 -0
  108. data/lib/moov/models/components/updateissuingcontrols_allowedschedule.rb +36 -0
  109. data/lib/moov/models/components/updateissuingcontrols_allowedschedule.rbi +15 -0
  110. data/lib/moov/models/components/updateissuingcontrols_merchantcategoryrestrictions.rb +44 -0
  111. data/lib/moov/models/components/updateissuingcontrols_merchantcategoryrestrictions.rbi +19 -0
  112. data/lib/moov/models/components/updateissuingcontrols_merchantrestrictions.rb +36 -0
  113. data/lib/moov/models/components/updateissuingcontrols_merchantrestrictions.rbi +15 -0
  114. data/lib/moov/models/components/updateissuingcontrolserror.rb +48 -0
  115. data/lib/moov/models/components/updateissuingcontrolserror.rbi +21 -0
  116. data/lib/moov/models/components/wallet.rb +1 -0
  117. data/lib/moov/models/components/wallettype.rb +2 -0
  118. data/lib/moov/models/components/webhookdatatransferstatus.rb +3 -0
  119. data/lib/moov/models/components.rb +34 -0
  120. data/lib/moov/models/errors/productrequestvalidationerror.rb +6 -2
  121. data/lib/moov/models/errors/productrequestvalidationerror.rbi +2 -0
  122. data/lib/moov/models/errors/transfer_error.rb +6 -2
  123. data/lib/moov/models/errors/transfer_error.rbi +2 -0
  124. data/lib/moov/models/errors/updateissuedcarderror.rb +6 -2
  125. data/lib/moov/models/errors/updateissuedcarderror.rbi +2 -0
  126. data/lib/moov/models/operations/deleteavatar_request.rb +32 -0
  127. data/lib/moov/models/operations/deleteavatar_request.rbi +13 -0
  128. data/lib/moov/models/operations/deleteavatar_response.rb +44 -0
  129. data/lib/moov/models/operations/deleteavatar_response.rbi +19 -0
  130. data/lib/moov/models/operations/deleteavatar_security.rb +36 -0
  131. data/lib/moov/models/operations/deleteavatar_security.rbi +15 -0
  132. data/lib/moov/models/operations/listissuingmerchantcategories_response.rb +48 -0
  133. data/lib/moov/models/operations/listissuingmerchantcategories_response.rbi +21 -0
  134. data/lib/moov/models/operations/listproductcategories_response.rb +48 -0
  135. data/lib/moov/models/operations/listproductcategories_response.rbi +21 -0
  136. data/lib/moov/models/operations/listproducts_request.rb +8 -2
  137. data/lib/moov/models/operations/listproducts_request.rbi +2 -0
  138. data/lib/moov/models/operations/listtransfers_request.rb +10 -2
  139. data/lib/moov/models/operations/listtransfers_request.rbi +4 -0
  140. data/lib/moov/models/operations/uploadavatar_request.rb +36 -0
  141. data/lib/moov/models/operations/uploadavatar_request.rbi +15 -0
  142. data/lib/moov/models/operations/uploadavatar_response.rb +44 -0
  143. data/lib/moov/models/operations/uploadavatar_response.rbi +19 -0
  144. data/lib/moov/models/operations/uploadavatar_security.rb +36 -0
  145. data/lib/moov/models/operations/uploadavatar_security.rbi +15 -0
  146. data/lib/moov/models/operations.rb +8 -0
  147. data/lib/moov/products.rb +113 -8
  148. data/lib/moov/sdk_hooks/clientcredentials.rb +386 -0
  149. data/lib/moov/sdk_hooks/hooks.rb +6 -0
  150. data/lib/moov/sdk_hooks/oauth2scopes.rb +18 -0
  151. data/lib/moov/sdkconfiguration.rb +3 -3
  152. data/lib/moov_ruby.rb +1 -1
  153. metadata +90 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97f938923e09de010a2d5a50098125f0c71682a7cd889661b92dc37da0938be2
4
- data.tar.gz: '02450843d0692313e7978c9d7619fc68c03ec8acb7f5fd9e45bb2d4199f3587b'
3
+ metadata.gz: 7198fc7d52eb9a74a8a5367368ec6951d364f7a265b3d5a48cbfac9c476e5c21
4
+ data.tar.gz: 1f3685aaa2e1e751d96b4d9e2e40e057500bc0c18f58c4b48b8a92876f5cc5e7
5
5
  SHA512:
6
- metadata.gz: 15744cbcab200dc81fdeb1934620fb46d71acc5cbc8a606bd6c846475ed459f7fb5ae662e7beb96eaa1cd8cfac27e6dd7b2531d64755c9dd167429f4c149040f
7
- data.tar.gz: 9c393fbe2e6e70c5d072c75fef03d2dd52bb75b520dc7d9b265026400f30abca11f165ec40ba9cbfac352b78d52cf5f37da6cbc4c4babf53b01062aec74e691d
6
+ metadata.gz: 15d8a703be91f1e403ce4b4eb185d57a2075d44532cb97114870886a864bdd09a6029d43aea1f29c9fff61c899e4998a879858f2c9bee2dc03abecddfdfbb62b
7
+ data.tar.gz: 43c8323be8750653cf5697290665c37d8eaef3570a6048a1536c80312d58fdd29f155107e6b030c368ec38d3642b5c21203c2245bb9edc3ff36d024de083831f
data/lib/moov/avatars.rb CHANGED
@@ -45,7 +45,7 @@ module Moov
45
45
  def get(unique_id:, timeout_ms: nil, http_headers: nil)
46
46
  # get - Get avatar image for an account using a unique ID.
47
47
  #
48
- # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
48
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
49
49
  # you'll need to specify the `/profile-enrichment.read` scope.
50
50
  request = Models::Operations::GetAvatarRequest.new(
51
51
  unique_id: unique_id
@@ -159,5 +159,280 @@ module Moov
159
159
 
160
160
  end
161
161
  end
162
+
163
+
164
+ sig { params(security: Models::Operations::UploadAvatarSecurity, avatar_upload_request: Models::Components::AvatarUploadRequest, unique_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::UploadAvatarResponse) }
165
+ def upload(security:, avatar_upload_request:, unique_id:, timeout_ms: nil, http_headers: nil)
166
+ # upload - Upload a user avatar image for an account.
167
+ #
168
+ # The image will be normalized to 512x512 PNG format and stored separately from
169
+ # automatically discovered logos. User-uploaded avatars take precedence over enriched avatars at read time.
170
+ #
171
+ # This endpoint only accepts accountID values for the uniqueID parameter.
172
+ #
173
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
174
+ # you'll need to specify the `/accounts.write` scope.
175
+ request = Models::Operations::UploadAvatarRequest.new(
176
+ unique_id: unique_id,
177
+ avatar_upload_request: avatar_upload_request
178
+ )
179
+ url, params = @sdk_configuration.get_server_details
180
+ base_url = Utils.template_url(url, params)
181
+ url = Utils.generate_url(
182
+ Models::Operations::UploadAvatarRequest,
183
+ base_url,
184
+ '/avatars/{uniqueID}',
185
+ request
186
+ )
187
+ headers = {}
188
+ headers = T.cast(headers, T::Hash[String, String])
189
+ req_content_type, data, form = Utils.serialize_request_body(request, false, false, :avatar_upload_request, :multipart)
190
+ headers['content-type'] = req_content_type
191
+ raise StandardError, 'request body is required' if data.nil? && form.nil?
192
+
193
+ if form && !form.empty?
194
+ body = Utils.encode_form(form)
195
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
196
+ body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
197
+ else
198
+ body = data
199
+ end
200
+ headers['Accept'] = 'application/json'
201
+ headers['user-agent'] = @sdk_configuration.user_agent
202
+
203
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
204
+ timeout ||= @sdk_configuration.timeout
205
+
206
+
207
+ connection = @sdk_configuration.client
208
+
209
+ hook_ctx = SDKHooks::HookContext.new(
210
+ config: @sdk_configuration,
211
+ base_url: base_url,
212
+ oauth2_scopes: ['/accounts.write'],
213
+ operation_id: 'uploadAvatar',
214
+ security_source: -> { security }
215
+ )
216
+
217
+ error = T.let(nil, T.nilable(StandardError))
218
+ http_response = T.let(nil, T.nilable(Faraday::Response))
219
+
220
+
221
+ begin
222
+ http_response = T.must(connection).put(url) do |req|
223
+ req.body = body
224
+ req.headers.merge!(headers)
225
+ req.options.timeout = timeout unless timeout.nil?
226
+ Utils.configure_request_security(req, security)
227
+ http_headers&.each do |key, value|
228
+ req.headers[key.to_s] = value
229
+ end
230
+
231
+ @sdk_configuration.hooks.before_request(
232
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
233
+ hook_ctx: hook_ctx
234
+ ),
235
+ request: req
236
+ )
237
+ end
238
+ rescue StandardError => e
239
+ error = e
240
+ ensure
241
+ if http_response.nil? || Utils.error_status?(http_response.status)
242
+ http_response = @sdk_configuration.hooks.after_error(
243
+ error: error,
244
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
245
+ hook_ctx: hook_ctx
246
+ ),
247
+ response: http_response
248
+ )
249
+ else
250
+ http_response = @sdk_configuration.hooks.after_success(
251
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
252
+ hook_ctx: hook_ctx
253
+ ),
254
+ response: http_response
255
+ )
256
+ end
257
+
258
+ if http_response.nil?
259
+ raise error if !error.nil?
260
+ raise 'no response'
261
+ end
262
+ end
263
+
264
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
265
+ if Utils.match_status_code(http_response.status, ['204'])
266
+ http_response = @sdk_configuration.hooks.after_success(
267
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
268
+ hook_ctx: hook_ctx
269
+ ),
270
+ response: http_response
271
+ )
272
+ return Models::Operations::UploadAvatarResponse.new(
273
+ status_code: http_response.status,
274
+ content_type: content_type,
275
+ raw_response: http_response,
276
+ headers: {}
277
+ )
278
+ elsif Utils.match_status_code(http_response.status, ['400'])
279
+ if Utils.match_content_type(content_type, 'application/json')
280
+ http_response = @sdk_configuration.hooks.after_success(
281
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
282
+ hook_ctx: hook_ctx
283
+ ),
284
+ response: http_response
285
+ )
286
+ response_data = http_response.env.response_body
287
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
288
+ obj.raw_response = http_response
289
+ raise obj
290
+ else
291
+ 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'
292
+ end
293
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '413', '415', '429'])
294
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
295
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
296
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
297
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
298
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
299
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
300
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
301
+ else
302
+ 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'
303
+
304
+ end
305
+ end
306
+
307
+
308
+ sig { params(security: Models::Operations::DeleteAvatarSecurity, unique_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::DeleteAvatarResponse) }
309
+ def delete(security:, unique_id:, timeout_ms: nil, http_headers: nil)
310
+ # delete - Delete a user-uploaded avatar for an account.
311
+ #
312
+ # After deletion, the avatar endpoint will fall back to the enriched avatar
313
+ # or an account-type-aware fallback icon.
314
+ #
315
+ # This endpoint only accepts accountID values for the uniqueID parameter.
316
+ #
317
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
318
+ # you'll need to specify the `/accounts.write` scope.
319
+ request = Models::Operations::DeleteAvatarRequest.new(
320
+ unique_id: unique_id
321
+ )
322
+ url, params = @sdk_configuration.get_server_details
323
+ base_url = Utils.template_url(url, params)
324
+ url = Utils.generate_url(
325
+ Models::Operations::DeleteAvatarRequest,
326
+ base_url,
327
+ '/avatars/{uniqueID}',
328
+ request
329
+ )
330
+ headers = {}
331
+ headers = T.cast(headers, T::Hash[String, String])
332
+ headers['Accept'] = 'application/json'
333
+ headers['user-agent'] = @sdk_configuration.user_agent
334
+
335
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
336
+ timeout ||= @sdk_configuration.timeout
337
+
338
+
339
+ connection = @sdk_configuration.client
340
+
341
+ hook_ctx = SDKHooks::HookContext.new(
342
+ config: @sdk_configuration,
343
+ base_url: base_url,
344
+ oauth2_scopes: ['/accounts.write'],
345
+ operation_id: 'deleteAvatar',
346
+ security_source: -> { security }
347
+ )
348
+
349
+ error = T.let(nil, T.nilable(StandardError))
350
+ http_response = T.let(nil, T.nilable(Faraday::Response))
351
+
352
+
353
+ begin
354
+ http_response = T.must(connection).delete(url) do |req|
355
+ req.headers.merge!(headers)
356
+ req.options.timeout = timeout unless timeout.nil?
357
+ Utils.configure_request_security(req, security)
358
+ http_headers&.each do |key, value|
359
+ req.headers[key.to_s] = value
360
+ end
361
+
362
+ @sdk_configuration.hooks.before_request(
363
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
364
+ hook_ctx: hook_ctx
365
+ ),
366
+ request: req
367
+ )
368
+ end
369
+ rescue StandardError => e
370
+ error = e
371
+ ensure
372
+ if http_response.nil? || Utils.error_status?(http_response.status)
373
+ http_response = @sdk_configuration.hooks.after_error(
374
+ error: error,
375
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
376
+ hook_ctx: hook_ctx
377
+ ),
378
+ response: http_response
379
+ )
380
+ else
381
+ http_response = @sdk_configuration.hooks.after_success(
382
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
383
+ hook_ctx: hook_ctx
384
+ ),
385
+ response: http_response
386
+ )
387
+ end
388
+
389
+ if http_response.nil?
390
+ raise error if !error.nil?
391
+ raise 'no response'
392
+ end
393
+ end
394
+
395
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
396
+ if Utils.match_status_code(http_response.status, ['204'])
397
+ http_response = @sdk_configuration.hooks.after_success(
398
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
399
+ hook_ctx: hook_ctx
400
+ ),
401
+ response: http_response
402
+ )
403
+ return Models::Operations::DeleteAvatarResponse.new(
404
+ status_code: http_response.status,
405
+ content_type: content_type,
406
+ raw_response: http_response,
407
+ headers: {}
408
+ )
409
+ elsif Utils.match_status_code(http_response.status, ['400'])
410
+ if Utils.match_content_type(content_type, 'application/json')
411
+ http_response = @sdk_configuration.hooks.after_success(
412
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
413
+ hook_ctx: hook_ctx
414
+ ),
415
+ response: http_response
416
+ )
417
+ response_data = http_response.env.response_body
418
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
419
+ obj.raw_response = http_response
420
+ raise obj
421
+ else
422
+ 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'
423
+ end
424
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
425
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
426
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
427
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
428
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
429
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
430
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
431
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
432
+ else
433
+ 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'
434
+
435
+ end
436
+ end
162
437
  end
163
438
  end
@@ -41,6 +41,122 @@ module Moov
41
41
 
42
42
 
43
43
 
44
+ sig { params(timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::ListIssuingMerchantCategoriesResponse) }
45
+ def list_merchant_categories(timeout_ms: nil, http_headers: nil)
46
+ # list_merchant_categories - List the predefined merchant category groups available for issued card spend controls, along with
47
+ # the merchant category codes (MCCs) each group covers. Use these category names in an issued card's
48
+ # `merchantCategoryRestrictions`.
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 `/issued-cards.read` scope.
52
+ url, params = @sdk_configuration.get_server_details
53
+ base_url = Utils.template_url(url, params)
54
+ url = "#{base_url}/issuing/merchant-categories"
55
+ headers = {}
56
+ headers = T.cast(headers, T::Hash[String, String])
57
+ headers['Accept'] = 'application/json'
58
+ headers['user-agent'] = @sdk_configuration.user_agent
59
+
60
+ security = @sdk_configuration.security_source&.call
61
+
62
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
63
+ timeout ||= @sdk_configuration.timeout
64
+
65
+
66
+ connection = @sdk_configuration.client
67
+
68
+ hook_ctx = SDKHooks::HookContext.new(
69
+ config: @sdk_configuration,
70
+ base_url: base_url,
71
+ oauth2_scopes: nil,
72
+ operation_id: 'listIssuingMerchantCategories',
73
+ security_source: @sdk_configuration.security_source
74
+ )
75
+
76
+ error = T.let(nil, T.nilable(StandardError))
77
+ http_response = T.let(nil, T.nilable(Faraday::Response))
78
+
79
+
80
+ begin
81
+ http_response = T.must(connection).get(url) do |req|
82
+ req.headers.merge!(headers)
83
+ req.options.timeout = timeout unless timeout.nil?
84
+ Utils.configure_request_security(req, security)
85
+ http_headers&.each do |key, value|
86
+ req.headers[key.to_s] = value
87
+ end
88
+
89
+ @sdk_configuration.hooks.before_request(
90
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
91
+ hook_ctx: hook_ctx
92
+ ),
93
+ request: req
94
+ )
95
+ end
96
+ rescue StandardError => e
97
+ error = e
98
+ ensure
99
+ if http_response.nil? || Utils.error_status?(http_response.status)
100
+ http_response = @sdk_configuration.hooks.after_error(
101
+ error: error,
102
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
103
+ hook_ctx: hook_ctx
104
+ ),
105
+ response: http_response
106
+ )
107
+ else
108
+ http_response = @sdk_configuration.hooks.after_success(
109
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
110
+ hook_ctx: hook_ctx
111
+ ),
112
+ response: http_response
113
+ )
114
+ end
115
+
116
+ if http_response.nil?
117
+ raise error if !error.nil?
118
+ raise 'no response'
119
+ end
120
+ end
121
+
122
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
123
+ if Utils.match_status_code(http_response.status, ['200'])
124
+ if Utils.match_content_type(content_type, 'application/json')
125
+ http_response = @sdk_configuration.hooks.after_success(
126
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
127
+ hook_ctx: hook_ctx
128
+ ),
129
+ response: http_response
130
+ )
131
+ response_data = http_response.env.response_body
132
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::MerchantCategories)
133
+ response = Models::Operations::ListIssuingMerchantCategoriesResponse.new(
134
+ status_code: http_response.status,
135
+ content_type: content_type,
136
+ raw_response: http_response,
137
+ headers: http_response.headers,
138
+ merchant_categories: T.unsafe(obj)
139
+ )
140
+
141
+ return response
142
+ else
143
+ 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'
144
+ end
145
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '429'])
146
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
147
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
148
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
149
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
150
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
151
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
152
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
153
+ else
154
+ 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'
155
+
156
+ end
157
+ end
158
+
159
+
44
160
  sig { params(request_card: Models::Components::RequestCard, account_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::RequestCardResponse) }
45
161
  def request(request_card:, account_id:, timeout_ms: nil, http_headers: nil)
46
162
  # request - Request a virtual card be issued.
data/lib/moov/client.rb CHANGED
@@ -16,7 +16,7 @@ module Moov
16
16
  class Client
17
17
  extend T::Sig
18
18
 
19
- attr_accessor :accounts, :adjustments, :apple_pay, :bank_accounts, :branding, :capabilities, :cards, :disputes, :fee_plans, :files, :google_pay, :images, :invoices, :payment_links, :payment_methods, :products, :representatives, :resolution_links, :scheduling, :statements, :sweeps, :account_terminal_applications, :support, :transfer_config, :transfers, :underwriting, :wallets, :wallet_transactions, :avatars, :end_to_end_encryption, :enriched_address, :enriched_profile, :webhooks, :industries, :institutions, :issuing_transactions, :card_issuing, :authentication, :onboarding, :ping, :receipts, :terminal_applications, :deposit_view
19
+ attr_accessor :accounts, :adjustments, :apple_pay, :bank_accounts, :branding, :capabilities, :cards, :disputes, :fee_plans, :files, :google_pay, :images, :invoices, :payment_links, :payment_methods, :products, :representatives, :resolution_links, :scheduling, :statements, :sweeps, :account_terminal_applications, :support, :transfer_config, :transfers, :underwriting, :wallets, :wallet_transactions, :avatars, :end_to_end_encryption, :enriched_address, :enriched_profile, :webhooks, :industries, :institutions, :card_issuing, :issuing_transactions, :authentication, :onboarding, :ping, :receipts, :terminal_applications, :deposit_view
20
20
 
21
21
  # Instantiates the SDK, configuring it with the provided parameters.
22
22
  #
@@ -113,8 +113,8 @@ module Moov
113
113
  @webhooks = Webhooks.new(@sdk_configuration)
114
114
  @industries = Industries.new(@sdk_configuration)
115
115
  @institutions = Institutions.new(@sdk_configuration)
116
- @issuing_transactions = IssuingTransactions.new(@sdk_configuration)
117
116
  @card_issuing = CardIssuing.new(@sdk_configuration)
117
+ @issuing_transactions = IssuingTransactions.new(@sdk_configuration)
118
118
  @authentication = Authentication.new(@sdk_configuration)
119
119
  @onboarding = Onboarding.new(@sdk_configuration)
120
120
  @ping = Ping.new(@sdk_configuration)
@@ -45,7 +45,7 @@ module Moov
45
45
  def get(request:, timeout_ms: nil, http_headers: nil)
46
46
  # get - Fetch enriched address suggestions. Requires a partial address.
47
47
  #
48
- # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
48
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
49
49
  # you'll need to specify the `/profile-enrichment.read` scope.
50
50
  url, params = @sdk_configuration.get_server_details
51
51
  base_url = Utils.template_url(url, params)
@@ -45,7 +45,7 @@ module Moov
45
45
  def get(email:, timeout_ms: nil, http_headers: nil)
46
46
  # get - Fetch enriched profile data. Requires a valid email address. This service is offered in collaboration with Clearbit.
47
47
  #
48
- # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
48
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
49
49
  # you'll need to specify the `/profile-enrichment.read` scope.
50
50
  request = Models::Operations::GetEnrichmentProfileRequest.new(
51
51
  email: email
@@ -172,7 +172,7 @@ module Moov
172
172
  #
173
173
  # Search for institutions by either their name or routing number.
174
174
  #
175
- # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
175
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
176
176
  # you'll need to specify the `/fed.read` scope.
177
177
  #
178
178
  # @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
@@ -0,0 +1,36 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+ class AllowedScheduleError
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+
16
+ field :timezone, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('timezone') } }
17
+
18
+ field :windows, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::ScheduleWindowError)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('windows') } }
19
+
20
+ sig { params(timezone: T.nilable(::String), windows: T.nilable(T::Hash[Symbol, Models::Components::ScheduleWindowError])).void }
21
+ def initialize(timezone: nil, windows: nil)
22
+ @timezone = timezone
23
+ @windows = windows
24
+ end
25
+
26
+ sig { params(other: T.untyped).returns(T::Boolean) }
27
+ def ==(other)
28
+ return false unless other.is_a? self.class
29
+ return false unless @timezone == other.timezone
30
+ return false unless @windows == other.windows
31
+ true
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::AllowedScheduleError
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::AllowedScheduleError
11
+ def timezone(); end
12
+ def timezone=(str_); end
13
+ def windows(); end
14
+ def windows=(str_); end
15
+ end
@@ -0,0 +1,32 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+ class AvatarUploadRequest
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # A JPEG, PNG, or WebP image file to upload as an avatar.
16
+ field :file, Models::Components::AvatarUploadRequestFile, { 'multipart_form': { 'file': true, 'field_name': 'file' } }
17
+
18
+ sig { params(file: Models::Components::AvatarUploadRequestFile).void }
19
+ def initialize(file:)
20
+ @file = file
21
+ end
22
+
23
+ sig { params(other: T.untyped).returns(T::Boolean) }
24
+ def ==(other)
25
+ return false unless other.is_a? self.class
26
+ return false unless @file == other.file
27
+ true
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,13 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::AvatarUploadRequest
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::AvatarUploadRequest
11
+ def file(); end
12
+ def file=(str_); end
13
+ end
@@ -0,0 +1,36 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module Moov
8
+ module Models
9
+ module Components
10
+
11
+ class AvatarUploadRequestFile
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+
16
+ field :file_name, ::String, { 'multipart_form': { 'field_name': 'fileName' } }
17
+
18
+ field :content, ::String, { 'multipart_form': { 'content': true } }
19
+
20
+ sig { params(file_name: ::String, content: ::String).void }
21
+ def initialize(file_name:, content:)
22
+ @file_name = file_name
23
+ @content = content
24
+ end
25
+
26
+ sig { params(other: T.untyped).returns(T::Boolean) }
27
+ def ==(other)
28
+ return false unless other.is_a? self.class
29
+ return false unless @file_name == other.file_name
30
+ return false unless @content == other.content
31
+ true
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::AvatarUploadRequestFile
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::AvatarUploadRequestFile
11
+ def file_name(); end
12
+ def file_name=(str_); end
13
+ def content(); end
14
+ def content=(str_); end
15
+ end
@@ -25,6 +25,7 @@ module Moov
25
25
  SEND_FUNDS_ACH = new('send-funds.ach')
26
26
  SEND_FUNDS_RTP = new('send-funds.rtp')
27
27
  SEND_FUNDS_INSTANT_BANK = new('send-funds.instant-bank')
28
+ SEND_FUNDS_WIRE = new('send-funds.wire')
28
29
  COLLECT_FUNDS = new('collect-funds')
29
30
  COLLECT_FUNDS_CARD_PAYMENTS = new('collect-funds.card-payments')
30
31
  MONEY_TRANSFER_PULL_FROM_CARD = new('money-transfer.pull-from-card')