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,161 @@
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 'date'
14
+ require 'time'
15
+
16
+ module TensorsApi
17
+ # System stats response.
18
+ class SystemStatsResponse < ApiModelBase
19
+ attr_accessor :system
20
+
21
+ attr_accessor :devices
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'system' => :'system',
27
+ :'devices' => :'devices'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'system' => :'Hash<String, Object>',
45
+ :'devices' => :'Array<Hash<String, Object>>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TensorsApi::SystemStatsResponse` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TensorsApi::SystemStatsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'system')
72
+ if (value = attributes[:'system']).is_a?(Hash)
73
+ self.system = value
74
+ end
75
+ end
76
+
77
+ if attributes.key?(:'devices')
78
+ if (value = attributes[:'devices']).is_a?(Array)
79
+ self.devices = value
80
+ end
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ warn '[DEPRECATED] the `valid?` method is obsolete'
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ system == o.system &&
105
+ devices == o.devices
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [system, devices].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ transformed_hash = {}
127
+ openapi_types.each_pair do |key, type|
128
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = nil
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[attribute_map[key]].is_a?(Array)
134
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
135
+ end
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Returns the object in the form of hash
144
+ # @return [Hash] Returns the object in the form of hash
145
+ def to_hash
146
+ hash = {}
147
+ self.class.attribute_map.each_pair do |attr, param|
148
+ value = self.send(attr)
149
+ if value.nil?
150
+ is_nullable = self.class.openapi_nullable.include?(attr)
151
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
152
+ end
153
+
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ end
160
+
161
+ end
@@ -0,0 +1,237 @@
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 'date'
14
+ require 'time'
15
+
16
+ module TensorsApi
17
+ class ValidationError < ApiModelBase
18
+ attr_accessor :loc
19
+
20
+ attr_accessor :msg
21
+
22
+ attr_accessor :type
23
+
24
+ attr_accessor :input
25
+
26
+ attr_accessor :ctx
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'loc' => :'loc',
32
+ :'msg' => :'msg',
33
+ :'type' => :'type',
34
+ :'input' => :'input',
35
+ :'ctx' => :'ctx'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'loc' => :'Array<LocationInner>',
53
+ :'msg' => :'String',
54
+ :'type' => :'String',
55
+ :'input' => :'Object',
56
+ :'ctx' => :'Object'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'input',
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TensorsApi::ValidationError` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TensorsApi::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'loc')
84
+ if (value = attributes[:'loc']).is_a?(Array)
85
+ self.loc = value
86
+ end
87
+ else
88
+ self.loc = nil
89
+ end
90
+
91
+ if attributes.key?(:'msg')
92
+ self.msg = attributes[:'msg']
93
+ else
94
+ self.msg = nil
95
+ end
96
+
97
+ if attributes.key?(:'type')
98
+ self.type = attributes[:'type']
99
+ else
100
+ self.type = nil
101
+ end
102
+
103
+ if attributes.key?(:'input')
104
+ self.input = attributes[:'input']
105
+ end
106
+
107
+ if attributes.key?(:'ctx')
108
+ self.ctx = attributes[:'ctx']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @loc.nil?
118
+ invalid_properties.push('invalid value for "loc", loc cannot be nil.')
119
+ end
120
+
121
+ if @msg.nil?
122
+ invalid_properties.push('invalid value for "msg", msg cannot be nil.')
123
+ end
124
+
125
+ if @type.nil?
126
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ return false if @loc.nil?
137
+ return false if @msg.nil?
138
+ return false if @type.nil?
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] loc Value to be assigned
144
+ def loc=(loc)
145
+ if loc.nil?
146
+ fail ArgumentError, 'loc cannot be nil'
147
+ end
148
+
149
+ @loc = loc
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] msg Value to be assigned
154
+ def msg=(msg)
155
+ if msg.nil?
156
+ fail ArgumentError, 'msg cannot be nil'
157
+ end
158
+
159
+ @msg = msg
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] type Value to be assigned
164
+ def type=(type)
165
+ if type.nil?
166
+ fail ArgumentError, 'type cannot be nil'
167
+ end
168
+
169
+ @type = type
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ loc == o.loc &&
178
+ msg == o.msg &&
179
+ type == o.type &&
180
+ input == o.input &&
181
+ ctx == o.ctx
182
+ end
183
+
184
+ # @see the `==` method
185
+ # @param [Object] Object to be compared
186
+ def eql?(o)
187
+ self == o
188
+ end
189
+
190
+ # Calculates hash code according to all attributes.
191
+ # @return [Integer] Hash code
192
+ def hash
193
+ [loc, msg, type, input, ctx].hash
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def self.build_from_hash(attributes)
200
+ return nil unless attributes.is_a?(Hash)
201
+ attributes = attributes.transform_keys(&:to_sym)
202
+ transformed_hash = {}
203
+ openapi_types.each_pair do |key, type|
204
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
205
+ transformed_hash["#{key}"] = nil
206
+ elsif type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[attribute_map[key]].is_a?(Array)
210
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
211
+ end
212
+ elsif !attributes[attribute_map[key]].nil?
213
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
214
+ end
215
+ end
216
+ new(transformed_hash)
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -0,0 +1,168 @@
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 'date'
14
+ require 'time'
15
+
16
+ module TensorsApi
17
+ # Request body for running arbitrary workflow.
18
+ class WorkflowRequest < ApiModelBase
19
+ # ComfyUI API-format workflow
20
+ attr_accessor :workflow
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'workflow' => :'workflow'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'workflow' => :'Hash<String, Object>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TensorsApi::WorkflowRequest` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TensorsApi::WorkflowRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'workflow')
69
+ if (value = attributes[:'workflow']).is_a?(Hash)
70
+ self.workflow = value
71
+ end
72
+ else
73
+ self.workflow = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @workflow.nil?
83
+ invalid_properties.push('invalid value for "workflow", workflow cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @workflow.nil?
94
+ true
95
+ end
96
+
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] workflow Value to be assigned
99
+ def workflow=(workflow)
100
+ if workflow.nil?
101
+ fail ArgumentError, 'workflow cannot be nil'
102
+ end
103
+
104
+ @workflow = workflow
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ workflow == o.workflow
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [workflow].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end