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,269 @@
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 CreateRegion
18
+ # Region name
19
+ attr_accessor :name
20
+
21
+ # Proxy URL for the region
22
+ attr_accessor :proxy_url
23
+
24
+ # SSH Gateway URL for the region
25
+ attr_accessor :ssh_gateway_url
26
+
27
+ # Snapshot Manager URL for the region
28
+ attr_accessor :snapshot_manager_url
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'proxy_url' => :'proxyUrl',
35
+ :'ssh_gateway_url' => :'sshGatewayUrl',
36
+ :'snapshot_manager_url' => :'snapshotManagerUrl'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'name' => :'String',
54
+ :'proxy_url' => :'String',
55
+ :'ssh_gateway_url' => :'String',
56
+ :'snapshot_manager_url' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'proxy_url',
64
+ :'ssh_gateway_url',
65
+ :'snapshot_manager_url'
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateRegion` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!acceptable_attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateRegion`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'name')
86
+ self.name = attributes[:'name']
87
+ else
88
+ self.name = nil
89
+ end
90
+
91
+ if attributes.key?(:'proxy_url')
92
+ self.proxy_url = attributes[:'proxy_url']
93
+ end
94
+
95
+ if attributes.key?(:'ssh_gateway_url')
96
+ self.ssh_gateway_url = attributes[:'ssh_gateway_url']
97
+ end
98
+
99
+ if attributes.key?(:'snapshot_manager_url')
100
+ self.snapshot_manager_url = attributes[:'snapshot_manager_url']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @name.nil?
110
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @name.nil?
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] name Value to be assigned
126
+ def name=(name)
127
+ if name.nil?
128
+ fail ArgumentError, 'name cannot be nil'
129
+ end
130
+
131
+ @name = name
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ name == o.name &&
140
+ proxy_url == o.proxy_url &&
141
+ ssh_gateway_url == o.ssh_gateway_url &&
142
+ snapshot_manager_url == o.snapshot_manager_url
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [name, proxy_url, ssh_gateway_url, snapshot_manager_url].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
172
+ end
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
175
+ end
176
+ end
177
+ new(transformed_hash)
178
+ end
179
+
180
+ # Deserializes the data based on type
181
+ # @param string type Data type
182
+ # @param string value Value to be deserialized
183
+ # @return [Object] Deserialized data
184
+ def self._deserialize(type, value)
185
+ case type.to_sym
186
+ when :Time
187
+ Time.parse(value)
188
+ when :Date
189
+ Date.parse(value)
190
+ when :String
191
+ value.to_s
192
+ when :Integer
193
+ value.to_i
194
+ when :Float
195
+ value.to_f
196
+ when :Boolean
197
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
198
+ true
199
+ else
200
+ false
201
+ end
202
+ when :Object
203
+ # generic object (usually a Hash), return directly
204
+ value
205
+ when /\AArray<(?<inner_type>.+)>\z/
206
+ inner_type = Regexp.last_match[:inner_type]
207
+ value.map { |v| _deserialize(inner_type, v) }
208
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
209
+ k_type = Regexp.last_match[:k_type]
210
+ v_type = Regexp.last_match[:v_type]
211
+ {}.tap do |hash|
212
+ value.each do |k, v|
213
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
+ end
215
+ end
216
+ else # model
217
+ # models (e.g. Pet) or oneOf
218
+ klass = DaytonaApiClient.const_get(type)
219
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ # Returns the string representation of the object
224
+ # @return [String] String presentation of the object
225
+ def to_s
226
+ to_hash.to_s
227
+ end
228
+
229
+ # to_body is an alias to to_hash (backward compatibility)
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_body
232
+ to_hash
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ if value.nil?
242
+ is_nullable = self.class.openapi_nullable.include?(attr)
243
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
244
+ end
245
+
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ # Outputs non-array value in the form of hash
252
+ # For object, use to_hash. Otherwise, just return the value
253
+ # @param [Object] value Any valid value
254
+ # @return [Hash] Returns the value in the form of hash
255
+ def _to_hash(value)
256
+ if value.is_a?(Array)
257
+ value.compact.map { |v| _to_hash(v) }
258
+ elsif value.is_a?(Hash)
259
+ {}.tap do |hash|
260
+ value.each { |k, v| hash[k] = _to_hash(v) }
261
+ end
262
+ elsif value.respond_to? :to_hash
263
+ value.to_hash
264
+ else
265
+ value
266
+ end
267
+ end
268
+ end
269
+ end
@@ -0,0 +1,280 @@
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 CreateRegionResponse
18
+ # ID of the created region
19
+ attr_accessor :id
20
+
21
+ # Proxy API key for the region
22
+ attr_accessor :proxy_api_key
23
+
24
+ # SSH Gateway API key for the region
25
+ attr_accessor :ssh_gateway_api_key
26
+
27
+ # Snapshot Manager username for the region
28
+ attr_accessor :snapshot_manager_username
29
+
30
+ # Snapshot Manager password for the region
31
+ attr_accessor :snapshot_manager_password
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'id' => :'id',
37
+ :'proxy_api_key' => :'proxyApiKey',
38
+ :'ssh_gateway_api_key' => :'sshGatewayApiKey',
39
+ :'snapshot_manager_username' => :'snapshotManagerUsername',
40
+ :'snapshot_manager_password' => :'snapshotManagerPassword'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'id' => :'String',
58
+ :'proxy_api_key' => :'String',
59
+ :'ssh_gateway_api_key' => :'String',
60
+ :'snapshot_manager_username' => :'String',
61
+ :'snapshot_manager_password' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'proxy_api_key',
69
+ :'ssh_gateway_api_key',
70
+ :'snapshot_manager_username',
71
+ :'snapshot_manager_password'
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateRegionResponse` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateRegionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'id')
92
+ self.id = attributes[:'id']
93
+ else
94
+ self.id = nil
95
+ end
96
+
97
+ if attributes.key?(:'proxy_api_key')
98
+ self.proxy_api_key = attributes[:'proxy_api_key']
99
+ end
100
+
101
+ if attributes.key?(:'ssh_gateway_api_key')
102
+ self.ssh_gateway_api_key = attributes[:'ssh_gateway_api_key']
103
+ end
104
+
105
+ if attributes.key?(:'snapshot_manager_username')
106
+ self.snapshot_manager_username = attributes[:'snapshot_manager_username']
107
+ end
108
+
109
+ if attributes.key?(:'snapshot_manager_password')
110
+ self.snapshot_manager_password = attributes[:'snapshot_manager_password']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ if @id.nil?
120
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
130
+ return false if @id.nil?
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] id Value to be assigned
136
+ def id=(id)
137
+ if id.nil?
138
+ fail ArgumentError, 'id cannot be nil'
139
+ end
140
+
141
+ @id = id
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ id == o.id &&
150
+ proxy_api_key == o.proxy_api_key &&
151
+ ssh_gateway_api_key == o.ssh_gateway_api_key &&
152
+ snapshot_manager_username == o.snapshot_manager_username &&
153
+ snapshot_manager_password == o.snapshot_manager_password
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [id, proxy_api_key, ssh_gateway_api_key, snapshot_manager_username, snapshot_manager_password].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
183
+ end
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
187
+ end
188
+ new(transformed_hash)
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def self._deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = DaytonaApiClient.const_get(type)
230
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+ end
280
+ end