daytona_api_client 0.126.0.pre.alpha.5 → 0.134.0.alpha.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +23 -0
  3. data/.openapi-generator-ignore +0 -2
  4. data/daytona_api_client.gemspec +1 -1
  5. data/fix-gemspec.sh +1 -1
  6. data/lib/daytona_api_client/api/admin_api.rb +325 -0
  7. data/lib/daytona_api_client/api/docker_registry_api.rb +3 -0
  8. data/lib/daytona_api_client/api/jobs_api.rb +299 -0
  9. data/lib/daytona_api_client/api/organizations_api.rb +518 -0
  10. data/lib/daytona_api_client/api/preview_api.rb +67 -0
  11. data/lib/daytona_api_client/api/regions_api.rb +9 -15
  12. data/lib/daytona_api_client/api/runners_api.rb +291 -23
  13. data/lib/daytona_api_client/api/sandbox_api.rb +277 -0
  14. data/lib/daytona_api_client/api/snapshots_api.rb +66 -0
  15. data/lib/daytona_api_client/models/admin_create_runner.rb +385 -0
  16. data/lib/daytona_api_client/models/build_info.rb +31 -4
  17. data/lib/daytona_api_client/models/create_region.rb +269 -0
  18. data/lib/daytona_api_client/models/create_region_response.rb +280 -0
  19. data/lib/daytona_api_client/models/create_runner.rb +31 -315
  20. data/lib/daytona_api_client/models/create_runner_response.rb +263 -0
  21. data/lib/daytona_api_client/models/create_snapshot.rb +14 -4
  22. data/lib/daytona_api_client/models/{create_audit_log.rb → job.rb} +166 -79
  23. data/lib/daytona_api_client/models/job_status.rb +42 -0
  24. data/lib/daytona_api_client/models/job_type.rb +49 -0
  25. data/lib/daytona_api_client/models/{paginated_snapshots_dto.rb → paginated_jobs.rb} +4 -4
  26. data/lib/daytona_api_client/models/poll_jobs_response.rb +238 -0
  27. data/lib/daytona_api_client/models/regenerate_api_key_response.rb +236 -0
  28. data/lib/daytona_api_client/models/region.rb +86 -4
  29. data/lib/daytona_api_client/models/region_type.rb +41 -0
  30. data/lib/daytona_api_client/models/runner.rb +79 -117
  31. data/lib/daytona_api_client/models/runner_full.rb +779 -0
  32. data/lib/daytona_api_client/models/runner_health_metrics.rb +533 -0
  33. data/lib/daytona_api_client/models/runner_healthcheck.rb +276 -0
  34. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +0 -17
  35. data/lib/daytona_api_client/models/sandbox.rb +14 -4
  36. data/lib/daytona_api_client/models/signed_port_preview_url.rb +317 -0
  37. data/lib/daytona_api_client/models/snapshot_dto.rb +36 -4
  38. data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +263 -0
  39. data/lib/daytona_api_client/models/ssh_access_dto.rb +31 -4
  40. data/lib/daytona_api_client/models/toolbox_proxy_url.rb +236 -0
  41. data/lib/daytona_api_client/models/update_job_status.rb +278 -0
  42. data/lib/daytona_api_client/models/update_region.rb +242 -0
  43. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +14 -4
  44. data/lib/daytona_api_client/models/url.rb +236 -0
  45. data/lib/daytona_api_client/models/workspace.rb +11 -1
  46. data/lib/daytona_api_client/version.rb +1 -1
  47. data/lib/daytona_api_client.rb +22 -0
  48. data/project.json +10 -4
  49. metadata +23 -5
  50. data/Gemfile +0 -9
  51. data/Gemfile.lock +0 -101
@@ -0,0 +1,385 @@
1
+ =begin
2
+ #Daytona
3
+
4
+ #Daytona AI platform API Docs
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@daytona.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class AdminCreateRunner
18
+ attr_accessor :region_id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :api_key
23
+
24
+ # The api version of the runner to create
25
+ attr_accessor :api_version
26
+
27
+ # The domain of the runner
28
+ attr_accessor :domain
29
+
30
+ # The API URL of the runner
31
+ attr_accessor :api_url
32
+
33
+ # The proxy URL of the runner
34
+ attr_accessor :proxy_url
35
+
36
+ # The CPU capacity of the runner
37
+ attr_accessor :cpu
38
+
39
+ # The memory capacity of the runner in GiB
40
+ attr_accessor :memory_gi_b
41
+
42
+ # The disk capacity of the runner in GiB
43
+ attr_accessor :disk_gi_b
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'region_id' => :'regionId',
49
+ :'name' => :'name',
50
+ :'api_key' => :'apiKey',
51
+ :'api_version' => :'apiVersion',
52
+ :'domain' => :'domain',
53
+ :'api_url' => :'apiUrl',
54
+ :'proxy_url' => :'proxyUrl',
55
+ :'cpu' => :'cpu',
56
+ :'memory_gi_b' => :'memoryGiB',
57
+ :'disk_gi_b' => :'diskGiB'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'region_id' => :'String',
75
+ :'name' => :'String',
76
+ :'api_key' => :'String',
77
+ :'api_version' => :'String',
78
+ :'domain' => :'String',
79
+ :'api_url' => :'String',
80
+ :'proxy_url' => :'String',
81
+ :'cpu' => :'Float',
82
+ :'memory_gi_b' => :'Float',
83
+ :'disk_gi_b' => :'Float'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ ])
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ if (!attributes.is_a?(Hash))
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::AdminCreateRunner` initialize method"
98
+ end
99
+
100
+ # check to see if the attribute exists and convert string to symbol for hash key
101
+ acceptable_attribute_map = self.class.acceptable_attribute_map
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!acceptable_attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::AdminCreateRunner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'region_id')
110
+ self.region_id = attributes[:'region_id']
111
+ else
112
+ self.region_id = nil
113
+ end
114
+
115
+ if attributes.key?(:'name')
116
+ self.name = attributes[:'name']
117
+ else
118
+ self.name = nil
119
+ end
120
+
121
+ if attributes.key?(:'api_key')
122
+ self.api_key = attributes[:'api_key']
123
+ else
124
+ self.api_key = nil
125
+ end
126
+
127
+ if attributes.key?(:'api_version')
128
+ self.api_version = attributes[:'api_version']
129
+ else
130
+ self.api_version = nil
131
+ end
132
+
133
+ if attributes.key?(:'domain')
134
+ self.domain = attributes[:'domain']
135
+ end
136
+
137
+ if attributes.key?(:'api_url')
138
+ self.api_url = attributes[:'api_url']
139
+ end
140
+
141
+ if attributes.key?(:'proxy_url')
142
+ self.proxy_url = attributes[:'proxy_url']
143
+ end
144
+
145
+ if attributes.key?(:'cpu')
146
+ self.cpu = attributes[:'cpu']
147
+ end
148
+
149
+ if attributes.key?(:'memory_gi_b')
150
+ self.memory_gi_b = attributes[:'memory_gi_b']
151
+ end
152
+
153
+ if attributes.key?(:'disk_gi_b')
154
+ self.disk_gi_b = attributes[:'disk_gi_b']
155
+ end
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properties with the reasons
160
+ def list_invalid_properties
161
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
162
+ invalid_properties = Array.new
163
+ if @region_id.nil?
164
+ invalid_properties.push('invalid value for "region_id", region_id cannot be nil.')
165
+ end
166
+
167
+ if @name.nil?
168
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
169
+ end
170
+
171
+ if @api_key.nil?
172
+ invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
173
+ end
174
+
175
+ if @api_version.nil?
176
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
177
+ end
178
+
179
+ pattern = Regexp.new(/^(0|2)$/)
180
+ if @api_version !~ pattern
181
+ invalid_properties.push("invalid value for \"api_version\", must conform to the pattern #{pattern}.")
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 @region_id.nil?
192
+ return false if @name.nil?
193
+ return false if @api_key.nil?
194
+ return false if @api_version.nil?
195
+ return false if @api_version !~ Regexp.new(/^(0|2)$/)
196
+ true
197
+ end
198
+
199
+ # Custom attribute writer method with validation
200
+ # @param [Object] region_id Value to be assigned
201
+ def region_id=(region_id)
202
+ if region_id.nil?
203
+ fail ArgumentError, 'region_id cannot be nil'
204
+ end
205
+
206
+ @region_id = region_id
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] name Value to be assigned
211
+ def name=(name)
212
+ if name.nil?
213
+ fail ArgumentError, 'name cannot be nil'
214
+ end
215
+
216
+ @name = name
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] api_key Value to be assigned
221
+ def api_key=(api_key)
222
+ if api_key.nil?
223
+ fail ArgumentError, 'api_key cannot be nil'
224
+ end
225
+
226
+ @api_key = api_key
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] api_version Value to be assigned
231
+ def api_version=(api_version)
232
+ if api_version.nil?
233
+ fail ArgumentError, 'api_version cannot be nil'
234
+ end
235
+
236
+ pattern = Regexp.new(/^(0|2)$/)
237
+ if api_version !~ pattern
238
+ fail ArgumentError, "invalid value for \"api_version\", must conform to the pattern #{pattern}."
239
+ end
240
+
241
+ @api_version = api_version
242
+ end
243
+
244
+ # Checks equality by comparing each attribute.
245
+ # @param [Object] Object to be compared
246
+ def ==(o)
247
+ return true if self.equal?(o)
248
+ self.class == o.class &&
249
+ region_id == o.region_id &&
250
+ name == o.name &&
251
+ api_key == o.api_key &&
252
+ api_version == o.api_version &&
253
+ domain == o.domain &&
254
+ api_url == o.api_url &&
255
+ proxy_url == o.proxy_url &&
256
+ cpu == o.cpu &&
257
+ memory_gi_b == o.memory_gi_b &&
258
+ disk_gi_b == o.disk_gi_b
259
+ end
260
+
261
+ # @see the `==` method
262
+ # @param [Object] Object to be compared
263
+ def eql?(o)
264
+ self == o
265
+ end
266
+
267
+ # Calculates hash code according to all attributes.
268
+ # @return [Integer] Hash code
269
+ def hash
270
+ [region_id, name, api_key, api_version, domain, api_url, proxy_url, cpu, memory_gi_b, disk_gi_b].hash
271
+ end
272
+
273
+ # Builds the object from hash
274
+ # @param [Hash] attributes Model attributes in the form of hash
275
+ # @return [Object] Returns the model itself
276
+ def self.build_from_hash(attributes)
277
+ return nil unless attributes.is_a?(Hash)
278
+ attributes = attributes.transform_keys(&:to_sym)
279
+ transformed_hash = {}
280
+ openapi_types.each_pair do |key, type|
281
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = nil
283
+ elsif type =~ /\AArray<(.*)>/i
284
+ # check to ensure the input is an array given that the attribute
285
+ # is documented as an array but the input is not
286
+ if attributes[attribute_map[key]].is_a?(Array)
287
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
288
+ end
289
+ elsif !attributes[attribute_map[key]].nil?
290
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
291
+ end
292
+ end
293
+ new(transformed_hash)
294
+ end
295
+
296
+ # Deserializes the data based on type
297
+ # @param string type Data type
298
+ # @param string value Value to be deserialized
299
+ # @return [Object] Deserialized data
300
+ def self._deserialize(type, value)
301
+ case type.to_sym
302
+ when :Time
303
+ Time.parse(value)
304
+ when :Date
305
+ Date.parse(value)
306
+ when :String
307
+ value.to_s
308
+ when :Integer
309
+ value.to_i
310
+ when :Float
311
+ value.to_f
312
+ when :Boolean
313
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
314
+ true
315
+ else
316
+ false
317
+ end
318
+ when :Object
319
+ # generic object (usually a Hash), return directly
320
+ value
321
+ when /\AArray<(?<inner_type>.+)>\z/
322
+ inner_type = Regexp.last_match[:inner_type]
323
+ value.map { |v| _deserialize(inner_type, v) }
324
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
325
+ k_type = Regexp.last_match[:k_type]
326
+ v_type = Regexp.last_match[:v_type]
327
+ {}.tap do |hash|
328
+ value.each do |k, v|
329
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
330
+ end
331
+ end
332
+ else # model
333
+ # models (e.g. Pet) or oneOf
334
+ klass = DaytonaApiClient.const_get(type)
335
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
336
+ end
337
+ end
338
+
339
+ # Returns the string representation of the object
340
+ # @return [String] String presentation of the object
341
+ def to_s
342
+ to_hash.to_s
343
+ end
344
+
345
+ # to_body is an alias to to_hash (backward compatibility)
346
+ # @return [Hash] Returns the object in the form of hash
347
+ def to_body
348
+ to_hash
349
+ end
350
+
351
+ # Returns the object in the form of hash
352
+ # @return [Hash] Returns the object in the form of hash
353
+ def to_hash
354
+ hash = {}
355
+ self.class.attribute_map.each_pair do |attr, param|
356
+ value = self.send(attr)
357
+ if value.nil?
358
+ is_nullable = self.class.openapi_nullable.include?(attr)
359
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
360
+ end
361
+
362
+ hash[param] = _to_hash(value)
363
+ end
364
+ hash
365
+ end
366
+
367
+ # Outputs non-array value in the form of hash
368
+ # For object, use to_hash. Otherwise, just return the value
369
+ # @param [Object] value Any valid value
370
+ # @return [Hash] Returns the value in the form of hash
371
+ def _to_hash(value)
372
+ if value.is_a?(Array)
373
+ value.compact.map { |v| _to_hash(v) }
374
+ elsif value.is_a?(Hash)
375
+ {}.tap do |hash|
376
+ value.each { |k, v| hash[k] = _to_hash(v) }
377
+ end
378
+ elsif value.respond_to? :to_hash
379
+ value.to_hash
380
+ else
381
+ value
382
+ end
383
+ end
384
+ end
385
+ end
@@ -27,13 +27,17 @@ module DaytonaApiClient
27
27
  # The last update timestamp
28
28
  attr_accessor :updated_at
29
29
 
30
+ # The snapshot reference
31
+ attr_accessor :snapshot_ref
32
+
30
33
  # Attribute mapping from ruby-style variable name to JSON key.
31
34
  def self.attribute_map
32
35
  {
33
36
  :'dockerfile_content' => :'dockerfileContent',
34
37
  :'context_hashes' => :'contextHashes',
35
38
  :'created_at' => :'createdAt',
36
- :'updated_at' => :'updatedAt'
39
+ :'updated_at' => :'updatedAt',
40
+ :'snapshot_ref' => :'snapshotRef'
37
41
  }
38
42
  end
39
43
 
@@ -53,7 +57,8 @@ module DaytonaApiClient
53
57
  :'dockerfile_content' => :'String',
54
58
  :'context_hashes' => :'Array<String>',
55
59
  :'created_at' => :'Time',
56
- :'updated_at' => :'Time'
60
+ :'updated_at' => :'Time',
61
+ :'snapshot_ref' => :'String'
57
62
  }
58
63
  end
59
64
 
@@ -100,6 +105,12 @@ module DaytonaApiClient
100
105
  else
101
106
  self.updated_at = nil
102
107
  end
108
+
109
+ if attributes.key?(:'snapshot_ref')
110
+ self.snapshot_ref = attributes[:'snapshot_ref']
111
+ else
112
+ self.snapshot_ref = nil
113
+ end
103
114
  end
104
115
 
105
116
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -115,6 +126,10 @@ module DaytonaApiClient
115
126
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
116
127
  end
117
128
 
129
+ if @snapshot_ref.nil?
130
+ invalid_properties.push('invalid value for "snapshot_ref", snapshot_ref cannot be nil.')
131
+ end
132
+
118
133
  invalid_properties
119
134
  end
120
135
 
@@ -124,6 +139,7 @@ module DaytonaApiClient
124
139
  warn '[DEPRECATED] the `valid?` method is obsolete'
125
140
  return false if @created_at.nil?
126
141
  return false if @updated_at.nil?
142
+ return false if @snapshot_ref.nil?
127
143
  true
128
144
  end
129
145
 
@@ -147,6 +163,16 @@ module DaytonaApiClient
147
163
  @updated_at = updated_at
148
164
  end
149
165
 
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] snapshot_ref Value to be assigned
168
+ def snapshot_ref=(snapshot_ref)
169
+ if snapshot_ref.nil?
170
+ fail ArgumentError, 'snapshot_ref cannot be nil'
171
+ end
172
+
173
+ @snapshot_ref = snapshot_ref
174
+ end
175
+
150
176
  # Checks equality by comparing each attribute.
151
177
  # @param [Object] Object to be compared
152
178
  def ==(o)
@@ -155,7 +181,8 @@ module DaytonaApiClient
155
181
  dockerfile_content == o.dockerfile_content &&
156
182
  context_hashes == o.context_hashes &&
157
183
  created_at == o.created_at &&
158
- updated_at == o.updated_at
184
+ updated_at == o.updated_at &&
185
+ snapshot_ref == o.snapshot_ref
159
186
  end
160
187
 
161
188
  # @see the `==` method
@@ -167,7 +194,7 @@ module DaytonaApiClient
167
194
  # Calculates hash code according to all attributes.
168
195
  # @return [Integer] Hash code
169
196
  def hash
170
- [dockerfile_content, context_hashes, created_at, updated_at].hash
197
+ [dockerfile_content, context_hashes, created_at, updated_at, snapshot_ref].hash
171
198
  end
172
199
 
173
200
  # Builds the object from hash