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,389 @@
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 ImageDownloadJobSchema
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :download_url
21
+
22
+ attr_accessor :environment_id
23
+
24
+ attr_accessor :id
25
+
26
+ attr_accessor :image_ids
27
+
28
+ attr_accessor :status
29
+
30
+ attr_accessor :updated_at
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'created_at' => :'created_at',
58
+ :'download_url' => :'download_url',
59
+ :'environment_id' => :'environment_id',
60
+ :'id' => :'id',
61
+ :'image_ids' => :'image_ids',
62
+ :'status' => :'status',
63
+ :'updated_at' => :'updated_at'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'created_at' => :'Time',
81
+ :'download_url' => :'String',
82
+ :'environment_id' => :'String',
83
+ :'id' => :'String',
84
+ :'image_ids' => :'Array<String>',
85
+ :'status' => :'ImageDownloadStatus',
86
+ :'updated_at' => :'Time'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ :'download_url',
94
+ :'environment_id',
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ImgwireGenerated::ImageDownloadJobSchema` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ acceptable_attribute_map = self.class.acceptable_attribute_map
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!acceptable_attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ImgwireGenerated::ImageDownloadJobSchema`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'created_at')
115
+ self.created_at = attributes[:'created_at']
116
+ else
117
+ self.created_at = nil
118
+ end
119
+
120
+ if attributes.key?(:'download_url')
121
+ self.download_url = attributes[:'download_url']
122
+ else
123
+ self.download_url = nil
124
+ end
125
+
126
+ if attributes.key?(:'environment_id')
127
+ self.environment_id = attributes[:'environment_id']
128
+ else
129
+ self.environment_id = nil
130
+ end
131
+
132
+ if attributes.key?(:'id')
133
+ self.id = attributes[:'id']
134
+ else
135
+ self.id = nil
136
+ end
137
+
138
+ if attributes.key?(:'image_ids')
139
+ if (value = attributes[:'image_ids']).is_a?(Array)
140
+ self.image_ids = value
141
+ end
142
+ else
143
+ self.image_ids = nil
144
+ end
145
+
146
+ if attributes.key?(:'status')
147
+ self.status = attributes[:'status']
148
+ else
149
+ self.status = nil
150
+ end
151
+
152
+ if attributes.key?(:'updated_at')
153
+ self.updated_at = attributes[:'updated_at']
154
+ else
155
+ self.updated_at = nil
156
+ end
157
+ end
158
+
159
+ # Show invalid properties with the reasons. Usually used together with valid?
160
+ # @return Array for valid properties with the reasons
161
+ def list_invalid_properties
162
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
163
+ invalid_properties = Array.new
164
+ if @created_at.nil?
165
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
166
+ end
167
+
168
+ if @id.nil?
169
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
170
+ end
171
+
172
+ if @image_ids.nil?
173
+ invalid_properties.push('invalid value for "image_ids", image_ids cannot be nil.')
174
+ end
175
+
176
+ if @status.nil?
177
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
178
+ end
179
+
180
+ if @updated_at.nil?
181
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
182
+ end
183
+
184
+ invalid_properties
185
+ end
186
+
187
+ # Check to see if the all the properties in the model are valid
188
+ # @return true if the model is valid
189
+ def valid?
190
+ warn '[DEPRECATED] the `valid?` method is obsolete'
191
+ return false if @created_at.nil?
192
+ return false if @id.nil?
193
+ return false if @image_ids.nil?
194
+ return false if @status.nil?
195
+ return false if @updated_at.nil?
196
+ true
197
+ end
198
+
199
+ # Custom attribute writer method with validation
200
+ # @param [Object] created_at Value to be assigned
201
+ def created_at=(created_at)
202
+ if created_at.nil?
203
+ fail ArgumentError, 'created_at cannot be nil'
204
+ end
205
+
206
+ @created_at = created_at
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] id Value to be assigned
211
+ def id=(id)
212
+ if id.nil?
213
+ fail ArgumentError, 'id cannot be nil'
214
+ end
215
+
216
+ @id = id
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] image_ids Value to be assigned
221
+ def image_ids=(image_ids)
222
+ if image_ids.nil?
223
+ fail ArgumentError, 'image_ids cannot be nil'
224
+ end
225
+
226
+ @image_ids = image_ids
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] status Value to be assigned
231
+ def status=(status)
232
+ if status.nil?
233
+ fail ArgumentError, 'status cannot be nil'
234
+ end
235
+
236
+ @status = status
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] updated_at Value to be assigned
241
+ def updated_at=(updated_at)
242
+ if updated_at.nil?
243
+ fail ArgumentError, 'updated_at cannot be nil'
244
+ end
245
+
246
+ @updated_at = updated_at
247
+ end
248
+
249
+ # Checks equality by comparing each attribute.
250
+ # @param [Object] Object to be compared
251
+ def ==(o)
252
+ return true if self.equal?(o)
253
+ self.class == o.class &&
254
+ created_at == o.created_at &&
255
+ download_url == o.download_url &&
256
+ environment_id == o.environment_id &&
257
+ id == o.id &&
258
+ image_ids == o.image_ids &&
259
+ status == o.status &&
260
+ updated_at == o.updated_at
261
+ end
262
+
263
+ # @see the `==` method
264
+ # @param [Object] Object to be compared
265
+ def eql?(o)
266
+ self == o
267
+ end
268
+
269
+ # Calculates hash code according to all attributes.
270
+ # @return [Integer] Hash code
271
+ def hash
272
+ [created_at, download_url, environment_id, id, image_ids, status, updated_at].hash
273
+ end
274
+
275
+ # Builds the object from hash
276
+ # @param [Hash] attributes Model attributes in the form of hash
277
+ # @return [Object] Returns the model itself
278
+ def self.build_from_hash(attributes)
279
+ return nil unless attributes.is_a?(Hash)
280
+ attributes = attributes.transform_keys(&:to_sym)
281
+ transformed_hash = {}
282
+ openapi_types.each_pair do |key, type|
283
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
284
+ transformed_hash["#{key}"] = nil
285
+ elsif type =~ /\AArray<(.*)>/i
286
+ # check to ensure the input is an array given that the attribute
287
+ # is documented as an array but the input is not
288
+ if attributes[attribute_map[key]].is_a?(Array)
289
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
290
+ end
291
+ elsif !attributes[attribute_map[key]].nil?
292
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
293
+ end
294
+ end
295
+ new(transformed_hash)
296
+ end
297
+
298
+ # Deserializes the data based on type
299
+ # @param string type Data type
300
+ # @param string value Value to be deserialized
301
+ # @return [Object] Deserialized data
302
+ def self._deserialize(type, value)
303
+ case type.to_sym
304
+ when :Time
305
+ Time.parse(value)
306
+ when :Date
307
+ Date.parse(value)
308
+ when :String
309
+ value.to_s
310
+ when :Integer
311
+ value.to_i
312
+ when :Float
313
+ value.to_f
314
+ when :Boolean
315
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
316
+ true
317
+ else
318
+ false
319
+ end
320
+ when :Object
321
+ # generic object (usually a Hash), return directly
322
+ value
323
+ when /\AArray<(?<inner_type>.+)>\z/
324
+ inner_type = Regexp.last_match[:inner_type]
325
+ value.map { |v| _deserialize(inner_type, v) }
326
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
327
+ k_type = Regexp.last_match[:k_type]
328
+ v_type = Regexp.last_match[:v_type]
329
+ {}.tap do |hash|
330
+ value.each do |k, v|
331
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
332
+ end
333
+ end
334
+ else # model
335
+ # models (e.g. Pet) or oneOf
336
+ klass = ImgwireGenerated.const_get(type)
337
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
338
+ end
339
+ end
340
+
341
+ # Returns the string representation of the object
342
+ # @return [String] String presentation of the object
343
+ def to_s
344
+ to_hash.to_s
345
+ end
346
+
347
+ # to_body is an alias to to_hash (backward compatibility)
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_body
350
+ to_hash
351
+ end
352
+
353
+ # Returns the object in the form of hash
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_hash
356
+ hash = {}
357
+ self.class.attribute_map.each_pair do |attr, param|
358
+ value = self.send(attr)
359
+ if value.nil?
360
+ is_nullable = self.class.openapi_nullable.include?(attr)
361
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
362
+ end
363
+
364
+ hash[param] = _to_hash(value)
365
+ end
366
+ hash
367
+ end
368
+
369
+ # Outputs non-array value in the form of hash
370
+ # For object, use to_hash. Otherwise, just return the value
371
+ # @param [Object] value Any valid value
372
+ # @return [Hash] Returns the value in the form of hash
373
+ def _to_hash(value)
374
+ if value.is_a?(Array)
375
+ value.compact.map { |v| _to_hash(v) }
376
+ elsif value.is_a?(Hash)
377
+ {}.tap do |hash|
378
+ value.each { |k, v| hash[k] = _to_hash(v) }
379
+ end
380
+ elsif value.respond_to? :to_hash
381
+ value.to_hash
382
+ else
383
+ value
384
+ end
385
+ end
386
+
387
+ end
388
+
389
+ end
@@ -0,0 +1,42 @@
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 ImageDownloadStatus
18
+ PENDING = "PENDING".freeze
19
+ PROCESSING = "PROCESSING".freeze
20
+ READY = "READY".freeze
21
+ FAILED = "FAILED".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [PENDING, PROCESSING, READY, FAILED].freeze
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ return value if ImageDownloadStatus.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #ImageDownloadStatus"
40
+ end
41
+ end
42
+ end