weft-sdk 0.2.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 (81) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +9 -0
  3. data/docs/APIKeysApi.md +208 -0
  4. data/docs/AccountApi.md +72 -0
  5. data/docs/AccountDetails.md +30 -0
  6. data/docs/Agent.md +38 -0
  7. data/docs/AgentListResponse.md +20 -0
  8. data/docs/AgentResponse.md +18 -0
  9. data/docs/AgentStats.md +30 -0
  10. data/docs/AgentsApi.md +147 -0
  11. data/docs/ApiKey.md +28 -0
  12. data/docs/ApiKeyCreated.md +26 -0
  13. data/docs/ApiKeyCreatedResponse.md +18 -0
  14. data/docs/ApiKeyListResponse.md +18 -0
  15. data/docs/AuthApi.md +385 -0
  16. data/docs/AuthResponse.md +18 -0
  17. data/docs/AuthResponseData.md +22 -0
  18. data/docs/ConfirmRequest.md +18 -0
  19. data/docs/CreateApiKeyRequest.md +18 -0
  20. data/docs/DefaultApi.md +67 -0
  21. data/docs/Error.md +24 -0
  22. data/docs/ErrorResponse.md +18 -0
  23. data/docs/MeResponse.md +18 -0
  24. data/docs/MessageResponse.md +18 -0
  25. data/docs/MessageResponseData.md +18 -0
  26. data/docs/Pagination.md +24 -0
  27. data/docs/PasswordResetRequest.md +18 -0
  28. data/docs/PasswordUpdateRequest.md +22 -0
  29. data/docs/Payment.md +44 -0
  30. data/docs/PaymentListResponse.md +20 -0
  31. data/docs/PaymentResponse.md +18 -0
  32. data/docs/PaymentsApi.md +147 -0
  33. data/docs/ResendConfirmationRequest.md +18 -0
  34. data/docs/SignInRequest.md +20 -0
  35. data/docs/SignUpRequest.md +22 -0
  36. data/docs/User.md +22 -0
  37. data/lib/weft/facilitator/client.rb +89 -0
  38. data/lib/weft/facilitator/fee.rb +47 -0
  39. data/lib/weft/facilitator/middleware.rb +190 -0
  40. data/lib/weft/generated/api/account_api.rb +77 -0
  41. data/lib/weft/generated/api/agents_api.rb +148 -0
  42. data/lib/weft/generated/api/api_keys_api.rb +204 -0
  43. data/lib/weft/generated/api/auth_api.rb +418 -0
  44. data/lib/weft/generated/api/default_api.rb +77 -0
  45. data/lib/weft/generated/api/payments_api.rb +148 -0
  46. data/lib/weft/generated/api_client.rb +397 -0
  47. data/lib/weft/generated/api_error.rb +58 -0
  48. data/lib/weft/generated/api_model_base.rb +88 -0
  49. data/lib/weft/generated/configuration.rb +317 -0
  50. data/lib/weft/generated/models/account_details.rb +310 -0
  51. data/lib/weft/generated/models/agent.rb +417 -0
  52. data/lib/weft/generated/models/agent_list_response.rb +192 -0
  53. data/lib/weft/generated/models/agent_response.rb +164 -0
  54. data/lib/weft/generated/models/agent_stats.rb +201 -0
  55. data/lib/weft/generated/models/api_key.rb +244 -0
  56. data/lib/weft/generated/models/api_key_created.rb +252 -0
  57. data/lib/weft/generated/models/api_key_created_response.rb +164 -0
  58. data/lib/weft/generated/models/api_key_list_response.rb +166 -0
  59. data/lib/weft/generated/models/auth_response.rb +164 -0
  60. data/lib/weft/generated/models/auth_response_data.rb +199 -0
  61. data/lib/weft/generated/models/confirm_request.rb +164 -0
  62. data/lib/weft/generated/models/create_api_key_request.rb +148 -0
  63. data/lib/weft/generated/models/error.rb +208 -0
  64. data/lib/weft/generated/models/error_response.rb +164 -0
  65. data/lib/weft/generated/models/me_response.rb +164 -0
  66. data/lib/weft/generated/models/message_response.rb +164 -0
  67. data/lib/weft/generated/models/message_response_data.rb +164 -0
  68. data/lib/weft/generated/models/pagination.rb +242 -0
  69. data/lib/weft/generated/models/password_reset_request.rb +164 -0
  70. data/lib/weft/generated/models/password_update_request.rb +216 -0
  71. data/lib/weft/generated/models/payment.rb +437 -0
  72. data/lib/weft/generated/models/payment_list_response.rb +192 -0
  73. data/lib/weft/generated/models/payment_response.rb +164 -0
  74. data/lib/weft/generated/models/resend_confirmation_request.rb +164 -0
  75. data/lib/weft/generated/models/sign_in_request.rb +190 -0
  76. data/lib/weft/generated/models/sign_up_request.rb +216 -0
  77. data/lib/weft/generated/models/user.rb +199 -0
  78. data/lib/weft/generated/version.rb +15 -0
  79. data/lib/weft/generated.rb +4 -0
  80. data/lib/weft/sdk.rb +10 -0
  81. metadata +123 -0
@@ -0,0 +1,418 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #API for agent-first payments and discovery.
5
+
6
+ The version of the OpenAPI document: 0.2.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Weft
16
+ class AuthApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Confirm an account
23
+ # @param confirm_request [ConfirmRequest]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [AuthResponse]
26
+ def confirm_account(confirm_request, opts = {})
27
+ data, _status_code, _headers = confirm_account_with_http_info(confirm_request, opts)
28
+ data
29
+ end
30
+
31
+ # Confirm an account
32
+ # @param confirm_request [ConfirmRequest]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
35
+ def confirm_account_with_http_info(confirm_request, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: AuthApi.confirm_account ...'
38
+ end
39
+ # verify the required parameter 'confirm_request' is set
40
+ if @api_client.config.client_side_validation && confirm_request.nil?
41
+ fail ArgumentError, "Missing the required parameter 'confirm_request' when calling AuthApi.confirm_account"
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v1/auth/confirm'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(confirm_request)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'AuthResponse'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || []
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"AuthApi.confirm_account",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: AuthApi#confirm_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # Request password reset
89
+ # @param password_reset_request [PasswordResetRequest]
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [MessageResponse]
92
+ def request_password_reset(password_reset_request, opts = {})
93
+ data, _status_code, _headers = request_password_reset_with_http_info(password_reset_request, opts)
94
+ data
95
+ end
96
+
97
+ # Request password reset
98
+ # @param password_reset_request [PasswordResetRequest]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
101
+ def request_password_reset_with_http_info(password_reset_request, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: AuthApi.request_password_reset ...'
104
+ end
105
+ # verify the required parameter 'password_reset_request' is set
106
+ if @api_client.config.client_side_validation && password_reset_request.nil?
107
+ fail ArgumentError, "Missing the required parameter 'password_reset_request' when calling AuthApi.request_password_reset"
108
+ end
109
+ # resource path
110
+ local_var_path = '/api/v1/auth/password/reset'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
119
+ # HTTP header 'Content-Type'
120
+ content_type = @api_client.select_header_content_type(['application/json'])
121
+ if !content_type.nil?
122
+ header_params['Content-Type'] = content_type
123
+ end
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_request)
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type] || 'MessageResponse'
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || []
136
+
137
+ new_options = opts.merge(
138
+ :operation => :"AuthApi.request_password_reset",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: AuthApi#request_password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # Resend confirmation email
155
+ # @param resend_confirmation_request [ResendConfirmationRequest]
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [MessageResponse]
158
+ def resend_confirmation(resend_confirmation_request, opts = {})
159
+ data, _status_code, _headers = resend_confirmation_with_http_info(resend_confirmation_request, opts)
160
+ data
161
+ end
162
+
163
+ # Resend confirmation email
164
+ # @param resend_confirmation_request [ResendConfirmationRequest]
165
+ # @param [Hash] opts the optional parameters
166
+ # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
167
+ def resend_confirmation_with_http_info(resend_confirmation_request, opts = {})
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug 'Calling API: AuthApi.resend_confirmation ...'
170
+ end
171
+ # verify the required parameter 'resend_confirmation_request' is set
172
+ if @api_client.config.client_side_validation && resend_confirmation_request.nil?
173
+ fail ArgumentError, "Missing the required parameter 'resend_confirmation_request' when calling AuthApi.resend_confirmation"
174
+ end
175
+ # resource path
176
+ local_var_path = '/api/v1/auth/resend-confirmation'
177
+
178
+ # query parameters
179
+ query_params = opts[:query_params] || {}
180
+
181
+ # header parameters
182
+ header_params = opts[:header_params] || {}
183
+ # HTTP header 'Accept' (if needed)
184
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
185
+ # HTTP header 'Content-Type'
186
+ content_type = @api_client.select_header_content_type(['application/json'])
187
+ if !content_type.nil?
188
+ header_params['Content-Type'] = content_type
189
+ end
190
+
191
+ # form parameters
192
+ form_params = opts[:form_params] || {}
193
+
194
+ # http body (model)
195
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(resend_confirmation_request)
196
+
197
+ # return_type
198
+ return_type = opts[:debug_return_type] || 'MessageResponse'
199
+
200
+ # auth_names
201
+ auth_names = opts[:debug_auth_names] || []
202
+
203
+ new_options = opts.merge(
204
+ :operation => :"AuthApi.resend_confirmation",
205
+ :header_params => header_params,
206
+ :query_params => query_params,
207
+ :form_params => form_params,
208
+ :body => post_body,
209
+ :auth_names => auth_names,
210
+ :return_type => return_type
211
+ )
212
+
213
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "API called: AuthApi#resend_confirmation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ end
217
+ return data, status_code, headers
218
+ end
219
+
220
+ # Sign in with email and password
221
+ # @param sign_in_request [SignInRequest]
222
+ # @param [Hash] opts the optional parameters
223
+ # @return [AuthResponse]
224
+ def sign_in(sign_in_request, opts = {})
225
+ data, _status_code, _headers = sign_in_with_http_info(sign_in_request, opts)
226
+ data
227
+ end
228
+
229
+ # Sign in with email and password
230
+ # @param sign_in_request [SignInRequest]
231
+ # @param [Hash] opts the optional parameters
232
+ # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
233
+ def sign_in_with_http_info(sign_in_request, opts = {})
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug 'Calling API: AuthApi.sign_in ...'
236
+ end
237
+ # verify the required parameter 'sign_in_request' is set
238
+ if @api_client.config.client_side_validation && sign_in_request.nil?
239
+ fail ArgumentError, "Missing the required parameter 'sign_in_request' when calling AuthApi.sign_in"
240
+ end
241
+ # resource path
242
+ local_var_path = '/api/v1/auth/sign_in'
243
+
244
+ # query parameters
245
+ query_params = opts[:query_params] || {}
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
251
+ # HTTP header 'Content-Type'
252
+ content_type = @api_client.select_header_content_type(['application/json'])
253
+ if !content_type.nil?
254
+ header_params['Content-Type'] = content_type
255
+ end
256
+
257
+ # form parameters
258
+ form_params = opts[:form_params] || {}
259
+
260
+ # http body (model)
261
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sign_in_request)
262
+
263
+ # return_type
264
+ return_type = opts[:debug_return_type] || 'AuthResponse'
265
+
266
+ # auth_names
267
+ auth_names = opts[:debug_auth_names] || []
268
+
269
+ new_options = opts.merge(
270
+ :operation => :"AuthApi.sign_in",
271
+ :header_params => header_params,
272
+ :query_params => query_params,
273
+ :form_params => form_params,
274
+ :body => post_body,
275
+ :auth_names => auth_names,
276
+ :return_type => return_type
277
+ )
278
+
279
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug "API called: AuthApi#sign_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
282
+ end
283
+ return data, status_code, headers
284
+ end
285
+
286
+ # Create an account
287
+ # @param sign_up_request [SignUpRequest]
288
+ # @param [Hash] opts the optional parameters
289
+ # @return [AuthResponse]
290
+ def sign_up(sign_up_request, opts = {})
291
+ data, _status_code, _headers = sign_up_with_http_info(sign_up_request, opts)
292
+ data
293
+ end
294
+
295
+ # Create an account
296
+ # @param sign_up_request [SignUpRequest]
297
+ # @param [Hash] opts the optional parameters
298
+ # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
299
+ def sign_up_with_http_info(sign_up_request, opts = {})
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug 'Calling API: AuthApi.sign_up ...'
302
+ end
303
+ # verify the required parameter 'sign_up_request' is set
304
+ if @api_client.config.client_side_validation && sign_up_request.nil?
305
+ fail ArgumentError, "Missing the required parameter 'sign_up_request' when calling AuthApi.sign_up"
306
+ end
307
+ # resource path
308
+ local_var_path = '/api/v1/auth/sign_up'
309
+
310
+ # query parameters
311
+ query_params = opts[:query_params] || {}
312
+
313
+ # header parameters
314
+ header_params = opts[:header_params] || {}
315
+ # HTTP header 'Accept' (if needed)
316
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
317
+ # HTTP header 'Content-Type'
318
+ content_type = @api_client.select_header_content_type(['application/json'])
319
+ if !content_type.nil?
320
+ header_params['Content-Type'] = content_type
321
+ end
322
+
323
+ # form parameters
324
+ form_params = opts[:form_params] || {}
325
+
326
+ # http body (model)
327
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sign_up_request)
328
+
329
+ # return_type
330
+ return_type = opts[:debug_return_type] || 'AuthResponse'
331
+
332
+ # auth_names
333
+ auth_names = opts[:debug_auth_names] || []
334
+
335
+ new_options = opts.merge(
336
+ :operation => :"AuthApi.sign_up",
337
+ :header_params => header_params,
338
+ :query_params => query_params,
339
+ :form_params => form_params,
340
+ :body => post_body,
341
+ :auth_names => auth_names,
342
+ :return_type => return_type
343
+ )
344
+
345
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
346
+ if @api_client.config.debugging
347
+ @api_client.config.logger.debug "API called: AuthApi#sign_up\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
348
+ end
349
+ return data, status_code, headers
350
+ end
351
+
352
+ # Update password with reset token
353
+ # @param password_update_request [PasswordUpdateRequest]
354
+ # @param [Hash] opts the optional parameters
355
+ # @return [MessageResponse]
356
+ def update_password(password_update_request, opts = {})
357
+ data, _status_code, _headers = update_password_with_http_info(password_update_request, opts)
358
+ data
359
+ end
360
+
361
+ # Update password with reset token
362
+ # @param password_update_request [PasswordUpdateRequest]
363
+ # @param [Hash] opts the optional parameters
364
+ # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
365
+ def update_password_with_http_info(password_update_request, opts = {})
366
+ if @api_client.config.debugging
367
+ @api_client.config.logger.debug 'Calling API: AuthApi.update_password ...'
368
+ end
369
+ # verify the required parameter 'password_update_request' is set
370
+ if @api_client.config.client_side_validation && password_update_request.nil?
371
+ fail ArgumentError, "Missing the required parameter 'password_update_request' when calling AuthApi.update_password"
372
+ end
373
+ # resource path
374
+ local_var_path = '/api/v1/auth/password/update'
375
+
376
+ # query parameters
377
+ query_params = opts[:query_params] || {}
378
+
379
+ # header parameters
380
+ header_params = opts[:header_params] || {}
381
+ # HTTP header 'Accept' (if needed)
382
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
383
+ # HTTP header 'Content-Type'
384
+ content_type = @api_client.select_header_content_type(['application/json'])
385
+ if !content_type.nil?
386
+ header_params['Content-Type'] = content_type
387
+ end
388
+
389
+ # form parameters
390
+ form_params = opts[:form_params] || {}
391
+
392
+ # http body (model)
393
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(password_update_request)
394
+
395
+ # return_type
396
+ return_type = opts[:debug_return_type] || 'MessageResponse'
397
+
398
+ # auth_names
399
+ auth_names = opts[:debug_auth_names] || []
400
+
401
+ new_options = opts.merge(
402
+ :operation => :"AuthApi.update_password",
403
+ :header_params => header_params,
404
+ :query_params => query_params,
405
+ :form_params => form_params,
406
+ :body => post_body,
407
+ :auth_names => auth_names,
408
+ :return_type => return_type
409
+ )
410
+
411
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
412
+ if @api_client.config.debugging
413
+ @api_client.config.logger.debug "API called: AuthApi#update_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
414
+ end
415
+ return data, status_code, headers
416
+ end
417
+ end
418
+ end
@@ -0,0 +1,77 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #API for agent-first payments and discovery.
5
+
6
+ The version of the OpenAPI document: 0.2.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Weft
16
+ class DefaultApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Fetch OpenAPI spec
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [String]
25
+ def get_api_docs(opts = {})
26
+ data, _status_code, _headers = get_api_docs_with_http_info(opts)
27
+ data
28
+ end
29
+
30
+ # Fetch OpenAPI spec
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
33
+ def get_api_docs_with_http_info(opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_api_docs ...'
36
+ end
37
+ # resource path
38
+ local_var_path = '/api/v1/docs'
39
+
40
+ # query parameters
41
+ query_params = opts[:query_params] || {}
42
+
43
+ # header parameters
44
+ header_params = opts[:header_params] || {}
45
+ # HTTP header 'Accept' (if needed)
46
+ header_params['Accept'] = @api_client.select_header_accept(['application/yaml']) unless header_params['Accept']
47
+
48
+ # form parameters
49
+ form_params = opts[:form_params] || {}
50
+
51
+ # http body (model)
52
+ post_body = opts[:debug_body]
53
+
54
+ # return_type
55
+ return_type = opts[:debug_return_type] || 'String'
56
+
57
+ # auth_names
58
+ auth_names = opts[:debug_auth_names] || []
59
+
60
+ new_options = opts.merge(
61
+ :operation => :"DefaultApi.get_api_docs",
62
+ :header_params => header_params,
63
+ :query_params => query_params,
64
+ :form_params => form_params,
65
+ :body => post_body,
66
+ :auth_names => auth_names,
67
+ :return_type => return_type
68
+ )
69
+
70
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: DefaultApi#get_api_docs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,148 @@
1
+ =begin
2
+ #Weft API
3
+
4
+ #API for agent-first payments and discovery.
5
+
6
+ The version of the OpenAPI document: 0.2.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Weft
16
+ class PaymentsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get payment details
23
+ # @param id [Integer] Payment ID
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [PaymentResponse]
26
+ def get_payment(id, opts = {})
27
+ data, _status_code, _headers = get_payment_with_http_info(id, opts)
28
+ data
29
+ end
30
+
31
+ # Get payment details
32
+ # @param id [Integer] Payment ID
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers
35
+ def get_payment_with_http_info(id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment ...'
38
+ end
39
+ # verify the required parameter 'id' is set
40
+ if @api_client.config.client_side_validation && id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.get_payment"
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v1/payments/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body]
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type] || 'PaymentResponse'
62
+
63
+ # auth_names
64
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"PaymentsApi.get_payment",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: PaymentsApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # List payments
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [Integer] :page Page number (default to 1)
86
+ # @option opts [Integer] :per_page Items per page (default to 25)
87
+ # @return [PaymentListResponse]
88
+ def list_payments(opts = {})
89
+ data, _status_code, _headers = list_payments_with_http_info(opts)
90
+ data
91
+ end
92
+
93
+ # List payments
94
+ # @param [Hash] opts the optional parameters
95
+ # @option opts [Integer] :page Page number (default to 1)
96
+ # @option opts [Integer] :per_page Items per page (default to 25)
97
+ # @return [Array<(PaymentListResponse, Integer, Hash)>] PaymentListResponse data, response status code and response headers
98
+ def list_payments_with_http_info(opts = {})
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.list_payments ...'
101
+ end
102
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
103
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PaymentsApi.list_payments, must be smaller than or equal to 100.'
104
+ end
105
+
106
+ # resource path
107
+ local_var_path = '/api/v1/payments'
108
+
109
+ # query parameters
110
+ query_params = opts[:query_params] || {}
111
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
112
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
113
+
114
+ # header parameters
115
+ header_params = opts[:header_params] || {}
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
118
+
119
+ # form parameters
120
+ form_params = opts[:form_params] || {}
121
+
122
+ # http body (model)
123
+ post_body = opts[:debug_body]
124
+
125
+ # return_type
126
+ return_type = opts[:debug_return_type] || 'PaymentListResponse'
127
+
128
+ # auth_names
129
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
130
+
131
+ new_options = opts.merge(
132
+ :operation => :"PaymentsApi.list_payments",
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: PaymentsApi#list_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+ end
148
+ end