volcano-sdk 0.32.7 → 0.33.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/lib/volcano/client.rb +3 -2
  4. data/lib/volcano/generated/lib/volcano-generated/api/sandboxes_api.rb +1433 -0
  5. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_session_request.rb +294 -0
  6. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_template_request.rb +247 -0
  7. data/lib/volcano/generated/lib/volcano-generated/models/publish_sandbox_preset_request.rb +268 -0
  8. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_access.rb +216 -0
  9. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_access_request.rb +221 -0
  10. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_capacity.rb +199 -0
  11. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_capacity_list.rb +166 -0
  12. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_request.rb +251 -0
  13. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_result.rb +294 -0
  14. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_deployment.rb +242 -0
  15. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_deployment_page.rb +192 -0
  16. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_request.rb +329 -0
  17. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_result.rb +381 -0
  18. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_read_request.rb +182 -0
  19. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_result.rb +164 -0
  20. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_write_request.rb +217 -0
  21. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_pagination.rb +199 -0
  22. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_preset.rb +294 -0
  23. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_preset_list.rb +166 -0
  24. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session.rb +407 -0
  25. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session_page.rb +192 -0
  26. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_subject_grant_request.rb +164 -0
  27. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_template.rb +321 -0
  28. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_template_page.rb +192 -0
  29. data/lib/volcano/generated/lib/volcano-generated/models/update_sandbox_template_request.rb +175 -0
  30. data/lib/volcano/generated/lib/volcano-generated.rb +26 -0
  31. data/lib/volcano/generated_transport.rb +1 -0
  32. data/lib/volcano/generated_transport_sandbox.rb +69 -0
  33. data/lib/volcano/sandbox_files.rb +37 -0
  34. data/lib/volcano/sandbox_models.rb +24 -0
  35. data/lib/volcano/sandbox_request.rb +92 -0
  36. data/lib/volcano/sandbox_response.rb +74 -0
  37. data/lib/volcano/sandbox_session.rb +78 -0
  38. data/lib/volcano/sandboxes.rb +67 -0
  39. data/lib/volcano/version.rb +1 -1
  40. data/lib/volcano.rb +7 -0
  41. data/sig/client.rbs +1 -0
  42. data/sig/sandboxes.rbs +83 -0
  43. metadata +50 -2
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #Volcano Hosting API
3
+
4
+ #Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations.
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: support@volcano.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Volcano::Generated
17
+ class SandboxDeploymentPage < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ attr_accessor :pagination
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'data' => :'data',
26
+ :'pagination' => :'pagination'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'Array<SandboxDeployment>',
44
+ :'pagination' => :'SandboxPagination'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxDeploymentPage` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxDeploymentPage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'data')
71
+ if (value = attributes[:'data']).is_a?(Array)
72
+ self.data = value
73
+ end
74
+ else
75
+ self.data = nil
76
+ end
77
+
78
+ if attributes.key?(:'pagination')
79
+ self.pagination = attributes[:'pagination']
80
+ else
81
+ self.pagination = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @data.nil?
91
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
92
+ end
93
+
94
+ if @pagination.nil?
95
+ invalid_properties.push('invalid value for "pagination", pagination cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @data.nil?
106
+ return false if @pagination.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] data Value to be assigned
112
+ def data=(data)
113
+ if data.nil?
114
+ fail ArgumentError, 'data cannot be nil'
115
+ end
116
+
117
+ @data = data
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] pagination Value to be assigned
122
+ def pagination=(pagination)
123
+ if pagination.nil?
124
+ fail ArgumentError, 'pagination cannot be nil'
125
+ end
126
+
127
+ @pagination = pagination
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ data == o.data &&
136
+ pagination == o.pagination
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [data, pagination].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end
@@ -0,0 +1,329 @@
1
+ =begin
2
+ #Volcano Hosting API
3
+
4
+ #Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations.
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: support@volcano.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Volcano::Generated
17
+ class SandboxExecutionRequest < ApiModelBase
18
+ # Preset ID from the available Sandbox preset catalog.
19
+ attr_accessor :preset
20
+
21
+ attr_accessor :sandbox_id
22
+
23
+ attr_accessor :memory_mb
24
+
25
+ # Region such as `us-east-1`. Region IDs issued by earlier versions of the API are still accepted.
26
+ attr_accessor :region
27
+
28
+ attr_accessor :command
29
+
30
+ attr_accessor :timeout_seconds
31
+
32
+ attr_accessor :environment
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'preset' => :'preset',
38
+ :'sandbox_id' => :'sandbox_id',
39
+ :'memory_mb' => :'memory_mb',
40
+ :'region' => :'region',
41
+ :'command' => :'command',
42
+ :'timeout_seconds' => :'timeout_seconds',
43
+ :'environment' => :'environment'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'preset' => :'String',
61
+ :'sandbox_id' => :'String',
62
+ :'memory_mb' => :'Integer',
63
+ :'region' => :'String',
64
+ :'command' => :'String',
65
+ :'timeout_seconds' => :'Integer',
66
+ :'environment' => :'Hash<String, String>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxExecutionRequest` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxExecutionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'preset')
93
+ self.preset = attributes[:'preset']
94
+ end
95
+
96
+ if attributes.key?(:'sandbox_id')
97
+ self.sandbox_id = attributes[:'sandbox_id']
98
+ end
99
+
100
+ if attributes.key?(:'memory_mb')
101
+ self.memory_mb = attributes[:'memory_mb']
102
+ end
103
+
104
+ if attributes.key?(:'region')
105
+ self.region = attributes[:'region']
106
+ else
107
+ self.region = nil
108
+ end
109
+
110
+ if attributes.key?(:'command')
111
+ self.command = attributes[:'command']
112
+ else
113
+ self.command = nil
114
+ end
115
+
116
+ if attributes.key?(:'timeout_seconds')
117
+ self.timeout_seconds = attributes[:'timeout_seconds']
118
+ else
119
+ self.timeout_seconds = 60
120
+ end
121
+
122
+ if attributes.key?(:'environment')
123
+ if (value = attributes[:'environment']).is_a?(Hash)
124
+ self.environment = value
125
+ end
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @region.nil?
135
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
136
+ end
137
+
138
+ pattern = Regexp.new(/^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$/)
139
+ if @region !~ pattern
140
+ invalid_properties.push("invalid value for \"region\", must conform to the pattern #{pattern}.")
141
+ end
142
+
143
+ if @command.nil?
144
+ invalid_properties.push('invalid value for "command", command cannot be nil.')
145
+ end
146
+
147
+ if @command.to_s.length > 65536
148
+ invalid_properties.push('invalid value for "command", the character length must be smaller than or equal to 65536.')
149
+ end
150
+
151
+ if @command.to_s.length < 1
152
+ invalid_properties.push('invalid value for "command", the character length must be greater than or equal to 1.')
153
+ end
154
+
155
+ if !@timeout_seconds.nil? && @timeout_seconds > 60
156
+ invalid_properties.push('invalid value for "timeout_seconds", must be smaller than or equal to 60.')
157
+ end
158
+
159
+ if !@timeout_seconds.nil? && @timeout_seconds < 1
160
+ invalid_properties.push('invalid value for "timeout_seconds", must be greater than or equal to 1.')
161
+ end
162
+
163
+ if !@environment.nil? && @environment.length > 64
164
+ invalid_properties.push('invalid value for "environment", number of items must be less than or equal to 64.')
165
+ end
166
+
167
+ invalid_properties
168
+ end
169
+
170
+ # Check to see if the all the properties in the model are valid
171
+ # @return true if the model is valid
172
+ def valid?
173
+ warn '[DEPRECATED] the `valid?` method is obsolete'
174
+ memory_mb_validator = EnumAttributeValidator.new('Integer', [1024, 2048])
175
+ return false unless memory_mb_validator.valid?(@memory_mb)
176
+ return false if @region.nil?
177
+ return false if @region !~ Regexp.new(/^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$/)
178
+ return false if @command.nil?
179
+ return false if @command.to_s.length > 65536
180
+ return false if @command.to_s.length < 1
181
+ return false if !@timeout_seconds.nil? && @timeout_seconds > 60
182
+ return false if !@timeout_seconds.nil? && @timeout_seconds < 1
183
+ return false if !@environment.nil? && @environment.length > 64
184
+ true
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] memory_mb Object to be assigned
189
+ def memory_mb=(memory_mb)
190
+ validator = EnumAttributeValidator.new('Integer', [1024, 2048])
191
+ unless validator.valid?(memory_mb)
192
+ fail ArgumentError, "invalid value for \"memory_mb\", must be one of #{validator.allowable_values}."
193
+ end
194
+ @memory_mb = memory_mb
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] region Value to be assigned
199
+ def region=(region)
200
+ if region.nil?
201
+ fail ArgumentError, 'region cannot be nil'
202
+ end
203
+
204
+ pattern = Regexp.new(/^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$/)
205
+ if region !~ pattern
206
+ fail ArgumentError, "invalid value for \"region\", must conform to the pattern #{pattern}."
207
+ end
208
+
209
+ @region = region
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] command Value to be assigned
214
+ def command=(command)
215
+ if command.nil?
216
+ fail ArgumentError, 'command cannot be nil'
217
+ end
218
+
219
+ if command.to_s.length > 65536
220
+ fail ArgumentError, 'invalid value for "command", the character length must be smaller than or equal to 65536.'
221
+ end
222
+
223
+ if command.to_s.length < 1
224
+ fail ArgumentError, 'invalid value for "command", the character length must be greater than or equal to 1.'
225
+ end
226
+
227
+ @command = command
228
+ end
229
+
230
+ # Custom attribute writer method with validation
231
+ # @param [Object] timeout_seconds Value to be assigned
232
+ def timeout_seconds=(timeout_seconds)
233
+ if timeout_seconds.nil?
234
+ fail ArgumentError, 'timeout_seconds cannot be nil'
235
+ end
236
+
237
+ if timeout_seconds > 60
238
+ fail ArgumentError, 'invalid value for "timeout_seconds", must be smaller than or equal to 60.'
239
+ end
240
+
241
+ if timeout_seconds < 1
242
+ fail ArgumentError, 'invalid value for "timeout_seconds", must be greater than or equal to 1.'
243
+ end
244
+
245
+ @timeout_seconds = timeout_seconds
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] environment Value to be assigned
250
+ def environment=(environment)
251
+ if environment.nil?
252
+ fail ArgumentError, 'environment cannot be nil'
253
+ end
254
+
255
+ if environment.length > 64
256
+ fail ArgumentError, 'invalid value for "environment", number of items must be less than or equal to 64.'
257
+ end
258
+
259
+ @environment = environment
260
+ end
261
+
262
+ # Checks equality by comparing each attribute.
263
+ # @param [Object] Object to be compared
264
+ def ==(o)
265
+ return true if self.equal?(o)
266
+ self.class == o.class &&
267
+ preset == o.preset &&
268
+ sandbox_id == o.sandbox_id &&
269
+ memory_mb == o.memory_mb &&
270
+ region == o.region &&
271
+ command == o.command &&
272
+ timeout_seconds == o.timeout_seconds &&
273
+ environment == o.environment
274
+ end
275
+
276
+ # @see the `==` method
277
+ # @param [Object] Object to be compared
278
+ def eql?(o)
279
+ self == o
280
+ end
281
+
282
+ # Calculates hash code according to all attributes.
283
+ # @return [Integer] Hash code
284
+ def hash
285
+ [preset, sandbox_id, memory_mb, region, command, timeout_seconds, environment].hash
286
+ end
287
+
288
+ # Builds the object from hash
289
+ # @param [Hash] attributes Model attributes in the form of hash
290
+ # @return [Object] Returns the model itself
291
+ def self.build_from_hash(attributes)
292
+ return nil unless attributes.is_a?(Hash)
293
+ attributes = attributes.transform_keys(&:to_sym)
294
+ transformed_hash = {}
295
+ openapi_types.each_pair do |key, type|
296
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
297
+ transformed_hash["#{key}"] = nil
298
+ elsif type =~ /\AArray<(.*)>/i
299
+ # check to ensure the input is an array given that the attribute
300
+ # is documented as an array but the input is not
301
+ if attributes[attribute_map[key]].is_a?(Array)
302
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
303
+ end
304
+ elsif !attributes[attribute_map[key]].nil?
305
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
306
+ end
307
+ end
308
+ new(transformed_hash)
309
+ end
310
+
311
+ # Returns the object in the form of hash
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_hash
314
+ hash = {}
315
+ self.class.attribute_map.each_pair do |attr, param|
316
+ value = self.send(attr)
317
+ if value.nil?
318
+ is_nullable = self.class.openapi_nullable.include?(attr)
319
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
320
+ end
321
+
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ end
328
+
329
+ end