daytona_api_client 0.126.0.pre.alpha.5 → 1.0.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/daytona_api_client.gemspec +2 -2
  4. data/lib/daytona_api_client/api/audit_api.rb +66 -18
  5. data/lib/daytona_api_client/api/organizations_api.rb +12 -219
  6. data/lib/daytona_api_client/api/preview_api.rb +5 -7
  7. data/lib/daytona_api_client/api/runners_api.rb +0 -55
  8. data/lib/daytona_api_client/api/sandbox_api.rb +222 -309
  9. data/lib/daytona_api_client/api/toolbox_api.rb +711 -711
  10. data/lib/daytona_api_client/api/workspace_api.rb +3 -3
  11. data/lib/daytona_api_client/models/create_organization.rb +4 -31
  12. data/lib/daytona_api_client/models/create_sandbox.rb +1 -11
  13. data/lib/daytona_api_client/models/create_user.rb +1 -10
  14. data/lib/daytona_api_client/models/daytona_configuration.rb +4 -41
  15. data/lib/daytona_api_client/models/organization.rb +85 -53
  16. data/lib/daytona_api_client/models/organization_usage_overview.rb +146 -18
  17. data/lib/daytona_api_client/models/paginated_audit_logs.rb +4 -14
  18. data/lib/daytona_api_client/models/port_preview_url.rb +14 -31
  19. data/lib/daytona_api_client/models/region.rb +4 -96
  20. data/lib/daytona_api_client/models/sandbox.rb +11 -38
  21. data/lib/daytona_api_client/models/sandbox_volume.rb +4 -14
  22. data/lib/daytona_api_client/models/snapshot_state.rb +4 -1
  23. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +24 -4
  24. data/lib/daytona_api_client/models/update_organization_quota.rb +41 -41
  25. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +4 -14
  26. data/lib/daytona_api_client/models/workspace.rb +38 -38
  27. data/lib/daytona_api_client/version.rb +1 -1
  28. data/lib/daytona_api_client.rb +1 -8
  29. data/project.json +7 -29
  30. metadata +1 -16
  31. data/.gitignore +0 -39
  32. data/.openapi-generator/FILES +0 -171
  33. data/.openapi-generator/VERSION +0 -1
  34. data/.openapi-generator-ignore +0 -33
  35. data/.rspec +0 -2
  36. data/.rubocop.yml +0 -148
  37. data/fix-gemspec.sh +0 -11
  38. data/lib/daytona_api_client/api/regions_api.rb +0 -83
  39. data/lib/daytona_api_client/models/rate_limit_config.rb +0 -249
  40. data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -229
  41. data/lib/daytona_api_client/models/region_quota.rb +0 -339
  42. data/lib/daytona_api_client/models/region_usage_overview.rb +0 -391
  43. data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -236
  44. data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -245
  45. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +0 -263
@@ -1,229 +0,0 @@
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 RateLimitEntry
18
- # Rate limit TTL in seconds
19
- attr_accessor :ttl
20
-
21
- # Rate limit max requests
22
- attr_accessor :limit
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'ttl' => :'ttl',
28
- :'limit' => :'limit'
29
- }
30
- end
31
-
32
- # Returns attribute mapping this model knows about
33
- def self.acceptable_attribute_map
34
- attribute_map
35
- end
36
-
37
- # Returns all the JSON keys this model knows about
38
- def self.acceptable_attributes
39
- acceptable_attribute_map.values
40
- end
41
-
42
- # Attribute type mapping.
43
- def self.openapi_types
44
- {
45
- :'ttl' => :'Float',
46
- :'limit' => :'Float'
47
- }
48
- end
49
-
50
- # List of attributes with nullable: true
51
- def self.openapi_nullable
52
- Set.new([
53
- ])
54
- end
55
-
56
- # Initializes the object
57
- # @param [Hash] attributes Model attributes in the form of hash
58
- def initialize(attributes = {})
59
- if (!attributes.is_a?(Hash))
60
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::RateLimitEntry` initialize method"
61
- end
62
-
63
- # check to see if the attribute exists and convert string to symbol for hash key
64
- acceptable_attribute_map = self.class.acceptable_attribute_map
65
- attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!acceptable_attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::RateLimitEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
- end
69
- h[k.to_sym] = v
70
- }
71
-
72
- if attributes.key?(:'ttl')
73
- self.ttl = attributes[:'ttl']
74
- end
75
-
76
- if attributes.key?(:'limit')
77
- self.limit = attributes[:'limit']
78
- end
79
- end
80
-
81
- # Show invalid properties with the reasons. Usually used together with valid?
82
- # @return Array for valid properties with the reasons
83
- def list_invalid_properties
84
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
- invalid_properties = Array.new
86
- invalid_properties
87
- end
88
-
89
- # Check to see if the all the properties in the model are valid
90
- # @return true if the model is valid
91
- def valid?
92
- warn '[DEPRECATED] the `valid?` method is obsolete'
93
- true
94
- end
95
-
96
- # Checks equality by comparing each attribute.
97
- # @param [Object] Object to be compared
98
- def ==(o)
99
- return true if self.equal?(o)
100
- self.class == o.class &&
101
- ttl == o.ttl &&
102
- limit == o.limit
103
- end
104
-
105
- # @see the `==` method
106
- # @param [Object] Object to be compared
107
- def eql?(o)
108
- self == o
109
- end
110
-
111
- # Calculates hash code according to all attributes.
112
- # @return [Integer] Hash code
113
- def hash
114
- [ttl, limit].hash
115
- end
116
-
117
- # Builds the object from hash
118
- # @param [Hash] attributes Model attributes in the form of hash
119
- # @return [Object] Returns the model itself
120
- def self.build_from_hash(attributes)
121
- return nil unless attributes.is_a?(Hash)
122
- attributes = attributes.transform_keys(&:to_sym)
123
- transformed_hash = {}
124
- openapi_types.each_pair do |key, type|
125
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
- transformed_hash["#{key}"] = nil
127
- elsif type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the attribute
129
- # is documented as an array but the input is not
130
- if attributes[attribute_map[key]].is_a?(Array)
131
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
- end
133
- elsif !attributes[attribute_map[key]].nil?
134
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
- end
136
- end
137
- new(transformed_hash)
138
- end
139
-
140
- # Deserializes the data based on type
141
- # @param string type Data type
142
- # @param string value Value to be deserialized
143
- # @return [Object] Deserialized data
144
- def self._deserialize(type, value)
145
- case type.to_sym
146
- when :Time
147
- Time.parse(value)
148
- when :Date
149
- Date.parse(value)
150
- when :String
151
- value.to_s
152
- when :Integer
153
- value.to_i
154
- when :Float
155
- value.to_f
156
- when :Boolean
157
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
- true
159
- else
160
- false
161
- end
162
- when :Object
163
- # generic object (usually a Hash), return directly
164
- value
165
- when /\AArray<(?<inner_type>.+)>\z/
166
- inner_type = Regexp.last_match[:inner_type]
167
- value.map { |v| _deserialize(inner_type, v) }
168
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
- k_type = Regexp.last_match[:k_type]
170
- v_type = Regexp.last_match[:v_type]
171
- {}.tap do |hash|
172
- value.each do |k, v|
173
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
- end
175
- end
176
- else # model
177
- # models (e.g. Pet) or oneOf
178
- klass = DaytonaApiClient.const_get(type)
179
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
- end
181
- end
182
-
183
- # Returns the string representation of the object
184
- # @return [String] String presentation of the object
185
- def to_s
186
- to_hash.to_s
187
- end
188
-
189
- # to_body is an alias to to_hash (backward compatibility)
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_body
192
- to_hash
193
- end
194
-
195
- # Returns the object in the form of hash
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_hash
198
- hash = {}
199
- self.class.attribute_map.each_pair do |attr, param|
200
- value = self.send(attr)
201
- if value.nil?
202
- is_nullable = self.class.openapi_nullable.include?(attr)
203
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
- end
205
-
206
- hash[param] = _to_hash(value)
207
- end
208
- hash
209
- end
210
-
211
- # Outputs non-array value in the form of hash
212
- # For object, use to_hash. Otherwise, just return the value
213
- # @param [Object] value Any valid value
214
- # @return [Hash] Returns the value in the form of hash
215
- def _to_hash(value)
216
- if value.is_a?(Array)
217
- value.compact.map { |v| _to_hash(v) }
218
- elsif value.is_a?(Hash)
219
- {}.tap do |hash|
220
- value.each { |k, v| hash[k] = _to_hash(v) }
221
- end
222
- elsif value.respond_to? :to_hash
223
- value.to_hash
224
- else
225
- value
226
- end
227
- end
228
- end
229
- end
@@ -1,339 +0,0 @@
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 RegionQuota
18
- attr_accessor :organization_id
19
-
20
- attr_accessor :region_id
21
-
22
- attr_accessor :total_cpu_quota
23
-
24
- attr_accessor :total_memory_quota
25
-
26
- attr_accessor :total_disk_quota
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'organization_id' => :'organizationId',
32
- :'region_id' => :'regionId',
33
- :'total_cpu_quota' => :'totalCpuQuota',
34
- :'total_memory_quota' => :'totalMemoryQuota',
35
- :'total_disk_quota' => :'totalDiskQuota'
36
- }
37
- end
38
-
39
- # Returns attribute mapping this model knows about
40
- def self.acceptable_attribute_map
41
- attribute_map
42
- end
43
-
44
- # Returns all the JSON keys this model knows about
45
- def self.acceptable_attributes
46
- acceptable_attribute_map.values
47
- end
48
-
49
- # Attribute type mapping.
50
- def self.openapi_types
51
- {
52
- :'organization_id' => :'String',
53
- :'region_id' => :'String',
54
- :'total_cpu_quota' => :'Float',
55
- :'total_memory_quota' => :'Float',
56
- :'total_disk_quota' => :'Float'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- ])
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::RegionQuota` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- acceptable_attribute_map = self.class.acceptable_attribute_map
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!acceptable_attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::RegionQuota`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'organization_id')
83
- self.organization_id = attributes[:'organization_id']
84
- else
85
- self.organization_id = nil
86
- end
87
-
88
- if attributes.key?(:'region_id')
89
- self.region_id = attributes[:'region_id']
90
- else
91
- self.region_id = nil
92
- end
93
-
94
- if attributes.key?(:'total_cpu_quota')
95
- self.total_cpu_quota = attributes[:'total_cpu_quota']
96
- else
97
- self.total_cpu_quota = nil
98
- end
99
-
100
- if attributes.key?(:'total_memory_quota')
101
- self.total_memory_quota = attributes[:'total_memory_quota']
102
- else
103
- self.total_memory_quota = nil
104
- end
105
-
106
- if attributes.key?(:'total_disk_quota')
107
- self.total_disk_quota = attributes[:'total_disk_quota']
108
- else
109
- self.total_disk_quota = nil
110
- end
111
- end
112
-
113
- # Show invalid properties with the reasons. Usually used together with valid?
114
- # @return Array for valid properties with the reasons
115
- def list_invalid_properties
116
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
117
- invalid_properties = Array.new
118
- if @organization_id.nil?
119
- invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
120
- end
121
-
122
- if @region_id.nil?
123
- invalid_properties.push('invalid value for "region_id", region_id cannot be nil.')
124
- end
125
-
126
- if @total_cpu_quota.nil?
127
- invalid_properties.push('invalid value for "total_cpu_quota", total_cpu_quota cannot be nil.')
128
- end
129
-
130
- if @total_memory_quota.nil?
131
- invalid_properties.push('invalid value for "total_memory_quota", total_memory_quota cannot be nil.')
132
- end
133
-
134
- if @total_disk_quota.nil?
135
- invalid_properties.push('invalid value for "total_disk_quota", total_disk_quota cannot be nil.')
136
- end
137
-
138
- invalid_properties
139
- end
140
-
141
- # Check to see if the all the properties in the model are valid
142
- # @return true if the model is valid
143
- def valid?
144
- warn '[DEPRECATED] the `valid?` method is obsolete'
145
- return false if @organization_id.nil?
146
- return false if @region_id.nil?
147
- return false if @total_cpu_quota.nil?
148
- return false if @total_memory_quota.nil?
149
- return false if @total_disk_quota.nil?
150
- true
151
- end
152
-
153
- # Custom attribute writer method with validation
154
- # @param [Object] organization_id Value to be assigned
155
- def organization_id=(organization_id)
156
- if organization_id.nil?
157
- fail ArgumentError, 'organization_id cannot be nil'
158
- end
159
-
160
- @organization_id = organization_id
161
- end
162
-
163
- # Custom attribute writer method with validation
164
- # @param [Object] region_id Value to be assigned
165
- def region_id=(region_id)
166
- if region_id.nil?
167
- fail ArgumentError, 'region_id cannot be nil'
168
- end
169
-
170
- @region_id = region_id
171
- end
172
-
173
- # Custom attribute writer method with validation
174
- # @param [Object] total_cpu_quota Value to be assigned
175
- def total_cpu_quota=(total_cpu_quota)
176
- if total_cpu_quota.nil?
177
- fail ArgumentError, 'total_cpu_quota cannot be nil'
178
- end
179
-
180
- @total_cpu_quota = total_cpu_quota
181
- end
182
-
183
- # Custom attribute writer method with validation
184
- # @param [Object] total_memory_quota Value to be assigned
185
- def total_memory_quota=(total_memory_quota)
186
- if total_memory_quota.nil?
187
- fail ArgumentError, 'total_memory_quota cannot be nil'
188
- end
189
-
190
- @total_memory_quota = total_memory_quota
191
- end
192
-
193
- # Custom attribute writer method with validation
194
- # @param [Object] total_disk_quota Value to be assigned
195
- def total_disk_quota=(total_disk_quota)
196
- if total_disk_quota.nil?
197
- fail ArgumentError, 'total_disk_quota cannot be nil'
198
- end
199
-
200
- @total_disk_quota = total_disk_quota
201
- end
202
-
203
- # Checks equality by comparing each attribute.
204
- # @param [Object] Object to be compared
205
- def ==(o)
206
- return true if self.equal?(o)
207
- self.class == o.class &&
208
- organization_id == o.organization_id &&
209
- region_id == o.region_id &&
210
- total_cpu_quota == o.total_cpu_quota &&
211
- total_memory_quota == o.total_memory_quota &&
212
- total_disk_quota == o.total_disk_quota
213
- end
214
-
215
- # @see the `==` method
216
- # @param [Object] Object to be compared
217
- def eql?(o)
218
- self == o
219
- end
220
-
221
- # Calculates hash code according to all attributes.
222
- # @return [Integer] Hash code
223
- def hash
224
- [organization_id, region_id, total_cpu_quota, total_memory_quota, total_disk_quota].hash
225
- end
226
-
227
- # Builds the object from hash
228
- # @param [Hash] attributes Model attributes in the form of hash
229
- # @return [Object] Returns the model itself
230
- def self.build_from_hash(attributes)
231
- return nil unless attributes.is_a?(Hash)
232
- attributes = attributes.transform_keys(&:to_sym)
233
- transformed_hash = {}
234
- openapi_types.each_pair do |key, type|
235
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
236
- transformed_hash["#{key}"] = nil
237
- elsif type =~ /\AArray<(.*)>/i
238
- # check to ensure the input is an array given that the attribute
239
- # is documented as an array but the input is not
240
- if attributes[attribute_map[key]].is_a?(Array)
241
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
242
- end
243
- elsif !attributes[attribute_map[key]].nil?
244
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
245
- end
246
- end
247
- new(transformed_hash)
248
- end
249
-
250
- # Deserializes the data based on type
251
- # @param string type Data type
252
- # @param string value Value to be deserialized
253
- # @return [Object] Deserialized data
254
- def self._deserialize(type, value)
255
- case type.to_sym
256
- when :Time
257
- Time.parse(value)
258
- when :Date
259
- Date.parse(value)
260
- when :String
261
- value.to_s
262
- when :Integer
263
- value.to_i
264
- when :Float
265
- value.to_f
266
- when :Boolean
267
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
268
- true
269
- else
270
- false
271
- end
272
- when :Object
273
- # generic object (usually a Hash), return directly
274
- value
275
- when /\AArray<(?<inner_type>.+)>\z/
276
- inner_type = Regexp.last_match[:inner_type]
277
- value.map { |v| _deserialize(inner_type, v) }
278
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
279
- k_type = Regexp.last_match[:k_type]
280
- v_type = Regexp.last_match[:v_type]
281
- {}.tap do |hash|
282
- value.each do |k, v|
283
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
284
- end
285
- end
286
- else # model
287
- # models (e.g. Pet) or oneOf
288
- klass = DaytonaApiClient.const_get(type)
289
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
- end
291
- end
292
-
293
- # Returns the string representation of the object
294
- # @return [String] String presentation of the object
295
- def to_s
296
- to_hash.to_s
297
- end
298
-
299
- # to_body is an alias to to_hash (backward compatibility)
300
- # @return [Hash] Returns the object in the form of hash
301
- def to_body
302
- to_hash
303
- end
304
-
305
- # Returns the object in the form of hash
306
- # @return [Hash] Returns the object in the form of hash
307
- def to_hash
308
- hash = {}
309
- self.class.attribute_map.each_pair do |attr, param|
310
- value = self.send(attr)
311
- if value.nil?
312
- is_nullable = self.class.openapi_nullable.include?(attr)
313
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
- end
315
-
316
- hash[param] = _to_hash(value)
317
- end
318
- hash
319
- end
320
-
321
- # Outputs non-array value in the form of hash
322
- # For object, use to_hash. Otherwise, just return the value
323
- # @param [Object] value Any valid value
324
- # @return [Hash] Returns the value in the form of hash
325
- def _to_hash(value)
326
- if value.is_a?(Array)
327
- value.compact.map { |v| _to_hash(v) }
328
- elsif value.is_a?(Hash)
329
- {}.tap do |hash|
330
- value.each { |k, v| hash[k] = _to_hash(v) }
331
- end
332
- elsif value.respond_to? :to_hash
333
- value.to_hash
334
- else
335
- value
336
- end
337
- end
338
- end
339
- end