daytona_api_client 0.184.0.alpha.1 → 0.184.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.
@@ -0,0 +1,372 @@
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.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class CreateOrganizationRegionQuota < ApiModelBase
18
+ attr_accessor :sandbox_class
19
+
20
+ attr_accessor :total_cpu_quota
21
+
22
+ attr_accessor :total_memory_quota
23
+
24
+ attr_accessor :total_disk_quota
25
+
26
+ attr_accessor :total_gpu_quota
27
+
28
+ attr_accessor :allowed_gpu_types
29
+
30
+ attr_accessor :max_cpu_per_sandbox
31
+
32
+ attr_accessor :max_memory_per_sandbox
33
+
34
+ attr_accessor :max_disk_per_sandbox
35
+
36
+ attr_accessor :max_disk_per_non_ephemeral_sandbox
37
+
38
+ attr_accessor :max_cpu_per_gpu_sandbox
39
+
40
+ attr_accessor :max_memory_per_gpu_sandbox
41
+
42
+ attr_accessor :max_disk_per_gpu_sandbox
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'sandbox_class' => :'sandboxClass',
70
+ :'total_cpu_quota' => :'totalCpuQuota',
71
+ :'total_memory_quota' => :'totalMemoryQuota',
72
+ :'total_disk_quota' => :'totalDiskQuota',
73
+ :'total_gpu_quota' => :'totalGpuQuota',
74
+ :'allowed_gpu_types' => :'allowedGpuTypes',
75
+ :'max_cpu_per_sandbox' => :'maxCpuPerSandbox',
76
+ :'max_memory_per_sandbox' => :'maxMemoryPerSandbox',
77
+ :'max_disk_per_sandbox' => :'maxDiskPerSandbox',
78
+ :'max_disk_per_non_ephemeral_sandbox' => :'maxDiskPerNonEphemeralSandbox',
79
+ :'max_cpu_per_gpu_sandbox' => :'maxCpuPerGpuSandbox',
80
+ :'max_memory_per_gpu_sandbox' => :'maxMemoryPerGpuSandbox',
81
+ :'max_disk_per_gpu_sandbox' => :'maxDiskPerGpuSandbox'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'sandbox_class' => :'SandboxClass',
99
+ :'total_cpu_quota' => :'Float',
100
+ :'total_memory_quota' => :'Float',
101
+ :'total_disk_quota' => :'Float',
102
+ :'total_gpu_quota' => :'Float',
103
+ :'allowed_gpu_types' => :'Array<GpuType>',
104
+ :'max_cpu_per_sandbox' => :'Float',
105
+ :'max_memory_per_sandbox' => :'Float',
106
+ :'max_disk_per_sandbox' => :'Float',
107
+ :'max_disk_per_non_ephemeral_sandbox' => :'Float',
108
+ :'max_cpu_per_gpu_sandbox' => :'Float',
109
+ :'max_memory_per_gpu_sandbox' => :'Float',
110
+ :'max_disk_per_gpu_sandbox' => :'Float'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ :'allowed_gpu_types',
118
+ :'max_cpu_per_sandbox',
119
+ :'max_memory_per_sandbox',
120
+ :'max_disk_per_sandbox',
121
+ :'max_disk_per_non_ephemeral_sandbox',
122
+ :'max_cpu_per_gpu_sandbox',
123
+ :'max_memory_per_gpu_sandbox',
124
+ :'max_disk_per_gpu_sandbox'
125
+ ])
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateOrganizationRegionQuota` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ acceptable_attribute_map = self.class.acceptable_attribute_map
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!acceptable_attribute_map.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateOrganizationRegionQuota`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'sandbox_class')
145
+ self.sandbox_class = attributes[:'sandbox_class']
146
+ else
147
+ self.sandbox_class = nil
148
+ end
149
+
150
+ if attributes.key?(:'total_cpu_quota')
151
+ self.total_cpu_quota = attributes[:'total_cpu_quota']
152
+ else
153
+ self.total_cpu_quota = nil
154
+ end
155
+
156
+ if attributes.key?(:'total_memory_quota')
157
+ self.total_memory_quota = attributes[:'total_memory_quota']
158
+ else
159
+ self.total_memory_quota = nil
160
+ end
161
+
162
+ if attributes.key?(:'total_disk_quota')
163
+ self.total_disk_quota = attributes[:'total_disk_quota']
164
+ else
165
+ self.total_disk_quota = nil
166
+ end
167
+
168
+ if attributes.key?(:'total_gpu_quota')
169
+ self.total_gpu_quota = attributes[:'total_gpu_quota']
170
+ else
171
+ self.total_gpu_quota = nil
172
+ end
173
+
174
+ if attributes.key?(:'allowed_gpu_types')
175
+ if (value = attributes[:'allowed_gpu_types']).is_a?(Array)
176
+ self.allowed_gpu_types = value
177
+ end
178
+ end
179
+
180
+ if attributes.key?(:'max_cpu_per_sandbox')
181
+ self.max_cpu_per_sandbox = attributes[:'max_cpu_per_sandbox']
182
+ end
183
+
184
+ if attributes.key?(:'max_memory_per_sandbox')
185
+ self.max_memory_per_sandbox = attributes[:'max_memory_per_sandbox']
186
+ end
187
+
188
+ if attributes.key?(:'max_disk_per_sandbox')
189
+ self.max_disk_per_sandbox = attributes[:'max_disk_per_sandbox']
190
+ end
191
+
192
+ if attributes.key?(:'max_disk_per_non_ephemeral_sandbox')
193
+ self.max_disk_per_non_ephemeral_sandbox = attributes[:'max_disk_per_non_ephemeral_sandbox']
194
+ end
195
+
196
+ if attributes.key?(:'max_cpu_per_gpu_sandbox')
197
+ self.max_cpu_per_gpu_sandbox = attributes[:'max_cpu_per_gpu_sandbox']
198
+ end
199
+
200
+ if attributes.key?(:'max_memory_per_gpu_sandbox')
201
+ self.max_memory_per_gpu_sandbox = attributes[:'max_memory_per_gpu_sandbox']
202
+ end
203
+
204
+ if attributes.key?(:'max_disk_per_gpu_sandbox')
205
+ self.max_disk_per_gpu_sandbox = attributes[:'max_disk_per_gpu_sandbox']
206
+ end
207
+ end
208
+
209
+ # Show invalid properties with the reasons. Usually used together with valid?
210
+ # @return Array for valid properties with the reasons
211
+ def list_invalid_properties
212
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
213
+ invalid_properties = Array.new
214
+ if @sandbox_class.nil?
215
+ invalid_properties.push('invalid value for "sandbox_class", sandbox_class cannot be nil.')
216
+ end
217
+
218
+ if @total_cpu_quota.nil?
219
+ invalid_properties.push('invalid value for "total_cpu_quota", total_cpu_quota cannot be nil.')
220
+ end
221
+
222
+ if @total_memory_quota.nil?
223
+ invalid_properties.push('invalid value for "total_memory_quota", total_memory_quota cannot be nil.')
224
+ end
225
+
226
+ if @total_disk_quota.nil?
227
+ invalid_properties.push('invalid value for "total_disk_quota", total_disk_quota cannot be nil.')
228
+ end
229
+
230
+ if @total_gpu_quota.nil?
231
+ invalid_properties.push('invalid value for "total_gpu_quota", total_gpu_quota cannot be nil.')
232
+ end
233
+
234
+ invalid_properties
235
+ end
236
+
237
+ # Check to see if the all the properties in the model are valid
238
+ # @return true if the model is valid
239
+ def valid?
240
+ warn '[DEPRECATED] the `valid?` method is obsolete'
241
+ return false if @sandbox_class.nil?
242
+ return false if @total_cpu_quota.nil?
243
+ return false if @total_memory_quota.nil?
244
+ return false if @total_disk_quota.nil?
245
+ return false if @total_gpu_quota.nil?
246
+ true
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] sandbox_class Value to be assigned
251
+ def sandbox_class=(sandbox_class)
252
+ if sandbox_class.nil?
253
+ fail ArgumentError, 'sandbox_class cannot be nil'
254
+ end
255
+
256
+ @sandbox_class = sandbox_class
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] total_cpu_quota Value to be assigned
261
+ def total_cpu_quota=(total_cpu_quota)
262
+ if total_cpu_quota.nil?
263
+ fail ArgumentError, 'total_cpu_quota cannot be nil'
264
+ end
265
+
266
+ @total_cpu_quota = total_cpu_quota
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] total_memory_quota Value to be assigned
271
+ def total_memory_quota=(total_memory_quota)
272
+ if total_memory_quota.nil?
273
+ fail ArgumentError, 'total_memory_quota cannot be nil'
274
+ end
275
+
276
+ @total_memory_quota = total_memory_quota
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] total_disk_quota Value to be assigned
281
+ def total_disk_quota=(total_disk_quota)
282
+ if total_disk_quota.nil?
283
+ fail ArgumentError, 'total_disk_quota cannot be nil'
284
+ end
285
+
286
+ @total_disk_quota = total_disk_quota
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] total_gpu_quota Value to be assigned
291
+ def total_gpu_quota=(total_gpu_quota)
292
+ if total_gpu_quota.nil?
293
+ fail ArgumentError, 'total_gpu_quota cannot be nil'
294
+ end
295
+
296
+ @total_gpu_quota = total_gpu_quota
297
+ end
298
+
299
+ # Checks equality by comparing each attribute.
300
+ # @param [Object] Object to be compared
301
+ def ==(o)
302
+ return true if self.equal?(o)
303
+ self.class == o.class &&
304
+ sandbox_class == o.sandbox_class &&
305
+ total_cpu_quota == o.total_cpu_quota &&
306
+ total_memory_quota == o.total_memory_quota &&
307
+ total_disk_quota == o.total_disk_quota &&
308
+ total_gpu_quota == o.total_gpu_quota &&
309
+ allowed_gpu_types == o.allowed_gpu_types &&
310
+ max_cpu_per_sandbox == o.max_cpu_per_sandbox &&
311
+ max_memory_per_sandbox == o.max_memory_per_sandbox &&
312
+ max_disk_per_sandbox == o.max_disk_per_sandbox &&
313
+ max_disk_per_non_ephemeral_sandbox == o.max_disk_per_non_ephemeral_sandbox &&
314
+ max_cpu_per_gpu_sandbox == o.max_cpu_per_gpu_sandbox &&
315
+ max_memory_per_gpu_sandbox == o.max_memory_per_gpu_sandbox &&
316
+ max_disk_per_gpu_sandbox == o.max_disk_per_gpu_sandbox
317
+ end
318
+
319
+ # @see the `==` method
320
+ # @param [Object] Object to be compared
321
+ def eql?(o)
322
+ self == o
323
+ end
324
+
325
+ # Calculates hash code according to all attributes.
326
+ # @return [Integer] Hash code
327
+ def hash
328
+ [sandbox_class, total_cpu_quota, total_memory_quota, total_disk_quota, total_gpu_quota, allowed_gpu_types, max_cpu_per_sandbox, max_memory_per_sandbox, max_disk_per_sandbox, max_disk_per_non_ephemeral_sandbox, max_cpu_per_gpu_sandbox, max_memory_per_gpu_sandbox, max_disk_per_gpu_sandbox].hash
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def self.build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ attributes = attributes.transform_keys(&:to_sym)
337
+ transformed_hash = {}
338
+ openapi_types.each_pair do |key, type|
339
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
340
+ transformed_hash["#{key}"] = nil
341
+ elsif type =~ /\AArray<(.*)>/i
342
+ # check to ensure the input is an array given that the attribute
343
+ # is documented as an array but the input is not
344
+ if attributes[attribute_map[key]].is_a?(Array)
345
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
346
+ end
347
+ elsif !attributes[attribute_map[key]].nil?
348
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
349
+ end
350
+ end
351
+ new(transformed_hash)
352
+ end
353
+
354
+ # Returns the object in the form of hash
355
+ # @return [Hash] Returns the object in the form of hash
356
+ def to_hash
357
+ hash = {}
358
+ self.class.attribute_map.each_pair do |attr, param|
359
+ value = self.send(attr)
360
+ if value.nil?
361
+ is_nullable = self.class.openapi_nullable.include?(attr)
362
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
363
+ end
364
+
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ end
371
+
372
+ end
@@ -39,9 +39,6 @@ module DaytonaApiClient
39
39
  # Comma-separated list of allowed CIDR network addresses for the sandbox
40
40
  attr_accessor :network_allow_list
41
41
 
42
- # The sandbox class type
43
- attr_accessor :_class
44
-
45
42
  # The target (region) where the sandbox will be created
46
43
  attr_accessor :target
47
44
 
@@ -51,6 +48,9 @@ module DaytonaApiClient
51
48
  # GPU units allocated to the sandbox
52
49
  attr_accessor :gpu
53
50
 
51
+ # Preferred GPU type for the sandbox. Accepts a single value or an ordered preference list — the scheduler tries each in order and pins the sandbox to the first that has capacity.
52
+ attr_accessor :gpu_type
53
+
54
54
  # Memory allocated to the sandbox in GB
55
55
  attr_accessor :memory
56
56
 
@@ -72,27 +72,8 @@ module DaytonaApiClient
72
72
  # Build information for the sandbox
73
73
  attr_accessor :build_info
74
74
 
75
- class EnumAttributeValidator
76
- attr_reader :datatype
77
- attr_reader :allowable_values
78
-
79
- def initialize(datatype, allowable_values)
80
- @allowable_values = allowable_values.map do |value|
81
- case datatype.to_s
82
- when /Integer/i
83
- value.to_i
84
- when /Float/i
85
- value.to_f
86
- else
87
- value
88
- end
89
- end
90
- end
91
-
92
- def valid?(value)
93
- !value || allowable_values.include?(value)
94
- end
95
- end
75
+ # ID or name of an existing sandbox to link the new sandbox to. The new sandbox will be scheduled on the same runner as the linked sandbox so a local network can be established between them. Linked sandboxes must be ephemeral (autoDeleteInterval=0) and cannot themselves be linked to another sandbox.
76
+ attr_accessor :linked_sandbox
96
77
 
97
78
  # Attribute mapping from ruby-style variable name to JSON key.
98
79
  def self.attribute_map
@@ -105,17 +86,18 @@ module DaytonaApiClient
105
86
  :'public' => :'public',
106
87
  :'network_block_all' => :'networkBlockAll',
107
88
  :'network_allow_list' => :'networkAllowList',
108
- :'_class' => :'class',
109
89
  :'target' => :'target',
110
90
  :'cpu' => :'cpu',
111
91
  :'gpu' => :'gpu',
92
+ :'gpu_type' => :'gpuType',
112
93
  :'memory' => :'memory',
113
94
  :'disk' => :'disk',
114
95
  :'auto_stop_interval' => :'autoStopInterval',
115
96
  :'auto_archive_interval' => :'autoArchiveInterval',
116
97
  :'auto_delete_interval' => :'autoDeleteInterval',
117
98
  :'volumes' => :'volumes',
118
- :'build_info' => :'buildInfo'
99
+ :'build_info' => :'buildInfo',
100
+ :'linked_sandbox' => :'linkedSandbox'
119
101
  }
120
102
  end
121
103
 
@@ -140,17 +122,18 @@ module DaytonaApiClient
140
122
  :'public' => :'Boolean',
141
123
  :'network_block_all' => :'Boolean',
142
124
  :'network_allow_list' => :'String',
143
- :'_class' => :'String',
144
125
  :'target' => :'String',
145
126
  :'cpu' => :'Integer',
146
127
  :'gpu' => :'Integer',
128
+ :'gpu_type' => :'Array<GpuType>',
147
129
  :'memory' => :'Integer',
148
130
  :'disk' => :'Integer',
149
131
  :'auto_stop_interval' => :'Integer',
150
132
  :'auto_archive_interval' => :'Integer',
151
133
  :'auto_delete_interval' => :'Integer',
152
134
  :'volumes' => :'Array<SandboxVolume>',
153
- :'build_info' => :'CreateBuildInfo'
135
+ :'build_info' => :'CreateBuildInfo',
136
+ :'linked_sandbox' => :'String'
154
137
  }
155
138
  end
156
139
 
@@ -212,10 +195,6 @@ module DaytonaApiClient
212
195
  self.network_allow_list = attributes[:'network_allow_list']
213
196
  end
214
197
 
215
- if attributes.key?(:'_class')
216
- self._class = attributes[:'_class']
217
- end
218
-
219
198
  if attributes.key?(:'target')
220
199
  self.target = attributes[:'target']
221
200
  end
@@ -228,6 +207,12 @@ module DaytonaApiClient
228
207
  self.gpu = attributes[:'gpu']
229
208
  end
230
209
 
210
+ if attributes.key?(:'gpu_type')
211
+ if (value = attributes[:'gpu_type']).is_a?(Array)
212
+ self.gpu_type = value
213
+ end
214
+ end
215
+
231
216
  if attributes.key?(:'memory')
232
217
  self.memory = attributes[:'memory']
233
218
  end
@@ -257,6 +242,10 @@ module DaytonaApiClient
257
242
  if attributes.key?(:'build_info')
258
243
  self.build_info = attributes[:'build_info']
259
244
  end
245
+
246
+ if attributes.key?(:'linked_sandbox')
247
+ self.linked_sandbox = attributes[:'linked_sandbox']
248
+ end
260
249
  end
261
250
 
262
251
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -271,21 +260,9 @@ module DaytonaApiClient
271
260
  # @return true if the model is valid
272
261
  def valid?
273
262
  warn '[DEPRECATED] the `valid?` method is obsolete'
274
- _class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large", "unknown_default_open_api"])
275
- return false unless _class_validator.valid?(@_class)
276
263
  true
277
264
  end
278
265
 
279
- # Custom attribute writer method checking allowed values (enum).
280
- # @param [Object] _class Object to be assigned
281
- def _class=(_class)
282
- validator = EnumAttributeValidator.new('String', ["small", "medium", "large", "unknown_default_open_api"])
283
- unless validator.valid?(_class)
284
- fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
285
- end
286
- @_class = _class
287
- end
288
-
289
266
  # Checks equality by comparing each attribute.
290
267
  # @param [Object] Object to be compared
291
268
  def ==(o)
@@ -299,17 +276,18 @@ module DaytonaApiClient
299
276
  public == o.public &&
300
277
  network_block_all == o.network_block_all &&
301
278
  network_allow_list == o.network_allow_list &&
302
- _class == o._class &&
303
279
  target == o.target &&
304
280
  cpu == o.cpu &&
305
281
  gpu == o.gpu &&
282
+ gpu_type == o.gpu_type &&
306
283
  memory == o.memory &&
307
284
  disk == o.disk &&
308
285
  auto_stop_interval == o.auto_stop_interval &&
309
286
  auto_archive_interval == o.auto_archive_interval &&
310
287
  auto_delete_interval == o.auto_delete_interval &&
311
288
  volumes == o.volumes &&
312
- build_info == o.build_info
289
+ build_info == o.build_info &&
290
+ linked_sandbox == o.linked_sandbox
313
291
  end
314
292
 
315
293
  # @see the `==` method
@@ -321,7 +299,7 @@ module DaytonaApiClient
321
299
  # Calculates hash code according to all attributes.
322
300
  # @return [Integer] Hash code
323
301
  def hash
324
- [name, snapshot, user, env, labels, public, network_block_all, network_allow_list, _class, target, cpu, gpu, memory, disk, auto_stop_interval, auto_archive_interval, auto_delete_interval, volumes, build_info].hash
302
+ [name, snapshot, user, env, labels, public, network_block_all, network_allow_list, target, cpu, gpu, gpu_type, memory, disk, auto_stop_interval, auto_archive_interval, auto_delete_interval, volumes, build_info, linked_sandbox].hash
325
303
  end
326
304
 
327
305
  # Builds the object from hash
@@ -30,6 +30,9 @@ module DaytonaApiClient
30
30
  # GPU units allocated to the resulting sandbox
31
31
  attr_accessor :gpu
32
32
 
33
+ # Preferred GPU type for the resulting sandbox.
34
+ attr_accessor :gpu_type
35
+
33
36
  # Memory allocated to the resulting sandbox in GB
34
37
  attr_accessor :memory
35
38
 
@@ -42,6 +45,31 @@ module DaytonaApiClient
42
45
  # ID of the region where the snapshot will be available. Defaults to organization default region if not specified.
43
46
  attr_accessor :region_id
44
47
 
48
+ # Target sandbox class. Determines which runners can host sandboxes created from this snapshot.
49
+ attr_accessor :sandbox_class
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
45
73
  # Attribute mapping from ruby-style variable name to JSON key.
46
74
  def self.attribute_map
47
75
  {
@@ -50,10 +78,12 @@ module DaytonaApiClient
50
78
  :'entrypoint' => :'entrypoint',
51
79
  :'cpu' => :'cpu',
52
80
  :'gpu' => :'gpu',
81
+ :'gpu_type' => :'gpuType',
53
82
  :'memory' => :'memory',
54
83
  :'disk' => :'disk',
55
84
  :'build_info' => :'buildInfo',
56
- :'region_id' => :'regionId'
85
+ :'region_id' => :'regionId',
86
+ :'sandbox_class' => :'sandboxClass'
57
87
  }
58
88
  end
59
89
 
@@ -75,10 +105,12 @@ module DaytonaApiClient
75
105
  :'entrypoint' => :'Array<String>',
76
106
  :'cpu' => :'Integer',
77
107
  :'gpu' => :'Integer',
108
+ :'gpu_type' => :'Array<GpuType>',
78
109
  :'memory' => :'Integer',
79
110
  :'disk' => :'Integer',
80
111
  :'build_info' => :'CreateBuildInfo',
81
- :'region_id' => :'String'
112
+ :'region_id' => :'String',
113
+ :'sandbox_class' => :'SandboxClass'
82
114
  }
83
115
  end
84
116
 
@@ -128,6 +160,12 @@ module DaytonaApiClient
128
160
  self.gpu = attributes[:'gpu']
129
161
  end
130
162
 
163
+ if attributes.key?(:'gpu_type')
164
+ if (value = attributes[:'gpu_type']).is_a?(Array)
165
+ self.gpu_type = value
166
+ end
167
+ end
168
+
131
169
  if attributes.key?(:'memory')
132
170
  self.memory = attributes[:'memory']
133
171
  end
@@ -143,6 +181,10 @@ module DaytonaApiClient
143
181
  if attributes.key?(:'region_id')
144
182
  self.region_id = attributes[:'region_id']
145
183
  end
184
+
185
+ if attributes.key?(:'sandbox_class')
186
+ self.sandbox_class = attributes[:'sandbox_class']
187
+ end
146
188
  end
147
189
 
148
190
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -185,10 +227,12 @@ module DaytonaApiClient
185
227
  entrypoint == o.entrypoint &&
186
228
  cpu == o.cpu &&
187
229
  gpu == o.gpu &&
230
+ gpu_type == o.gpu_type &&
188
231
  memory == o.memory &&
189
232
  disk == o.disk &&
190
233
  build_info == o.build_info &&
191
- region_id == o.region_id
234
+ region_id == o.region_id &&
235
+ sandbox_class == o.sandbox_class
192
236
  end
193
237
 
194
238
  # @see the `==` method
@@ -200,7 +244,7 @@ module DaytonaApiClient
200
244
  # Calculates hash code according to all attributes.
201
245
  # @return [Integer] Hash code
202
246
  def hash
203
- [name, image_name, entrypoint, cpu, gpu, memory, disk, build_info, region_id].hash
247
+ [name, image_name, entrypoint, cpu, gpu, gpu_type, memory, disk, build_info, region_id, sandbox_class].hash
204
248
  end
205
249
 
206
250
  # Builds the object from hash
@@ -0,0 +1,41 @@
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.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class GpuType
18
+ H100 = "H100".freeze
19
+ RTX_PRO_6000 = "RTX-PRO-6000".freeze
20
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [H100, RTX_PRO_6000, UNKNOWN_DEFAULT_OPEN_API].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if GpuType.all_vars.include?(value)
38
+ UNKNOWN_DEFAULT_OPEN_API
39
+ end
40
+ end
41
+ end