tensors-ruby 0.1.0

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 (60) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +154 -0
  4. data/lib/tensors-ruby/api/auth_api.rb +387 -0
  5. data/lib/tensors-ruby/api/civit_ai_api.rb +85 -0
  6. data/lib/tensors-ruby/api/comfy_uiapi_api.rb +582 -0
  7. data/lib/tensors-ruby/api/database_api.rb +655 -0
  8. data/lib/tensors-ruby/api/default_api.rb +77 -0
  9. data/lib/tensors-ruby/api/download_api.rb +210 -0
  10. data/lib/tensors-ruby/api/gallery_api.rb +416 -0
  11. data/lib/tensors-ruby/api/search_api.rb +129 -0
  12. data/lib/tensors-ruby/api_client.rb +441 -0
  13. data/lib/tensors-ruby/api_error.rb +58 -0
  14. data/lib/tensors-ruby/api_model_base.rb +88 -0
  15. data/lib/tensors-ruby/configuration.rb +399 -0
  16. data/lib/tensors-ruby/models/cache_request.rb +165 -0
  17. data/lib/tensors-ruby/models/download_request.rb +179 -0
  18. data/lib/tensors-ruby/models/generate_request.rb +444 -0
  19. data/lib/tensors-ruby/models/generate_response.rb +213 -0
  20. data/lib/tensors-ruby/models/http_validation_error.rb +149 -0
  21. data/lib/tensors-ruby/models/location_inner.rb +103 -0
  22. data/lib/tensors-ruby/models/metadata_update.rb +181 -0
  23. data/lib/tensors-ruby/models/models_response.rb +205 -0
  24. data/lib/tensors-ruby/models/provider.rb +41 -0
  25. data/lib/tensors-ruby/models/queue_status_response.rb +161 -0
  26. data/lib/tensors-ruby/models/scan_request.rb +165 -0
  27. data/lib/tensors-ruby/models/sort_order.rb +41 -0
  28. data/lib/tensors-ruby/models/system_stats_response.rb +161 -0
  29. data/lib/tensors-ruby/models/validation_error.rb +237 -0
  30. data/lib/tensors-ruby/models/workflow_request.rb +168 -0
  31. data/lib/tensors-ruby/models/workflow_response.rb +222 -0
  32. data/lib/tensors-ruby/version.rb +15 -0
  33. data/lib/tensors-ruby.rb +64 -0
  34. data/spec/api/auth_api_spec.rb +109 -0
  35. data/spec/api/civit_ai_api_spec.rb +47 -0
  36. data/spec/api/comfy_uiapi_api_spec.rb +141 -0
  37. data/spec/api/database_api_spec.rb +155 -0
  38. data/spec/api/default_api_spec.rb +45 -0
  39. data/spec/api/download_api_spec.rb +70 -0
  40. data/spec/api/gallery_api_spec.rb +109 -0
  41. data/spec/api/search_api_spec.rb +60 -0
  42. data/spec/models/cache_request_spec.rb +36 -0
  43. data/spec/models/download_request_spec.rb +54 -0
  44. data/spec/models/generate_request_spec.rb +108 -0
  45. data/spec/models/generate_response_spec.rb +54 -0
  46. data/spec/models/http_validation_error_spec.rb +36 -0
  47. data/spec/models/location_inner_spec.rb +21 -0
  48. data/spec/models/metadata_update_spec.rb +54 -0
  49. data/spec/models/models_response_spec.rb +66 -0
  50. data/spec/models/provider_spec.rb +30 -0
  51. data/spec/models/queue_status_response_spec.rb +42 -0
  52. data/spec/models/scan_request_spec.rb +36 -0
  53. data/spec/models/sort_order_spec.rb +30 -0
  54. data/spec/models/system_stats_response_spec.rb +42 -0
  55. data/spec/models/validation_error_spec.rb +60 -0
  56. data/spec/models/workflow_request_spec.rb +36 -0
  57. data/spec/models/workflow_response_spec.rb +60 -0
  58. data/spec/spec_helper.rb +111 -0
  59. data/tensors-ruby.gemspec +41 -0
  60. metadata +194 -0
@@ -0,0 +1,655 @@
1
+ =begin
2
+ #tensors
3
+
4
+ #API for CivitAI model management and image gallery
5
+
6
+ The version of the OpenAPI document: 0.1.18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TensorsApi
16
+ class DatabaseApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Cache Model
23
+ # Fetch and cache full CivitAI model data.
24
+ # @param cache_request [CacheRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Hash<String, Object>]
27
+ def cache_model_api_db_cache_post(cache_request, opts = {})
28
+ data, _status_code, _headers = cache_model_api_db_cache_post_with_http_info(cache_request, opts)
29
+ data
30
+ end
31
+
32
+ # Cache Model
33
+ # Fetch and cache full CivitAI model data.
34
+ # @param cache_request [CacheRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
37
+ def cache_model_api_db_cache_post_with_http_info(cache_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.cache_model_api_db_cache_post ...'
40
+ end
41
+ # verify the required parameter 'cache_request' is set
42
+ if @api_client.config.client_side_validation && cache_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'cache_request' when calling DatabaseApi.cache_model_api_db_cache_post"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/db/cache'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(cache_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"DatabaseApi.cache_model_api_db_cache_post",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: DatabaseApi#cache_model_api_db_cache_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Get File
91
+ # Get local file by ID.
92
+ # @param file_id [Integer]
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [Hash<String, Object>]
95
+ def get_file_api_db_files_file_id_get(file_id, opts = {})
96
+ data, _status_code, _headers = get_file_api_db_files_file_id_get_with_http_info(file_id, opts)
97
+ data
98
+ end
99
+
100
+ # Get File
101
+ # Get local file by ID.
102
+ # @param file_id [Integer]
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
105
+ def get_file_api_db_files_file_id_get_with_http_info(file_id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.get_file_api_db_files_file_id_get ...'
108
+ end
109
+ # verify the required parameter 'file_id' is set
110
+ if @api_client.config.client_side_validation && file_id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling DatabaseApi.get_file_api_db_files_file_id_get"
112
+ end
113
+ # resource path
114
+ local_var_path = '/api/db/files/{file_id}'.sub('{' + 'file_id' + '}', CGI.escape(file_id.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"DatabaseApi.get_file_api_db_files_file_id_get",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: DatabaseApi#get_file_api_db_files_file_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Get Model
154
+ # Get cached model by CivitAI ID.
155
+ # @param civitai_id [Integer]
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [Hash<String, Object>]
158
+ def get_model_api_db_models_civitai_id_get(civitai_id, opts = {})
159
+ data, _status_code, _headers = get_model_api_db_models_civitai_id_get_with_http_info(civitai_id, opts)
160
+ data
161
+ end
162
+
163
+ # Get Model
164
+ # Get cached model by CivitAI ID.
165
+ # @param civitai_id [Integer]
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
168
+ def get_model_api_db_models_civitai_id_get_with_http_info(civitai_id, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.get_model_api_db_models_civitai_id_get ...'
171
+ end
172
+ # verify the required parameter 'civitai_id' is set
173
+ if @api_client.config.client_side_validation && civitai_id.nil?
174
+ fail ArgumentError, "Missing the required parameter 'civitai_id' when calling DatabaseApi.get_model_api_db_models_civitai_id_get"
175
+ end
176
+ # resource path
177
+ local_var_path = '/api/db/models/{civitai_id}'.sub('{' + 'civitai_id' + '}', CGI.escape(civitai_id.to_s))
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
186
+
187
+ # form parameters
188
+ form_params = opts[:form_params] || {}
189
+
190
+ # http body (model)
191
+ post_body = opts[:debug_body]
192
+
193
+ # return_type
194
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
195
+
196
+ # auth_names
197
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
198
+
199
+ new_options = opts.merge(
200
+ :operation => :"DatabaseApi.get_model_api_db_models_civitai_id_get",
201
+ :header_params => header_params,
202
+ :query_params => query_params,
203
+ :form_params => form_params,
204
+ :body => post_body,
205
+ :auth_names => auth_names,
206
+ :return_type => return_type
207
+ )
208
+
209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: DatabaseApi#get_model_api_db_models_civitai_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ # Get Stats
217
+ # Get database statistics.
218
+ # @param [Hash] opts the optional parameters
219
+ # @return [Hash<String, Object>]
220
+ def get_stats_api_db_stats_get(opts = {})
221
+ data, _status_code, _headers = get_stats_api_db_stats_get_with_http_info(opts)
222
+ data
223
+ end
224
+
225
+ # Get Stats
226
+ # Get database statistics.
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
229
+ def get_stats_api_db_stats_get_with_http_info(opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.get_stats_api_db_stats_get ...'
232
+ end
233
+ # resource path
234
+ local_var_path = '/api/db/stats'
235
+
236
+ # query parameters
237
+ query_params = opts[:query_params] || {}
238
+
239
+ # header parameters
240
+ header_params = opts[:header_params] || {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:debug_body]
249
+
250
+ # return_type
251
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
252
+
253
+ # auth_names
254
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
255
+
256
+ new_options = opts.merge(
257
+ :operation => :"DatabaseApi.get_stats_api_db_stats_get",
258
+ :header_params => header_params,
259
+ :query_params => query_params,
260
+ :form_params => form_params,
261
+ :body => post_body,
262
+ :auth_names => auth_names,
263
+ :return_type => return_type
264
+ )
265
+
266
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug "API called: DatabaseApi#get_stats_api_db_stats_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
269
+ end
270
+ return data, status_code, headers
271
+ end
272
+
273
+ # Get Triggers By Path
274
+ # Get trigger words for a local file by path.
275
+ # @param file_path [String] Path to safetensor file
276
+ # @param [Hash] opts the optional parameters
277
+ # @return [Array<String>]
278
+ def get_triggers_by_path_api_db_triggers_get(file_path, opts = {})
279
+ data, _status_code, _headers = get_triggers_by_path_api_db_triggers_get_with_http_info(file_path, opts)
280
+ data
281
+ end
282
+
283
+ # Get Triggers By Path
284
+ # Get trigger words for a local file by path.
285
+ # @param file_path [String] Path to safetensor file
286
+ # @param [Hash] opts the optional parameters
287
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
288
+ def get_triggers_by_path_api_db_triggers_get_with_http_info(file_path, opts = {})
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.get_triggers_by_path_api_db_triggers_get ...'
291
+ end
292
+ # verify the required parameter 'file_path' is set
293
+ if @api_client.config.client_side_validation && file_path.nil?
294
+ fail ArgumentError, "Missing the required parameter 'file_path' when calling DatabaseApi.get_triggers_by_path_api_db_triggers_get"
295
+ end
296
+ # resource path
297
+ local_var_path = '/api/db/triggers'
298
+
299
+ # query parameters
300
+ query_params = opts[:query_params] || {}
301
+ query_params[:'file_path'] = file_path
302
+
303
+ # header parameters
304
+ header_params = opts[:header_params] || {}
305
+ # HTTP header 'Accept' (if needed)
306
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
307
+
308
+ # form parameters
309
+ form_params = opts[:form_params] || {}
310
+
311
+ # http body (model)
312
+ post_body = opts[:debug_body]
313
+
314
+ # return_type
315
+ return_type = opts[:debug_return_type] || 'Array<String>'
316
+
317
+ # auth_names
318
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
319
+
320
+ new_options = opts.merge(
321
+ :operation => :"DatabaseApi.get_triggers_by_path_api_db_triggers_get",
322
+ :header_params => header_params,
323
+ :query_params => query_params,
324
+ :form_params => form_params,
325
+ :body => post_body,
326
+ :auth_names => auth_names,
327
+ :return_type => return_type
328
+ )
329
+
330
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
331
+ if @api_client.config.debugging
332
+ @api_client.config.logger.debug "API called: DatabaseApi#get_triggers_by_path_api_db_triggers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
333
+ end
334
+ return data, status_code, headers
335
+ end
336
+
337
+ # Get Triggers By Version
338
+ # Get trigger words for a version by CivitAI version ID.
339
+ # @param version_id [Integer]
340
+ # @param [Hash] opts the optional parameters
341
+ # @return [Array<String>]
342
+ def get_triggers_by_version_api_db_triggers_version_id_get(version_id, opts = {})
343
+ data, _status_code, _headers = get_triggers_by_version_api_db_triggers_version_id_get_with_http_info(version_id, opts)
344
+ data
345
+ end
346
+
347
+ # Get Triggers By Version
348
+ # Get trigger words for a version by CivitAI version ID.
349
+ # @param version_id [Integer]
350
+ # @param [Hash] opts the optional parameters
351
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
352
+ def get_triggers_by_version_api_db_triggers_version_id_get_with_http_info(version_id, opts = {})
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.get_triggers_by_version_api_db_triggers_version_id_get ...'
355
+ end
356
+ # verify the required parameter 'version_id' is set
357
+ if @api_client.config.client_side_validation && version_id.nil?
358
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling DatabaseApi.get_triggers_by_version_api_db_triggers_version_id_get"
359
+ end
360
+ # resource path
361
+ local_var_path = '/api/db/triggers/{version_id}'.sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))
362
+
363
+ # query parameters
364
+ query_params = opts[:query_params] || {}
365
+
366
+ # header parameters
367
+ header_params = opts[:header_params] || {}
368
+ # HTTP header 'Accept' (if needed)
369
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
370
+
371
+ # form parameters
372
+ form_params = opts[:form_params] || {}
373
+
374
+ # http body (model)
375
+ post_body = opts[:debug_body]
376
+
377
+ # return_type
378
+ return_type = opts[:debug_return_type] || 'Array<String>'
379
+
380
+ # auth_names
381
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
382
+
383
+ new_options = opts.merge(
384
+ :operation => :"DatabaseApi.get_triggers_by_version_api_db_triggers_version_id_get",
385
+ :header_params => header_params,
386
+ :query_params => query_params,
387
+ :form_params => form_params,
388
+ :body => post_body,
389
+ :auth_names => auth_names,
390
+ :return_type => return_type
391
+ )
392
+
393
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
394
+ if @api_client.config.debugging
395
+ @api_client.config.logger.debug "API called: DatabaseApi#get_triggers_by_version_api_db_triggers_version_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
396
+ end
397
+ return data, status_code, headers
398
+ end
399
+
400
+ # Link Files
401
+ # Link unlinked local files to CivitAI by hash lookup.
402
+ # @param [Hash] opts the optional parameters
403
+ # @return [Hash<String, Object>]
404
+ def link_files_api_db_link_post(opts = {})
405
+ data, _status_code, _headers = link_files_api_db_link_post_with_http_info(opts)
406
+ data
407
+ end
408
+
409
+ # Link Files
410
+ # Link unlinked local files to CivitAI by hash lookup.
411
+ # @param [Hash] opts the optional parameters
412
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
413
+ def link_files_api_db_link_post_with_http_info(opts = {})
414
+ if @api_client.config.debugging
415
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.link_files_api_db_link_post ...'
416
+ end
417
+ # resource path
418
+ local_var_path = '/api/db/link'
419
+
420
+ # query parameters
421
+ query_params = opts[:query_params] || {}
422
+
423
+ # header parameters
424
+ header_params = opts[:header_params] || {}
425
+ # HTTP header 'Accept' (if needed)
426
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
427
+
428
+ # form parameters
429
+ form_params = opts[:form_params] || {}
430
+
431
+ # http body (model)
432
+ post_body = opts[:debug_body]
433
+
434
+ # return_type
435
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
436
+
437
+ # auth_names
438
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
439
+
440
+ new_options = opts.merge(
441
+ :operation => :"DatabaseApi.link_files_api_db_link_post",
442
+ :header_params => header_params,
443
+ :query_params => query_params,
444
+ :form_params => form_params,
445
+ :body => post_body,
446
+ :auth_names => auth_names,
447
+ :return_type => return_type
448
+ )
449
+
450
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
451
+ if @api_client.config.debugging
452
+ @api_client.config.logger.debug "API called: DatabaseApi#link_files_api_db_link_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
453
+ end
454
+ return data, status_code, headers
455
+ end
456
+
457
+ # List Files
458
+ # List all local files with CivitAI info.
459
+ # @param [Hash] opts the optional parameters
460
+ # @return [Array<Hash<String, Object>>]
461
+ def list_files_api_db_files_get(opts = {})
462
+ data, _status_code, _headers = list_files_api_db_files_get_with_http_info(opts)
463
+ data
464
+ end
465
+
466
+ # List Files
467
+ # List all local files with CivitAI info.
468
+ # @param [Hash] opts the optional parameters
469
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
470
+ def list_files_api_db_files_get_with_http_info(opts = {})
471
+ if @api_client.config.debugging
472
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.list_files_api_db_files_get ...'
473
+ end
474
+ # resource path
475
+ local_var_path = '/api/db/files'
476
+
477
+ # query parameters
478
+ query_params = opts[:query_params] || {}
479
+
480
+ # header parameters
481
+ header_params = opts[:header_params] || {}
482
+ # HTTP header 'Accept' (if needed)
483
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
484
+
485
+ # form parameters
486
+ form_params = opts[:form_params] || {}
487
+
488
+ # http body (model)
489
+ post_body = opts[:debug_body]
490
+
491
+ # return_type
492
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
493
+
494
+ # auth_names
495
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
496
+
497
+ new_options = opts.merge(
498
+ :operation => :"DatabaseApi.list_files_api_db_files_get",
499
+ :header_params => header_params,
500
+ :query_params => query_params,
501
+ :form_params => form_params,
502
+ :body => post_body,
503
+ :auth_names => auth_names,
504
+ :return_type => return_type
505
+ )
506
+
507
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
508
+ if @api_client.config.debugging
509
+ @api_client.config.logger.debug "API called: DatabaseApi#list_files_api_db_files_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
510
+ end
511
+ return data, status_code, headers
512
+ end
513
+
514
+ # Scan Directory
515
+ # Scan directory for safetensor files and add to database.
516
+ # @param scan_request [ScanRequest]
517
+ # @param [Hash] opts the optional parameters
518
+ # @return [Hash<String, Object>]
519
+ def scan_directory_api_db_scan_post(scan_request, opts = {})
520
+ data, _status_code, _headers = scan_directory_api_db_scan_post_with_http_info(scan_request, opts)
521
+ data
522
+ end
523
+
524
+ # Scan Directory
525
+ # Scan directory for safetensor files and add to database.
526
+ # @param scan_request [ScanRequest]
527
+ # @param [Hash] opts the optional parameters
528
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
529
+ def scan_directory_api_db_scan_post_with_http_info(scan_request, opts = {})
530
+ if @api_client.config.debugging
531
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.scan_directory_api_db_scan_post ...'
532
+ end
533
+ # verify the required parameter 'scan_request' is set
534
+ if @api_client.config.client_side_validation && scan_request.nil?
535
+ fail ArgumentError, "Missing the required parameter 'scan_request' when calling DatabaseApi.scan_directory_api_db_scan_post"
536
+ end
537
+ # resource path
538
+ local_var_path = '/api/db/scan'
539
+
540
+ # query parameters
541
+ query_params = opts[:query_params] || {}
542
+
543
+ # header parameters
544
+ header_params = opts[:header_params] || {}
545
+ # HTTP header 'Accept' (if needed)
546
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
547
+ # HTTP header 'Content-Type'
548
+ content_type = @api_client.select_header_content_type(['application/json'])
549
+ if !content_type.nil?
550
+ header_params['Content-Type'] = content_type
551
+ end
552
+
553
+ # form parameters
554
+ form_params = opts[:form_params] || {}
555
+
556
+ # http body (model)
557
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(scan_request)
558
+
559
+ # return_type
560
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
561
+
562
+ # auth_names
563
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
564
+
565
+ new_options = opts.merge(
566
+ :operation => :"DatabaseApi.scan_directory_api_db_scan_post",
567
+ :header_params => header_params,
568
+ :query_params => query_params,
569
+ :form_params => form_params,
570
+ :body => post_body,
571
+ :auth_names => auth_names,
572
+ :return_type => return_type
573
+ )
574
+
575
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
576
+ if @api_client.config.debugging
577
+ @api_client.config.logger.debug "API called: DatabaseApi#scan_directory_api_db_scan_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
578
+ end
579
+ return data, status_code, headers
580
+ end
581
+
582
+ # Search Models
583
+ # Search cached models offline.
584
+ # @param [Hash] opts the optional parameters
585
+ # @option opts [String] :query Search query
586
+ # @option opts [String] :type Model type filter
587
+ # @option opts [String] :base Base model filter
588
+ # @option opts [Integer] :limit Max results (default to 20)
589
+ # @return [Array<Hash<String, Object>>]
590
+ def search_models_api_db_models_get(opts = {})
591
+ data, _status_code, _headers = search_models_api_db_models_get_with_http_info(opts)
592
+ data
593
+ end
594
+
595
+ # Search Models
596
+ # Search cached models offline.
597
+ # @param [Hash] opts the optional parameters
598
+ # @option opts [String] :query Search query
599
+ # @option opts [String] :type Model type filter
600
+ # @option opts [String] :base Base model filter
601
+ # @option opts [Integer] :limit Max results (default to 20)
602
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
603
+ def search_models_api_db_models_get_with_http_info(opts = {})
604
+ if @api_client.config.debugging
605
+ @api_client.config.logger.debug 'Calling API: DatabaseApi.search_models_api_db_models_get ...'
606
+ end
607
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
608
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DatabaseApi.search_models_api_db_models_get, must be smaller than or equal to 100.'
609
+ end
610
+
611
+ # resource path
612
+ local_var_path = '/api/db/models'
613
+
614
+ # query parameters
615
+ query_params = opts[:query_params] || {}
616
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
617
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
618
+ query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?
619
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
620
+
621
+ # header parameters
622
+ header_params = opts[:header_params] || {}
623
+ # HTTP header 'Accept' (if needed)
624
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
625
+
626
+ # form parameters
627
+ form_params = opts[:form_params] || {}
628
+
629
+ # http body (model)
630
+ post_body = opts[:debug_body]
631
+
632
+ # return_type
633
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
634
+
635
+ # auth_names
636
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
637
+
638
+ new_options = opts.merge(
639
+ :operation => :"DatabaseApi.search_models_api_db_models_get",
640
+ :header_params => header_params,
641
+ :query_params => query_params,
642
+ :form_params => form_params,
643
+ :body => post_body,
644
+ :auth_names => auth_names,
645
+ :return_type => return_type
646
+ )
647
+
648
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
649
+ if @api_client.config.debugging
650
+ @api_client.config.logger.debug "API called: DatabaseApi#search_models_api_db_models_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
651
+ end
652
+ return data, status_code, headers
653
+ end
654
+ end
655
+ end