imgwire 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 (59) hide show
  1. checksums.yaml +7 -0
  2. data/AGENTS.md +8 -0
  3. data/CODEGEN_VERSION +1 -0
  4. data/LICENSE +21 -0
  5. data/README.md +159 -0
  6. data/generated/lib/imgwire-generated/api/cors_origins_api.rb +355 -0
  7. data/generated/lib/imgwire-generated/api/custom_domain_api.rb +253 -0
  8. data/generated/lib/imgwire-generated/api/images_api.rb +534 -0
  9. data/generated/lib/imgwire-generated/api/metrics_api.rb +156 -0
  10. data/generated/lib/imgwire-generated/api_client.rb +392 -0
  11. data/generated/lib/imgwire-generated/api_error.rb +58 -0
  12. data/generated/lib/imgwire-generated/configuration.rb +301 -0
  13. data/generated/lib/imgwire-generated/models/bulk_delete_images_schema.rb +248 -0
  14. data/generated/lib/imgwire-generated/models/cache_hit_ratio_dataset_point_schema.rb +263 -0
  15. data/generated/lib/imgwire-generated/models/cors_origin_create_schema.rb +246 -0
  16. data/generated/lib/imgwire-generated/models/cors_origin_schema.rb +341 -0
  17. data/generated/lib/imgwire-generated/models/cors_origin_update_schema.rb +246 -0
  18. data/generated/lib/imgwire-generated/models/custom_domain_certificate_status.rb +41 -0
  19. data/generated/lib/imgwire-generated/models/custom_domain_create_schema.rb +237 -0
  20. data/generated/lib/imgwire-generated/models/custom_domain_schema.rb +531 -0
  21. data/generated/lib/imgwire-generated/models/custom_domain_status.rb +41 -0
  22. data/generated/lib/imgwire-generated/models/custom_metadata_value.rb +106 -0
  23. data/generated/lib/imgwire-generated/models/http_validation_error.rb +222 -0
  24. data/generated/lib/imgwire-generated/models/image_download_job_create_schema.rb +248 -0
  25. data/generated/lib/imgwire-generated/models/image_download_job_schema.rb +389 -0
  26. data/generated/lib/imgwire-generated/models/image_download_status.rb +42 -0
  27. data/generated/lib/imgwire-generated/models/image_schema.rb +659 -0
  28. data/generated/lib/imgwire-generated/models/image_status.rb +42 -0
  29. data/generated/lib/imgwire-generated/models/location_inner.rb +104 -0
  30. data/generated/lib/imgwire-generated/models/metrics_dataset_interval.rb +42 -0
  31. data/generated/lib/imgwire-generated/models/metrics_datasets_schema.rb +379 -0
  32. data/generated/lib/imgwire-generated/models/metrics_stat_value_schema.rb +275 -0
  33. data/generated/lib/imgwire-generated/models/metrics_stats_schema.rb +367 -0
  34. data/generated/lib/imgwire-generated/models/requests_dataset_point_schema.rb +263 -0
  35. data/generated/lib/imgwire-generated/models/standard_upload_create_schema.rb +415 -0
  36. data/generated/lib/imgwire-generated/models/standard_upload_response_schema.rb +263 -0
  37. data/generated/lib/imgwire-generated/models/storage_bytes_dataset_point_schema.rb +289 -0
  38. data/generated/lib/imgwire-generated/models/supported_mime_type.rb +43 -0
  39. data/generated/lib/imgwire-generated/models/transfer_bytes_dataset_point_schema.rb +263 -0
  40. data/generated/lib/imgwire-generated/models/transformations_dataset_point_schema.rb +263 -0
  41. data/generated/lib/imgwire-generated/models/upload_token_create_response_schema.rb +379 -0
  42. data/generated/lib/imgwire-generated/models/uploads_dataset_point_schema.rb +263 -0
  43. data/generated/lib/imgwire-generated/models/validation_error.rb +291 -0
  44. data/generated/lib/imgwire-generated/version.rb +15 -0
  45. data/generated/lib/imgwire-generated.rb +74 -0
  46. data/lib/imgwire/client.rb +52 -0
  47. data/lib/imgwire/client_options.rb +14 -0
  48. data/lib/imgwire/http/upload_client.rb +53 -0
  49. data/lib/imgwire/image.rb +137 -0
  50. data/lib/imgwire/pagination.rb +82 -0
  51. data/lib/imgwire/resources/base_resource.rb +29 -0
  52. data/lib/imgwire/resources/cors_origins_resource.rb +47 -0
  53. data/lib/imgwire/resources/custom_domain_resource.rb +30 -0
  54. data/lib/imgwire/resources/images_resource.rb +106 -0
  55. data/lib/imgwire/resources/metrics_resource.rb +24 -0
  56. data/lib/imgwire/uploads.rb +78 -0
  57. data/lib/imgwire/version.rb +5 -0
  58. data/lib/imgwire.rb +18 -0
  59. metadata +158 -0
@@ -0,0 +1,263 @@
1
+ =begin
2
+ #imgwire.dev Backend API development
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ImgwireGenerated
17
+ class StandardUploadResponseSchema
18
+ attr_accessor :image
19
+
20
+ attr_accessor :upload_url
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'image' => :'image',
26
+ :'upload_url' => :'upload_url'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'image' => :'ImageSchema',
44
+ :'upload_url' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ImgwireGenerated::StandardUploadResponseSchema` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ImgwireGenerated::StandardUploadResponseSchema`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'image')
71
+ self.image = attributes[:'image']
72
+ else
73
+ self.image = nil
74
+ end
75
+
76
+ if attributes.key?(:'upload_url')
77
+ self.upload_url = attributes[:'upload_url']
78
+ else
79
+ self.upload_url = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @image.nil?
89
+ invalid_properties.push('invalid value for "image", image cannot be nil.')
90
+ end
91
+
92
+ if @upload_url.nil?
93
+ invalid_properties.push('invalid value for "upload_url", upload_url cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @image.nil?
104
+ return false if @upload_url.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] image Value to be assigned
110
+ def image=(image)
111
+ if image.nil?
112
+ fail ArgumentError, 'image cannot be nil'
113
+ end
114
+
115
+ @image = image
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] upload_url Value to be assigned
120
+ def upload_url=(upload_url)
121
+ if upload_url.nil?
122
+ fail ArgumentError, 'upload_url cannot be nil'
123
+ end
124
+
125
+ @upload_url = upload_url
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ image == o.image &&
134
+ upload_url == o.upload_url
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [image, upload_url].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def self._deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = ImgwireGenerated.const_get(type)
211
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ end
@@ -0,0 +1,289 @@
1
+ =begin
2
+ #imgwire.dev Backend API development
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ImgwireGenerated
17
+ class StorageBytesDatasetPointSchema
18
+ attr_accessor :storage_bytes_added
19
+
20
+ attr_accessor :storage_bytes_current
21
+
22
+ attr_accessor :timestamp
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'storage_bytes_added' => :'storage_bytes_added',
28
+ :'storage_bytes_current' => :'storage_bytes_current',
29
+ :'timestamp' => :'timestamp'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'storage_bytes_added' => :'Integer',
47
+ :'storage_bytes_current' => :'Integer',
48
+ :'timestamp' => :'Time'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ImgwireGenerated::StorageBytesDatasetPointSchema` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ImgwireGenerated::StorageBytesDatasetPointSchema`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'storage_bytes_added')
75
+ self.storage_bytes_added = attributes[:'storage_bytes_added']
76
+ else
77
+ self.storage_bytes_added = nil
78
+ end
79
+
80
+ if attributes.key?(:'storage_bytes_current')
81
+ self.storage_bytes_current = attributes[:'storage_bytes_current']
82
+ else
83
+ self.storage_bytes_current = nil
84
+ end
85
+
86
+ if attributes.key?(:'timestamp')
87
+ self.timestamp = attributes[:'timestamp']
88
+ else
89
+ self.timestamp = nil
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @storage_bytes_added.nil?
99
+ invalid_properties.push('invalid value for "storage_bytes_added", storage_bytes_added cannot be nil.')
100
+ end
101
+
102
+ if @storage_bytes_current.nil?
103
+ invalid_properties.push('invalid value for "storage_bytes_current", storage_bytes_current cannot be nil.')
104
+ end
105
+
106
+ if @timestamp.nil?
107
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ return false if @storage_bytes_added.nil?
118
+ return false if @storage_bytes_current.nil?
119
+ return false if @timestamp.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] storage_bytes_added Value to be assigned
125
+ def storage_bytes_added=(storage_bytes_added)
126
+ if storage_bytes_added.nil?
127
+ fail ArgumentError, 'storage_bytes_added cannot be nil'
128
+ end
129
+
130
+ @storage_bytes_added = storage_bytes_added
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] storage_bytes_current Value to be assigned
135
+ def storage_bytes_current=(storage_bytes_current)
136
+ if storage_bytes_current.nil?
137
+ fail ArgumentError, 'storage_bytes_current cannot be nil'
138
+ end
139
+
140
+ @storage_bytes_current = storage_bytes_current
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] timestamp Value to be assigned
145
+ def timestamp=(timestamp)
146
+ if timestamp.nil?
147
+ fail ArgumentError, 'timestamp cannot be nil'
148
+ end
149
+
150
+ @timestamp = timestamp
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ storage_bytes_added == o.storage_bytes_added &&
159
+ storage_bytes_current == o.storage_bytes_current &&
160
+ timestamp == o.timestamp
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [storage_bytes_added, storage_bytes_current, timestamp].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def self._deserialize(type, value)
203
+ case type.to_sym
204
+ when :Time
205
+ Time.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ # models (e.g. Pet) or oneOf
236
+ klass = ImgwireGenerated.const_get(type)
237
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end
@@ -0,0 +1,43 @@
1
+ =begin
2
+ #imgwire.dev Backend API development
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ImgwireGenerated
17
+ class SupportedMimeType
18
+ IMAGE_JPEG = "image/jpeg".freeze
19
+ IMAGE_PNG = "image/png".freeze
20
+ IMAGE_WEBP = "image/webp".freeze
21
+ IMAGE_AVIF = "image/avif".freeze
22
+ IMAGE_GIF = "image/gif".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [IMAGE_JPEG, IMAGE_PNG, IMAGE_WEBP, IMAGE_AVIF, IMAGE_GIF].freeze
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if SupportedMimeType.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #SupportedMimeType"
41
+ end
42
+ end
43
+ end