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,779 @@
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 RunnerFull
18
+ # The ID of the runner
19
+ attr_accessor :id
20
+
21
+ # The domain of the runner
22
+ attr_accessor :domain
23
+
24
+ # The API URL of the runner
25
+ attr_accessor :api_url
26
+
27
+ # The proxy URL of the runner
28
+ attr_accessor :proxy_url
29
+
30
+ # The CPU capacity of the runner
31
+ attr_accessor :cpu
32
+
33
+ # The memory capacity of the runner in GiB
34
+ attr_accessor :memory
35
+
36
+ # The disk capacity of the runner in GiB
37
+ attr_accessor :disk
38
+
39
+ # The GPU capacity of the runner
40
+ attr_accessor :gpu
41
+
42
+ # The type of GPU
43
+ attr_accessor :gpu_type
44
+
45
+ # The class of the runner
46
+ attr_accessor :_class
47
+
48
+ # Current CPU usage percentage
49
+ attr_accessor :current_cpu_usage_percentage
50
+
51
+ # Current RAM usage percentage
52
+ attr_accessor :current_memory_usage_percentage
53
+
54
+ # Current disk usage percentage
55
+ attr_accessor :current_disk_usage_percentage
56
+
57
+ # Current allocated CPU
58
+ attr_accessor :current_allocated_cpu
59
+
60
+ # Current allocated memory in GiB
61
+ attr_accessor :current_allocated_memory_gi_b
62
+
63
+ # Current allocated disk in GiB
64
+ attr_accessor :current_allocated_disk_gi_b
65
+
66
+ # Current snapshot count
67
+ attr_accessor :current_snapshot_count
68
+
69
+ # Current number of started sandboxes
70
+ attr_accessor :current_started_sandboxes
71
+
72
+ # Runner availability score
73
+ attr_accessor :availability_score
74
+
75
+ # The region of the runner
76
+ attr_accessor :region
77
+
78
+ # The name of the runner
79
+ attr_accessor :name
80
+
81
+ # The state of the runner
82
+ attr_accessor :state
83
+
84
+ # The last time the runner was checked
85
+ attr_accessor :last_checked
86
+
87
+ # Whether the runner is unschedulable
88
+ attr_accessor :unschedulable
89
+
90
+ # The creation timestamp of the runner
91
+ attr_accessor :created_at
92
+
93
+ # The last update timestamp of the runner
94
+ attr_accessor :updated_at
95
+
96
+ # The version of the runner (deprecated in favor of apiVersion)
97
+ attr_accessor :version
98
+
99
+ # The api version of the runner
100
+ attr_accessor :api_version
101
+
102
+ # The app version of the runner
103
+ attr_accessor :app_version
104
+
105
+ # The API key for the runner
106
+ attr_accessor :api_key
107
+
108
+ # The region type of the runner
109
+ attr_accessor :region_type
110
+
111
+ class EnumAttributeValidator
112
+ attr_reader :datatype
113
+ attr_reader :allowable_values
114
+
115
+ def initialize(datatype, allowable_values)
116
+ @allowable_values = allowable_values.map do |value|
117
+ case datatype.to_s
118
+ when /Integer/i
119
+ value.to_i
120
+ when /Float/i
121
+ value.to_f
122
+ else
123
+ value
124
+ end
125
+ end
126
+ end
127
+
128
+ def valid?(value)
129
+ !value || allowable_values.include?(value)
130
+ end
131
+ end
132
+
133
+ # Attribute mapping from ruby-style variable name to JSON key.
134
+ def self.attribute_map
135
+ {
136
+ :'id' => :'id',
137
+ :'domain' => :'domain',
138
+ :'api_url' => :'apiUrl',
139
+ :'proxy_url' => :'proxyUrl',
140
+ :'cpu' => :'cpu',
141
+ :'memory' => :'memory',
142
+ :'disk' => :'disk',
143
+ :'gpu' => :'gpu',
144
+ :'gpu_type' => :'gpuType',
145
+ :'_class' => :'class',
146
+ :'current_cpu_usage_percentage' => :'currentCpuUsagePercentage',
147
+ :'current_memory_usage_percentage' => :'currentMemoryUsagePercentage',
148
+ :'current_disk_usage_percentage' => :'currentDiskUsagePercentage',
149
+ :'current_allocated_cpu' => :'currentAllocatedCpu',
150
+ :'current_allocated_memory_gi_b' => :'currentAllocatedMemoryGiB',
151
+ :'current_allocated_disk_gi_b' => :'currentAllocatedDiskGiB',
152
+ :'current_snapshot_count' => :'currentSnapshotCount',
153
+ :'current_started_sandboxes' => :'currentStartedSandboxes',
154
+ :'availability_score' => :'availabilityScore',
155
+ :'region' => :'region',
156
+ :'name' => :'name',
157
+ :'state' => :'state',
158
+ :'last_checked' => :'lastChecked',
159
+ :'unschedulable' => :'unschedulable',
160
+ :'created_at' => :'createdAt',
161
+ :'updated_at' => :'updatedAt',
162
+ :'version' => :'version',
163
+ :'api_version' => :'apiVersion',
164
+ :'app_version' => :'appVersion',
165
+ :'api_key' => :'apiKey',
166
+ :'region_type' => :'regionType'
167
+ }
168
+ end
169
+
170
+ # Returns attribute mapping this model knows about
171
+ def self.acceptable_attribute_map
172
+ attribute_map
173
+ end
174
+
175
+ # Returns all the JSON keys this model knows about
176
+ def self.acceptable_attributes
177
+ acceptable_attribute_map.values
178
+ end
179
+
180
+ # Attribute type mapping.
181
+ def self.openapi_types
182
+ {
183
+ :'id' => :'String',
184
+ :'domain' => :'String',
185
+ :'api_url' => :'String',
186
+ :'proxy_url' => :'String',
187
+ :'cpu' => :'Float',
188
+ :'memory' => :'Float',
189
+ :'disk' => :'Float',
190
+ :'gpu' => :'Float',
191
+ :'gpu_type' => :'String',
192
+ :'_class' => :'SandboxClass',
193
+ :'current_cpu_usage_percentage' => :'Float',
194
+ :'current_memory_usage_percentage' => :'Float',
195
+ :'current_disk_usage_percentage' => :'Float',
196
+ :'current_allocated_cpu' => :'Float',
197
+ :'current_allocated_memory_gi_b' => :'Float',
198
+ :'current_allocated_disk_gi_b' => :'Float',
199
+ :'current_snapshot_count' => :'Float',
200
+ :'current_started_sandboxes' => :'Float',
201
+ :'availability_score' => :'Float',
202
+ :'region' => :'String',
203
+ :'name' => :'String',
204
+ :'state' => :'RunnerState',
205
+ :'last_checked' => :'String',
206
+ :'unschedulable' => :'Boolean',
207
+ :'created_at' => :'String',
208
+ :'updated_at' => :'String',
209
+ :'version' => :'String',
210
+ :'api_version' => :'String',
211
+ :'app_version' => :'String',
212
+ :'api_key' => :'String',
213
+ :'region_type' => :'RegionType'
214
+ }
215
+ end
216
+
217
+ # List of attributes with nullable: true
218
+ def self.openapi_nullable
219
+ Set.new([
220
+ ])
221
+ end
222
+
223
+ # Initializes the object
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ def initialize(attributes = {})
226
+ if (!attributes.is_a?(Hash))
227
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::RunnerFull` initialize method"
228
+ end
229
+
230
+ # check to see if the attribute exists and convert string to symbol for hash key
231
+ acceptable_attribute_map = self.class.acceptable_attribute_map
232
+ attributes = attributes.each_with_object({}) { |(k, v), h|
233
+ if (!acceptable_attribute_map.key?(k.to_sym))
234
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::RunnerFull`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
235
+ end
236
+ h[k.to_sym] = v
237
+ }
238
+
239
+ if attributes.key?(:'id')
240
+ self.id = attributes[:'id']
241
+ else
242
+ self.id = nil
243
+ end
244
+
245
+ if attributes.key?(:'domain')
246
+ self.domain = attributes[:'domain']
247
+ end
248
+
249
+ if attributes.key?(:'api_url')
250
+ self.api_url = attributes[:'api_url']
251
+ end
252
+
253
+ if attributes.key?(:'proxy_url')
254
+ self.proxy_url = attributes[:'proxy_url']
255
+ end
256
+
257
+ if attributes.key?(:'cpu')
258
+ self.cpu = attributes[:'cpu']
259
+ else
260
+ self.cpu = nil
261
+ end
262
+
263
+ if attributes.key?(:'memory')
264
+ self.memory = attributes[:'memory']
265
+ else
266
+ self.memory = nil
267
+ end
268
+
269
+ if attributes.key?(:'disk')
270
+ self.disk = attributes[:'disk']
271
+ else
272
+ self.disk = nil
273
+ end
274
+
275
+ if attributes.key?(:'gpu')
276
+ self.gpu = attributes[:'gpu']
277
+ end
278
+
279
+ if attributes.key?(:'gpu_type')
280
+ self.gpu_type = attributes[:'gpu_type']
281
+ end
282
+
283
+ if attributes.key?(:'_class')
284
+ self._class = attributes[:'_class']
285
+ else
286
+ self._class = nil
287
+ end
288
+
289
+ if attributes.key?(:'current_cpu_usage_percentage')
290
+ self.current_cpu_usage_percentage = attributes[:'current_cpu_usage_percentage']
291
+ end
292
+
293
+ if attributes.key?(:'current_memory_usage_percentage')
294
+ self.current_memory_usage_percentage = attributes[:'current_memory_usage_percentage']
295
+ end
296
+
297
+ if attributes.key?(:'current_disk_usage_percentage')
298
+ self.current_disk_usage_percentage = attributes[:'current_disk_usage_percentage']
299
+ end
300
+
301
+ if attributes.key?(:'current_allocated_cpu')
302
+ self.current_allocated_cpu = attributes[:'current_allocated_cpu']
303
+ end
304
+
305
+ if attributes.key?(:'current_allocated_memory_gi_b')
306
+ self.current_allocated_memory_gi_b = attributes[:'current_allocated_memory_gi_b']
307
+ end
308
+
309
+ if attributes.key?(:'current_allocated_disk_gi_b')
310
+ self.current_allocated_disk_gi_b = attributes[:'current_allocated_disk_gi_b']
311
+ end
312
+
313
+ if attributes.key?(:'current_snapshot_count')
314
+ self.current_snapshot_count = attributes[:'current_snapshot_count']
315
+ end
316
+
317
+ if attributes.key?(:'current_started_sandboxes')
318
+ self.current_started_sandboxes = attributes[:'current_started_sandboxes']
319
+ end
320
+
321
+ if attributes.key?(:'availability_score')
322
+ self.availability_score = attributes[:'availability_score']
323
+ end
324
+
325
+ if attributes.key?(:'region')
326
+ self.region = attributes[:'region']
327
+ else
328
+ self.region = nil
329
+ end
330
+
331
+ if attributes.key?(:'name')
332
+ self.name = attributes[:'name']
333
+ else
334
+ self.name = nil
335
+ end
336
+
337
+ if attributes.key?(:'state')
338
+ self.state = attributes[:'state']
339
+ else
340
+ self.state = nil
341
+ end
342
+
343
+ if attributes.key?(:'last_checked')
344
+ self.last_checked = attributes[:'last_checked']
345
+ end
346
+
347
+ if attributes.key?(:'unschedulable')
348
+ self.unschedulable = attributes[:'unschedulable']
349
+ else
350
+ self.unschedulable = nil
351
+ end
352
+
353
+ if attributes.key?(:'created_at')
354
+ self.created_at = attributes[:'created_at']
355
+ else
356
+ self.created_at = nil
357
+ end
358
+
359
+ if attributes.key?(:'updated_at')
360
+ self.updated_at = attributes[:'updated_at']
361
+ else
362
+ self.updated_at = nil
363
+ end
364
+
365
+ if attributes.key?(:'version')
366
+ self.version = attributes[:'version']
367
+ else
368
+ self.version = nil
369
+ end
370
+
371
+ if attributes.key?(:'api_version')
372
+ self.api_version = attributes[:'api_version']
373
+ else
374
+ self.api_version = nil
375
+ end
376
+
377
+ if attributes.key?(:'app_version')
378
+ self.app_version = attributes[:'app_version']
379
+ end
380
+
381
+ if attributes.key?(:'api_key')
382
+ self.api_key = attributes[:'api_key']
383
+ else
384
+ self.api_key = nil
385
+ end
386
+
387
+ if attributes.key?(:'region_type')
388
+ self.region_type = attributes[:'region_type']
389
+ end
390
+ end
391
+
392
+ # Show invalid properties with the reasons. Usually used together with valid?
393
+ # @return Array for valid properties with the reasons
394
+ def list_invalid_properties
395
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
396
+ invalid_properties = Array.new
397
+ if @id.nil?
398
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
399
+ end
400
+
401
+ if @cpu.nil?
402
+ invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
403
+ end
404
+
405
+ if @memory.nil?
406
+ invalid_properties.push('invalid value for "memory", memory cannot be nil.')
407
+ end
408
+
409
+ if @disk.nil?
410
+ invalid_properties.push('invalid value for "disk", disk cannot be nil.')
411
+ end
412
+
413
+ if @_class.nil?
414
+ invalid_properties.push('invalid value for "_class", _class cannot be nil.')
415
+ end
416
+
417
+ if @region.nil?
418
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
419
+ end
420
+
421
+ if @name.nil?
422
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
423
+ end
424
+
425
+ if @state.nil?
426
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
427
+ end
428
+
429
+ if @unschedulable.nil?
430
+ invalid_properties.push('invalid value for "unschedulable", unschedulable cannot be nil.')
431
+ end
432
+
433
+ if @created_at.nil?
434
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
435
+ end
436
+
437
+ if @updated_at.nil?
438
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
439
+ end
440
+
441
+ if @version.nil?
442
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
443
+ end
444
+
445
+ if @api_version.nil?
446
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
447
+ end
448
+
449
+ if @api_key.nil?
450
+ invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
451
+ end
452
+
453
+ invalid_properties
454
+ end
455
+
456
+ # Check to see if the all the properties in the model are valid
457
+ # @return true if the model is valid
458
+ def valid?
459
+ warn '[DEPRECATED] the `valid?` method is obsolete'
460
+ return false if @id.nil?
461
+ return false if @cpu.nil?
462
+ return false if @memory.nil?
463
+ return false if @disk.nil?
464
+ return false if @_class.nil?
465
+ return false if @region.nil?
466
+ return false if @name.nil?
467
+ return false if @state.nil?
468
+ return false if @unschedulable.nil?
469
+ return false if @created_at.nil?
470
+ return false if @updated_at.nil?
471
+ return false if @version.nil?
472
+ return false if @api_version.nil?
473
+ return false if @api_key.nil?
474
+ true
475
+ end
476
+
477
+ # Custom attribute writer method with validation
478
+ # @param [Object] id Value to be assigned
479
+ def id=(id)
480
+ if id.nil?
481
+ fail ArgumentError, 'id cannot be nil'
482
+ end
483
+
484
+ @id = id
485
+ end
486
+
487
+ # Custom attribute writer method with validation
488
+ # @param [Object] cpu Value to be assigned
489
+ def cpu=(cpu)
490
+ if cpu.nil?
491
+ fail ArgumentError, 'cpu cannot be nil'
492
+ end
493
+
494
+ @cpu = cpu
495
+ end
496
+
497
+ # Custom attribute writer method with validation
498
+ # @param [Object] memory Value to be assigned
499
+ def memory=(memory)
500
+ if memory.nil?
501
+ fail ArgumentError, 'memory cannot be nil'
502
+ end
503
+
504
+ @memory = memory
505
+ end
506
+
507
+ # Custom attribute writer method with validation
508
+ # @param [Object] disk Value to be assigned
509
+ def disk=(disk)
510
+ if disk.nil?
511
+ fail ArgumentError, 'disk cannot be nil'
512
+ end
513
+
514
+ @disk = disk
515
+ end
516
+
517
+ # Custom attribute writer method with validation
518
+ # @param [Object] _class Value to be assigned
519
+ def _class=(_class)
520
+ if _class.nil?
521
+ fail ArgumentError, '_class cannot be nil'
522
+ end
523
+
524
+ @_class = _class
525
+ end
526
+
527
+ # Custom attribute writer method with validation
528
+ # @param [Object] region Value to be assigned
529
+ def region=(region)
530
+ if region.nil?
531
+ fail ArgumentError, 'region cannot be nil'
532
+ end
533
+
534
+ @region = region
535
+ end
536
+
537
+ # Custom attribute writer method with validation
538
+ # @param [Object] name Value to be assigned
539
+ def name=(name)
540
+ if name.nil?
541
+ fail ArgumentError, 'name cannot be nil'
542
+ end
543
+
544
+ @name = name
545
+ end
546
+
547
+ # Custom attribute writer method with validation
548
+ # @param [Object] state Value to be assigned
549
+ def state=(state)
550
+ if state.nil?
551
+ fail ArgumentError, 'state cannot be nil'
552
+ end
553
+
554
+ @state = state
555
+ end
556
+
557
+ # Custom attribute writer method with validation
558
+ # @param [Object] unschedulable Value to be assigned
559
+ def unschedulable=(unschedulable)
560
+ if unschedulable.nil?
561
+ fail ArgumentError, 'unschedulable cannot be nil'
562
+ end
563
+
564
+ @unschedulable = unschedulable
565
+ end
566
+
567
+ # Custom attribute writer method with validation
568
+ # @param [Object] created_at Value to be assigned
569
+ def created_at=(created_at)
570
+ if created_at.nil?
571
+ fail ArgumentError, 'created_at cannot be nil'
572
+ end
573
+
574
+ @created_at = created_at
575
+ end
576
+
577
+ # Custom attribute writer method with validation
578
+ # @param [Object] updated_at Value to be assigned
579
+ def updated_at=(updated_at)
580
+ if updated_at.nil?
581
+ fail ArgumentError, 'updated_at cannot be nil'
582
+ end
583
+
584
+ @updated_at = updated_at
585
+ end
586
+
587
+ # Custom attribute writer method with validation
588
+ # @param [Object] version Value to be assigned
589
+ def version=(version)
590
+ if version.nil?
591
+ fail ArgumentError, 'version cannot be nil'
592
+ end
593
+
594
+ @version = version
595
+ end
596
+
597
+ # Custom attribute writer method with validation
598
+ # @param [Object] api_version Value to be assigned
599
+ def api_version=(api_version)
600
+ if api_version.nil?
601
+ fail ArgumentError, 'api_version cannot be nil'
602
+ end
603
+
604
+ @api_version = api_version
605
+ end
606
+
607
+ # Custom attribute writer method with validation
608
+ # @param [Object] api_key Value to be assigned
609
+ def api_key=(api_key)
610
+ if api_key.nil?
611
+ fail ArgumentError, 'api_key cannot be nil'
612
+ end
613
+
614
+ @api_key = api_key
615
+ end
616
+
617
+ # Checks equality by comparing each attribute.
618
+ # @param [Object] Object to be compared
619
+ def ==(o)
620
+ return true if self.equal?(o)
621
+ self.class == o.class &&
622
+ id == o.id &&
623
+ domain == o.domain &&
624
+ api_url == o.api_url &&
625
+ proxy_url == o.proxy_url &&
626
+ cpu == o.cpu &&
627
+ memory == o.memory &&
628
+ disk == o.disk &&
629
+ gpu == o.gpu &&
630
+ gpu_type == o.gpu_type &&
631
+ _class == o._class &&
632
+ current_cpu_usage_percentage == o.current_cpu_usage_percentage &&
633
+ current_memory_usage_percentage == o.current_memory_usage_percentage &&
634
+ current_disk_usage_percentage == o.current_disk_usage_percentage &&
635
+ current_allocated_cpu == o.current_allocated_cpu &&
636
+ current_allocated_memory_gi_b == o.current_allocated_memory_gi_b &&
637
+ current_allocated_disk_gi_b == o.current_allocated_disk_gi_b &&
638
+ current_snapshot_count == o.current_snapshot_count &&
639
+ current_started_sandboxes == o.current_started_sandboxes &&
640
+ availability_score == o.availability_score &&
641
+ region == o.region &&
642
+ name == o.name &&
643
+ state == o.state &&
644
+ last_checked == o.last_checked &&
645
+ unschedulable == o.unschedulable &&
646
+ created_at == o.created_at &&
647
+ updated_at == o.updated_at &&
648
+ version == o.version &&
649
+ api_version == o.api_version &&
650
+ app_version == o.app_version &&
651
+ api_key == o.api_key &&
652
+ region_type == o.region_type
653
+ end
654
+
655
+ # @see the `==` method
656
+ # @param [Object] Object to be compared
657
+ def eql?(o)
658
+ self == o
659
+ end
660
+
661
+ # Calculates hash code according to all attributes.
662
+ # @return [Integer] Hash code
663
+ def hash
664
+ [id, domain, api_url, proxy_url, cpu, memory, disk, gpu, gpu_type, _class, current_cpu_usage_percentage, current_memory_usage_percentage, current_disk_usage_percentage, current_allocated_cpu, current_allocated_memory_gi_b, current_allocated_disk_gi_b, current_snapshot_count, current_started_sandboxes, availability_score, region, name, state, last_checked, unschedulable, created_at, updated_at, version, api_version, app_version, api_key, region_type].hash
665
+ end
666
+
667
+ # Builds the object from hash
668
+ # @param [Hash] attributes Model attributes in the form of hash
669
+ # @return [Object] Returns the model itself
670
+ def self.build_from_hash(attributes)
671
+ return nil unless attributes.is_a?(Hash)
672
+ attributes = attributes.transform_keys(&:to_sym)
673
+ transformed_hash = {}
674
+ openapi_types.each_pair do |key, type|
675
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
676
+ transformed_hash["#{key}"] = nil
677
+ elsif type =~ /\AArray<(.*)>/i
678
+ # check to ensure the input is an array given that the attribute
679
+ # is documented as an array but the input is not
680
+ if attributes[attribute_map[key]].is_a?(Array)
681
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
682
+ end
683
+ elsif !attributes[attribute_map[key]].nil?
684
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
685
+ end
686
+ end
687
+ new(transformed_hash)
688
+ end
689
+
690
+ # Deserializes the data based on type
691
+ # @param string type Data type
692
+ # @param string value Value to be deserialized
693
+ # @return [Object] Deserialized data
694
+ def self._deserialize(type, value)
695
+ case type.to_sym
696
+ when :Time
697
+ Time.parse(value)
698
+ when :Date
699
+ Date.parse(value)
700
+ when :String
701
+ value.to_s
702
+ when :Integer
703
+ value.to_i
704
+ when :Float
705
+ value.to_f
706
+ when :Boolean
707
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
708
+ true
709
+ else
710
+ false
711
+ end
712
+ when :Object
713
+ # generic object (usually a Hash), return directly
714
+ value
715
+ when /\AArray<(?<inner_type>.+)>\z/
716
+ inner_type = Regexp.last_match[:inner_type]
717
+ value.map { |v| _deserialize(inner_type, v) }
718
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
719
+ k_type = Regexp.last_match[:k_type]
720
+ v_type = Regexp.last_match[:v_type]
721
+ {}.tap do |hash|
722
+ value.each do |k, v|
723
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
724
+ end
725
+ end
726
+ else # model
727
+ # models (e.g. Pet) or oneOf
728
+ klass = DaytonaApiClient.const_get(type)
729
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
730
+ end
731
+ end
732
+
733
+ # Returns the string representation of the object
734
+ # @return [String] String presentation of the object
735
+ def to_s
736
+ to_hash.to_s
737
+ end
738
+
739
+ # to_body is an alias to to_hash (backward compatibility)
740
+ # @return [Hash] Returns the object in the form of hash
741
+ def to_body
742
+ to_hash
743
+ end
744
+
745
+ # Returns the object in the form of hash
746
+ # @return [Hash] Returns the object in the form of hash
747
+ def to_hash
748
+ hash = {}
749
+ self.class.attribute_map.each_pair do |attr, param|
750
+ value = self.send(attr)
751
+ if value.nil?
752
+ is_nullable = self.class.openapi_nullable.include?(attr)
753
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
754
+ end
755
+
756
+ hash[param] = _to_hash(value)
757
+ end
758
+ hash
759
+ end
760
+
761
+ # Outputs non-array value in the form of hash
762
+ # For object, use to_hash. Otherwise, just return the value
763
+ # @param [Object] value Any valid value
764
+ # @return [Hash] Returns the value in the form of hash
765
+ def _to_hash(value)
766
+ if value.is_a?(Array)
767
+ value.compact.map { |v| _to_hash(v) }
768
+ elsif value.is_a?(Hash)
769
+ {}.tap do |hash|
770
+ value.each { |k, v| hash[k] = _to_hash(v) }
771
+ end
772
+ elsif value.respond_to? :to_hash
773
+ value.to_hash
774
+ else
775
+ value
776
+ end
777
+ end
778
+ end
779
+ end