volcano-sdk 0.32.6 → 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 (57) 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/auth_configuration_api.rb +6 -6
  5. data/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +4 -4
  6. data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
  7. data/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb +6 -6
  8. data/lib/volcano/generated/lib/volcano-generated/api/sandboxes_api.rb +1433 -0
  9. data/lib/volcano/generated/lib/volcano-generated/models/auth_config.rb +1 -1
  10. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_session_request.rb +294 -0
  11. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_template_request.rb +247 -0
  12. data/lib/volcano/generated/lib/volcano-generated/models/project.rb +3 -3
  13. data/lib/volcano/generated/lib/volcano-generated/models/project_config_auth_signup.rb +1 -1
  14. data/lib/volcano/generated/lib/volcano-generated/models/project_config_custom_domain.rb +1 -1
  15. data/lib/volcano/generated/lib/volcano-generated/models/project_config_email_template.rb +2 -2
  16. data/lib/volcano/generated/lib/volcano-generated/models/project_config_email_templates.rb +1 -1
  17. data/lib/volcano/generated/lib/volcano-generated/models/project_config_hosted_pages.rb +1 -1
  18. data/lib/volcano/generated/lib/volcano-generated/models/project_config_project.rb +1 -1
  19. data/lib/volcano/generated/lib/volcano-generated/models/publish_sandbox_preset_request.rb +268 -0
  20. data/lib/volcano/generated/lib/volcano-generated/models/realtime_plan_limits.rb +1 -1
  21. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_access.rb +216 -0
  22. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_access_request.rb +221 -0
  23. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_capacity.rb +199 -0
  24. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_capacity_list.rb +166 -0
  25. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_request.rb +251 -0
  26. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_result.rb +294 -0
  27. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_deployment.rb +242 -0
  28. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_deployment_page.rb +192 -0
  29. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_request.rb +329 -0
  30. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_result.rb +381 -0
  31. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_read_request.rb +182 -0
  32. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_result.rb +164 -0
  33. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_file_write_request.rb +217 -0
  34. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_pagination.rb +199 -0
  35. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_preset.rb +294 -0
  36. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_preset_list.rb +166 -0
  37. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session.rb +407 -0
  38. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session_page.rb +192 -0
  39. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_subject_grant_request.rb +164 -0
  40. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_template.rb +321 -0
  41. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_template_page.rb +192 -0
  42. data/lib/volcano/generated/lib/volcano-generated/models/update_auth_config_request.rb +1 -1
  43. data/lib/volcano/generated/lib/volcano-generated/models/update_sandbox_template_request.rb +175 -0
  44. data/lib/volcano/generated/lib/volcano-generated.rb +26 -0
  45. data/lib/volcano/generated_transport.rb +1 -0
  46. data/lib/volcano/generated_transport_sandbox.rb +69 -0
  47. data/lib/volcano/sandbox_files.rb +37 -0
  48. data/lib/volcano/sandbox_models.rb +24 -0
  49. data/lib/volcano/sandbox_request.rb +92 -0
  50. data/lib/volcano/sandbox_response.rb +74 -0
  51. data/lib/volcano/sandbox_session.rb +78 -0
  52. data/lib/volcano/sandboxes.rb +67 -0
  53. data/lib/volcano/version.rb +1 -1
  54. data/lib/volcano.rb +7 -0
  55. data/sig/client.rbs +1 -0
  56. data/sig/sandboxes.rbs +83 -0
  57. metadata +50 -2
@@ -0,0 +1,294 @@
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 SandboxPreset < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :runtime
21
+
22
+ attr_accessor :version
23
+
24
+ attr_accessor :memory_mb
25
+
26
+ attr_accessor :regions
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'id' => :'id',
54
+ :'runtime' => :'runtime',
55
+ :'version' => :'version',
56
+ :'memory_mb' => :'memory_mb',
57
+ :'regions' => :'regions'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'id' => :'String',
75
+ :'runtime' => :'String',
76
+ :'version' => :'String',
77
+ :'memory_mb' => :'Integer',
78
+ :'regions' => :'Array<String>'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxPreset` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxPreset`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'id')
105
+ self.id = attributes[:'id']
106
+ else
107
+ self.id = nil
108
+ end
109
+
110
+ if attributes.key?(:'runtime')
111
+ self.runtime = attributes[:'runtime']
112
+ else
113
+ self.runtime = nil
114
+ end
115
+
116
+ if attributes.key?(:'version')
117
+ self.version = attributes[:'version']
118
+ else
119
+ self.version = nil
120
+ end
121
+
122
+ if attributes.key?(:'memory_mb')
123
+ self.memory_mb = attributes[:'memory_mb']
124
+ else
125
+ self.memory_mb = nil
126
+ end
127
+
128
+ if attributes.key?(:'regions')
129
+ if (value = attributes[:'regions']).is_a?(Array)
130
+ self.regions = value
131
+ end
132
+ else
133
+ self.regions = nil
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
141
+ invalid_properties = Array.new
142
+ if @id.nil?
143
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
144
+ end
145
+
146
+ if @runtime.nil?
147
+ invalid_properties.push('invalid value for "runtime", runtime cannot be nil.')
148
+ end
149
+
150
+ if @version.nil?
151
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
152
+ end
153
+
154
+ if @memory_mb.nil?
155
+ invalid_properties.push('invalid value for "memory_mb", memory_mb cannot be nil.')
156
+ end
157
+
158
+ if @regions.nil?
159
+ invalid_properties.push('invalid value for "regions", regions cannot be nil.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
169
+ return false if @id.nil?
170
+ return false if @runtime.nil?
171
+ return false if @version.nil?
172
+ return false if @memory_mb.nil?
173
+ memory_mb_validator = EnumAttributeValidator.new('Integer', [1024, 2048])
174
+ return false unless memory_mb_validator.valid?(@memory_mb)
175
+ return false if @regions.nil?
176
+ true
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] id Value to be assigned
181
+ def id=(id)
182
+ if id.nil?
183
+ fail ArgumentError, 'id cannot be nil'
184
+ end
185
+
186
+ @id = id
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] runtime Value to be assigned
191
+ def runtime=(runtime)
192
+ if runtime.nil?
193
+ fail ArgumentError, 'runtime cannot be nil'
194
+ end
195
+
196
+ @runtime = runtime
197
+ end
198
+
199
+ # Custom attribute writer method with validation
200
+ # @param [Object] version Value to be assigned
201
+ def version=(version)
202
+ if version.nil?
203
+ fail ArgumentError, 'version cannot be nil'
204
+ end
205
+
206
+ @version = version
207
+ end
208
+
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] memory_mb Object to be assigned
211
+ def memory_mb=(memory_mb)
212
+ validator = EnumAttributeValidator.new('Integer', [1024, 2048])
213
+ unless validator.valid?(memory_mb)
214
+ fail ArgumentError, "invalid value for \"memory_mb\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @memory_mb = memory_mb
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] regions Value to be assigned
221
+ def regions=(regions)
222
+ if regions.nil?
223
+ fail ArgumentError, 'regions cannot be nil'
224
+ end
225
+
226
+ @regions = regions
227
+ end
228
+
229
+ # Checks equality by comparing each attribute.
230
+ # @param [Object] Object to be compared
231
+ def ==(o)
232
+ return true if self.equal?(o)
233
+ self.class == o.class &&
234
+ id == o.id &&
235
+ runtime == o.runtime &&
236
+ version == o.version &&
237
+ memory_mb == o.memory_mb &&
238
+ regions == o.regions
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [id, runtime, version, memory_mb, regions].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ return nil unless attributes.is_a?(Hash)
258
+ attributes = attributes.transform_keys(&:to_sym)
259
+ transformed_hash = {}
260
+ openapi_types.each_pair do |key, type|
261
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = nil
263
+ elsif type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[attribute_map[key]].is_a?(Array)
267
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
268
+ end
269
+ elsif !attributes[attribute_map[key]].nil?
270
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
271
+ end
272
+ end
273
+ new(transformed_hash)
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,166 @@
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 SandboxPresetList < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'data' => :'Array<SandboxPreset>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::SandboxPresetList` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::SandboxPresetList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'data')
67
+ if (value = attributes[:'data']).is_a?(Array)
68
+ self.data = value
69
+ end
70
+ else
71
+ self.data = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @data.nil?
81
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @data.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] data Value to be assigned
97
+ def data=(data)
98
+ if data.nil?
99
+ fail ArgumentError, 'data cannot be nil'
100
+ end
101
+
102
+ @data = data
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ data == o.data
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [data].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end