daytona_api_client 0.176.0 → 0.180.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.
@@ -1,340 +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.21.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module DaytonaApiClient
17
- class CreateWorkspace < ApiModelBase
18
- # The image used for the workspace
19
- attr_accessor :image
20
-
21
- # The user associated with the project
22
- attr_accessor :user
23
-
24
- # Environment variables for the workspace
25
- attr_accessor :env
26
-
27
- # Labels for the workspace
28
- attr_accessor :labels
29
-
30
- # Whether the workspace http preview is publicly accessible
31
- attr_accessor :public
32
-
33
- # The workspace class type
34
- attr_accessor :_class
35
-
36
- # The target (region) where the workspace will be created
37
- attr_accessor :target
38
-
39
- # CPU cores allocated to the workspace
40
- attr_accessor :cpu
41
-
42
- # GPU units allocated to the workspace
43
- attr_accessor :gpu
44
-
45
- # Memory allocated to the workspace in GB
46
- attr_accessor :memory
47
-
48
- # Disk space allocated to the workspace in GB
49
- attr_accessor :disk
50
-
51
- # Auto-stop interval in minutes (0 means disabled)
52
- attr_accessor :auto_stop_interval
53
-
54
- # Auto-archive interval in minutes (0 means the maximum interval will be used)
55
- attr_accessor :auto_archive_interval
56
-
57
- # Array of volumes to attach to the workspace
58
- attr_accessor :volumes
59
-
60
- # Build information for the workspace
61
- attr_accessor :build_info
62
-
63
- class EnumAttributeValidator
64
- attr_reader :datatype
65
- attr_reader :allowable_values
66
-
67
- def initialize(datatype, allowable_values)
68
- @allowable_values = allowable_values.map do |value|
69
- case datatype.to_s
70
- when /Integer/i
71
- value.to_i
72
- when /Float/i
73
- value.to_f
74
- else
75
- value
76
- end
77
- end
78
- end
79
-
80
- def valid?(value)
81
- !value || allowable_values.include?(value)
82
- end
83
- end
84
-
85
- # Attribute mapping from ruby-style variable name to JSON key.
86
- def self.attribute_map
87
- {
88
- :'image' => :'image',
89
- :'user' => :'user',
90
- :'env' => :'env',
91
- :'labels' => :'labels',
92
- :'public' => :'public',
93
- :'_class' => :'class',
94
- :'target' => :'target',
95
- :'cpu' => :'cpu',
96
- :'gpu' => :'gpu',
97
- :'memory' => :'memory',
98
- :'disk' => :'disk',
99
- :'auto_stop_interval' => :'autoStopInterval',
100
- :'auto_archive_interval' => :'autoArchiveInterval',
101
- :'volumes' => :'volumes',
102
- :'build_info' => :'buildInfo'
103
- }
104
- end
105
-
106
- # Returns attribute mapping this model knows about
107
- def self.acceptable_attribute_map
108
- attribute_map
109
- end
110
-
111
- # Returns all the JSON keys this model knows about
112
- def self.acceptable_attributes
113
- acceptable_attribute_map.values
114
- end
115
-
116
- # Attribute type mapping.
117
- def self.openapi_types
118
- {
119
- :'image' => :'String',
120
- :'user' => :'String',
121
- :'env' => :'Hash<String, String>',
122
- :'labels' => :'Hash<String, String>',
123
- :'public' => :'Boolean',
124
- :'_class' => :'String',
125
- :'target' => :'String',
126
- :'cpu' => :'Integer',
127
- :'gpu' => :'Integer',
128
- :'memory' => :'Integer',
129
- :'disk' => :'Integer',
130
- :'auto_stop_interval' => :'Integer',
131
- :'auto_archive_interval' => :'Integer',
132
- :'volumes' => :'Array<SandboxVolume>',
133
- :'build_info' => :'CreateBuildInfo'
134
- }
135
- end
136
-
137
- # List of attributes with nullable: true
138
- def self.openapi_nullable
139
- Set.new([
140
- ])
141
- end
142
-
143
- # Initializes the object
144
- # @param [Hash] attributes Model attributes in the form of hash
145
- def initialize(attributes = {})
146
- if (!attributes.is_a?(Hash))
147
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateWorkspace` initialize method"
148
- end
149
-
150
- # check to see if the attribute exists and convert string to symbol for hash key
151
- acceptable_attribute_map = self.class.acceptable_attribute_map
152
- attributes = attributes.each_with_object({}) { |(k, v), h|
153
- if (!acceptable_attribute_map.key?(k.to_sym))
154
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateWorkspace`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
155
- end
156
- h[k.to_sym] = v
157
- }
158
-
159
- if attributes.key?(:'image')
160
- self.image = attributes[:'image']
161
- end
162
-
163
- if attributes.key?(:'user')
164
- self.user = attributes[:'user']
165
- end
166
-
167
- if attributes.key?(:'env')
168
- if (value = attributes[:'env']).is_a?(Hash)
169
- self.env = value
170
- end
171
- end
172
-
173
- if attributes.key?(:'labels')
174
- if (value = attributes[:'labels']).is_a?(Hash)
175
- self.labels = value
176
- end
177
- end
178
-
179
- if attributes.key?(:'public')
180
- self.public = attributes[:'public']
181
- end
182
-
183
- if attributes.key?(:'_class')
184
- self._class = attributes[:'_class']
185
- end
186
-
187
- if attributes.key?(:'target')
188
- self.target = attributes[:'target']
189
- end
190
-
191
- if attributes.key?(:'cpu')
192
- self.cpu = attributes[:'cpu']
193
- end
194
-
195
- if attributes.key?(:'gpu')
196
- self.gpu = attributes[:'gpu']
197
- end
198
-
199
- if attributes.key?(:'memory')
200
- self.memory = attributes[:'memory']
201
- end
202
-
203
- if attributes.key?(:'disk')
204
- self.disk = attributes[:'disk']
205
- end
206
-
207
- if attributes.key?(:'auto_stop_interval')
208
- self.auto_stop_interval = attributes[:'auto_stop_interval']
209
- end
210
-
211
- if attributes.key?(:'auto_archive_interval')
212
- self.auto_archive_interval = attributes[:'auto_archive_interval']
213
- end
214
-
215
- if attributes.key?(:'volumes')
216
- if (value = attributes[:'volumes']).is_a?(Array)
217
- self.volumes = value
218
- end
219
- end
220
-
221
- if attributes.key?(:'build_info')
222
- self.build_info = attributes[:'build_info']
223
- end
224
- end
225
-
226
- # Show invalid properties with the reasons. Usually used together with valid?
227
- # @return Array for valid properties with the reasons
228
- def list_invalid_properties
229
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
230
- invalid_properties = Array.new
231
- invalid_properties
232
- end
233
-
234
- # Check to see if the all the properties in the model are valid
235
- # @return true if the model is valid
236
- def valid?
237
- warn '[DEPRECATED] the `valid?` method is obsolete'
238
- _class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large", "unknown_default_open_api"])
239
- return false unless _class_validator.valid?(@_class)
240
- target_validator = EnumAttributeValidator.new('String', ["eu", "us", "asia", "unknown_default_open_api"])
241
- return false unless target_validator.valid?(@target)
242
- true
243
- end
244
-
245
- # Custom attribute writer method checking allowed values (enum).
246
- # @param [Object] _class Object to be assigned
247
- def _class=(_class)
248
- validator = EnumAttributeValidator.new('String', ["small", "medium", "large", "unknown_default_open_api"])
249
- unless validator.valid?(_class)
250
- fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
251
- end
252
- @_class = _class
253
- end
254
-
255
- # Custom attribute writer method checking allowed values (enum).
256
- # @param [Object] target Object to be assigned
257
- def target=(target)
258
- validator = EnumAttributeValidator.new('String', ["eu", "us", "asia", "unknown_default_open_api"])
259
- unless validator.valid?(target)
260
- fail ArgumentError, "invalid value for \"target\", must be one of #{validator.allowable_values}."
261
- end
262
- @target = target
263
- end
264
-
265
- # Checks equality by comparing each attribute.
266
- # @param [Object] Object to be compared
267
- def ==(o)
268
- return true if self.equal?(o)
269
- self.class == o.class &&
270
- image == o.image &&
271
- user == o.user &&
272
- env == o.env &&
273
- labels == o.labels &&
274
- public == o.public &&
275
- _class == o._class &&
276
- target == o.target &&
277
- cpu == o.cpu &&
278
- gpu == o.gpu &&
279
- memory == o.memory &&
280
- disk == o.disk &&
281
- auto_stop_interval == o.auto_stop_interval &&
282
- auto_archive_interval == o.auto_archive_interval &&
283
- volumes == o.volumes &&
284
- build_info == o.build_info
285
- end
286
-
287
- # @see the `==` method
288
- # @param [Object] Object to be compared
289
- def eql?(o)
290
- self == o
291
- end
292
-
293
- # Calculates hash code according to all attributes.
294
- # @return [Integer] Hash code
295
- def hash
296
- [image, user, env, labels, public, _class, target, cpu, gpu, memory, disk, auto_stop_interval, auto_archive_interval, volumes, build_info].hash
297
- end
298
-
299
- # Builds the object from hash
300
- # @param [Hash] attributes Model attributes in the form of hash
301
- # @return [Object] Returns the model itself
302
- def self.build_from_hash(attributes)
303
- return nil unless attributes.is_a?(Hash)
304
- attributes = attributes.transform_keys(&:to_sym)
305
- transformed_hash = {}
306
- openapi_types.each_pair do |key, type|
307
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
308
- transformed_hash["#{key}"] = nil
309
- elsif type =~ /\AArray<(.*)>/i
310
- # check to ensure the input is an array given that the attribute
311
- # is documented as an array but the input is not
312
- if attributes[attribute_map[key]].is_a?(Array)
313
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
314
- end
315
- elsif !attributes[attribute_map[key]].nil?
316
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
317
- end
318
- end
319
- new(transformed_hash)
320
- end
321
-
322
- # Returns the object in the form of hash
323
- # @return [Hash] Returns the object in the form of hash
324
- def to_hash
325
- hash = {}
326
- self.class.attribute_map.each_pair do |attr, param|
327
- value = self.send(attr)
328
- if value.nil?
329
- is_nullable = self.class.openapi_nullable.include?(attr)
330
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
- end
332
-
333
- hash[param] = _to_hash(value)
334
- end
335
- hash
336
- end
337
-
338
- end
339
-
340
- end
@@ -1,202 +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.21.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module DaytonaApiClient
17
- class SandboxInfo < ApiModelBase
18
- # The creation timestamp of the project
19
- attr_accessor :created
20
-
21
- # Deprecated: The name of the sandbox
22
- attr_accessor :name
23
-
24
- # Additional metadata provided by the provider
25
- attr_accessor :provider_metadata
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- def self.attribute_map
29
- {
30
- :'created' => :'created',
31
- :'name' => :'name',
32
- :'provider_metadata' => :'providerMetadata'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'created' => :'String',
50
- :'name' => :'String',
51
- :'provider_metadata' => :'String'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SandboxInfo` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- acceptable_attribute_map = self.class.acceptable_attribute_map
70
- attributes = attributes.each_with_object({}) { |(k, v), h|
71
- if (!acceptable_attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SandboxInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
- end
74
- h[k.to_sym] = v
75
- }
76
-
77
- if attributes.key?(:'created')
78
- self.created = attributes[:'created']
79
- else
80
- self.created = nil
81
- end
82
-
83
- if attributes.key?(:'name')
84
- self.name = attributes[:'name']
85
- else
86
- self.name = ''
87
- end
88
-
89
- if attributes.key?(:'provider_metadata')
90
- self.provider_metadata = attributes[:'provider_metadata']
91
- end
92
- end
93
-
94
- # Show invalid properties with the reasons. Usually used together with valid?
95
- # @return Array for valid properties with the reasons
96
- def list_invalid_properties
97
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
- invalid_properties = Array.new
99
- if @created.nil?
100
- invalid_properties.push('invalid value for "created", created cannot be nil.')
101
- end
102
-
103
- if @name.nil?
104
- invalid_properties.push('invalid value for "name", name cannot be nil.')
105
- end
106
-
107
- invalid_properties
108
- end
109
-
110
- # Check to see if the all the properties in the model are valid
111
- # @return true if the model is valid
112
- def valid?
113
- warn '[DEPRECATED] the `valid?` method is obsolete'
114
- return false if @created.nil?
115
- return false if @name.nil?
116
- true
117
- end
118
-
119
- # Custom attribute writer method with validation
120
- # @param [Object] created Value to be assigned
121
- def created=(created)
122
- if created.nil?
123
- fail ArgumentError, 'created cannot be nil'
124
- end
125
-
126
- @created = created
127
- end
128
-
129
- # Custom attribute writer method with validation
130
- # @param [Object] name Value to be assigned
131
- def name=(name)
132
- if name.nil?
133
- fail ArgumentError, 'name cannot be nil'
134
- end
135
-
136
- @name = name
137
- end
138
-
139
- # Checks equality by comparing each attribute.
140
- # @param [Object] Object to be compared
141
- def ==(o)
142
- return true if self.equal?(o)
143
- self.class == o.class &&
144
- created == o.created &&
145
- name == o.name &&
146
- provider_metadata == o.provider_metadata
147
- end
148
-
149
- # @see the `==` method
150
- # @param [Object] Object to be compared
151
- def eql?(o)
152
- self == o
153
- end
154
-
155
- # Calculates hash code according to all attributes.
156
- # @return [Integer] Hash code
157
- def hash
158
- [created, name, provider_metadata].hash
159
- end
160
-
161
- # Builds the object from hash
162
- # @param [Hash] attributes Model attributes in the form of hash
163
- # @return [Object] Returns the model itself
164
- def self.build_from_hash(attributes)
165
- return nil unless attributes.is_a?(Hash)
166
- attributes = attributes.transform_keys(&:to_sym)
167
- transformed_hash = {}
168
- openapi_types.each_pair do |key, type|
169
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
- transformed_hash["#{key}"] = nil
171
- elsif type =~ /\AArray<(.*)>/i
172
- # check to ensure the input is an array given that the attribute
173
- # is documented as an array but the input is not
174
- if attributes[attribute_map[key]].is_a?(Array)
175
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
- end
177
- elsif !attributes[attribute_map[key]].nil?
178
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
- end
180
- end
181
- new(transformed_hash)
182
- end
183
-
184
- # Returns the object in the form of hash
185
- # @return [Hash] Returns the object in the form of hash
186
- def to_hash
187
- hash = {}
188
- self.class.attribute_map.each_pair do |attr, param|
189
- value = self.send(attr)
190
- if value.nil?
191
- is_nullable = self.class.openapi_nullable.include?(attr)
192
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
- end
194
-
195
- hash[param] = _to_hash(value)
196
- end
197
- hash
198
- end
199
-
200
- end
201
-
202
- end