volcano-sdk 0.34.0 → 0.35.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.
- checksums.yaml +4 -4
- data/README.md +53 -4
- data/lib/volcano/client.rb +1 -1
- data/lib/volcano/durable.rb +9 -4
- data/lib/volcano/durable_approval_models.rb +1 -1
- data/lib/volcano/durable_message_arguments.rb +49 -0
- data/lib/volcano/durable_message_backlog.rb +38 -0
- data/lib/volcano/durable_message_catch_ups.rb +112 -0
- data/lib/volcano/durable_message_models.rb +62 -0
- data/lib/volcano/durable_message_responses.rb +107 -0
- data/lib/volcano/durable_message_session.rb +72 -0
- data/lib/volcano/durable_message_stream.rb +176 -0
- data/lib/volcano/durable_messages.rb +217 -0
- data/lib/volcano/durable_models.rb +32 -3
- data/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/autofix_api.rb +222 -0
- data/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +725 -0
- data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/issues_api.rb +254 -0
- data/lib/volcano/generated/lib/volcano-generated/api/sandboxes_api.rb +20 -20
- data/lib/volcano/generated/lib/volcano-generated/api/system_api.rb +57 -0
- data/lib/volcano/generated/lib/volcano-generated/api/variable_environments_api.rb +373 -0
- data/lib/volcano/generated/lib/volcano-generated/api/verified_domains_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/models/auth_config.rb +46 -4
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_series_point.rb +110 -2
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_model.rb +45 -0
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_provider.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_settings.rb +385 -0
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_stage.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/capability.rb +214 -0
- data/lib/volcano/generated/lib/volcano-generated/models/capability_list.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/capability_status.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_session_request.rb +16 -53
- data/lib/volcano/generated/lib/volcano-generated/models/create_variable_environment_request.rb +176 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution.rb +14 -4
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message.rb +396 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_direction.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_list.rb +194 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_sender.rb +203 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_session_registration.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_status.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait.rb +278 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_list.rb +167 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_registration.rb +225 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_status.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_conflict_error.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_response.rb +25 -2
- data/lib/volcano/generated/lib/volcano-generated/models/issue.rb +493 -0
- data/lib/volcano/generated/lib/volcano-generated/models/issue_status.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/open_durable_message_session_request.rb +228 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_issues.rb +230 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +10 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_autofix.rb +206 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_custom_domain.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_sandbox.rb +12 -50
- data/lib/volcano/generated/lib/volcano-generated/models/project_frontend_custom_domain.rb +25 -2
- data/lib/volcano/generated/lib/volcano-generated/models/publish_durable_message_request.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/register_durable_message_wait_request.rb +284 -0
- data/lib/volcano/generated/lib/volcano-generated/models/rename_variable_environment_request.rb +176 -0
- data/lib/volcano/generated/lib/volcano-generated/models/request_durable_approval_request.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_request.rb +11 -12
- data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_request.rb +51 -13
- data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session.rb +4 -30
- data/lib/volcano/generated/lib/volcano-generated/models/send_durable_message_request.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_auth_config_request.rb +79 -1
- data/lib/volcano/generated/lib/volcano-generated/models/update_autofix_settings_request.rb +273 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_issue_request.rb +186 -0
- data/lib/volcano/generated/lib/volcano-generated/models/variable_environment.rb +325 -0
- data/lib/volcano/generated/lib/volcano-generated/models/variable_environment_list.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated.rb +34 -0
- data/lib/volcano/generated_transport.rb +1 -0
- data/lib/volcano/generated_transport_durable_messages.rb +57 -0
- data/lib/volcano/realtime/channel_callbacks.rb +5 -1
- data/lib/volcano/realtime/channel_lifecycle.rb +4 -1
- data/lib/volcano/realtime/durable_channel.rb +47 -0
- data/lib/volcano/realtime/lifecycle.rb +37 -1
- data/lib/volcano/realtime/protocol.rb +7 -3
- data/lib/volcano/realtime/protocol_dispatch.rb +1 -1
- data/lib/volcano/realtime/protocol_io.rb +7 -4
- data/lib/volcano/realtime/protocol_lifecycle.rb +7 -0
- data/lib/volcano/realtime/protocol_recovery.rb +23 -12
- data/lib/volcano/realtime.rb +42 -8
- data/lib/volcano/redaction.rb +1 -1
- data/lib/volcano/version.rb +1 -1
- data/lib/volcano.rb +8 -0
- data/sig/core_facades.rbs +15 -0
- data/sig/durable_message_records.rbs +68 -0
- data/sig/durable_records.rbs +17 -9
- metadata +46 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Volcano API
|
|
3
|
+
|
|
4
|
+
#Public API for Volcano 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
|
+
# A product capability and whether it accepts new work in this environment.
|
|
18
|
+
class Capability < ApiModelBase
|
|
19
|
+
# Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, `sandboxes.custom_templates`, `issues`, or `autofix`. New IDs may appear at any time.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
attr_accessor :status
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'id' => :'id',
|
|
50
|
+
:'status' => :'status'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns attribute mapping this model knows about
|
|
55
|
+
def self.acceptable_attribute_map
|
|
56
|
+
attribute_map
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns all the JSON keys this model knows about
|
|
60
|
+
def self.acceptable_attributes
|
|
61
|
+
acceptable_attribute_map.values
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute type mapping.
|
|
65
|
+
def self.openapi_types
|
|
66
|
+
{
|
|
67
|
+
:'id' => :'String',
|
|
68
|
+
:'status' => :'CapabilityStatus'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# List of attributes with nullable: true
|
|
73
|
+
def self.openapi_nullable
|
|
74
|
+
Set.new([
|
|
75
|
+
])
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Initializes the object
|
|
79
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
80
|
+
def initialize(attributes = {})
|
|
81
|
+
if (!attributes.is_a?(Hash))
|
|
82
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::Capability` initialize method"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
86
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
88
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::Capability`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
90
|
+
end
|
|
91
|
+
h[k.to_sym] = v
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'id')
|
|
95
|
+
self.id = attributes[:'id']
|
|
96
|
+
else
|
|
97
|
+
self.id = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'status')
|
|
101
|
+
self.status = attributes[:'status']
|
|
102
|
+
else
|
|
103
|
+
self.status = nil
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
if @id.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @status.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
invalid_properties
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Check to see if the all the properties in the model are valid
|
|
124
|
+
# @return true if the model is valid
|
|
125
|
+
def valid?
|
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
127
|
+
return false if @id.nil?
|
|
128
|
+
return false if @status.nil?
|
|
129
|
+
true
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Custom attribute writer method with validation
|
|
133
|
+
# @param [Object] id Value to be assigned
|
|
134
|
+
def id=(id)
|
|
135
|
+
if id.nil?
|
|
136
|
+
fail ArgumentError, 'id cannot be nil'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
@id = id
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] status Value to be assigned
|
|
144
|
+
def status=(status)
|
|
145
|
+
if status.nil?
|
|
146
|
+
fail ArgumentError, 'status cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@status = status
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Checks equality by comparing each attribute.
|
|
153
|
+
# @param [Object] Object to be compared
|
|
154
|
+
def ==(o)
|
|
155
|
+
return true if self.equal?(o)
|
|
156
|
+
self.class == o.class &&
|
|
157
|
+
id == o.id &&
|
|
158
|
+
status == o.status
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# @see the `==` method
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def eql?(o)
|
|
164
|
+
self == o
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Calculates hash code according to all attributes.
|
|
168
|
+
# @return [Integer] Hash code
|
|
169
|
+
def hash
|
|
170
|
+
[id, status].hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Builds the object from hash
|
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
175
|
+
# @return [Object] Returns the model itself
|
|
176
|
+
def self.build_from_hash(attributes)
|
|
177
|
+
return nil unless attributes.is_a?(Hash)
|
|
178
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
179
|
+
transformed_hash = {}
|
|
180
|
+
openapi_types.each_pair do |key, type|
|
|
181
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
182
|
+
transformed_hash["#{key}"] = nil
|
|
183
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
184
|
+
# check to ensure the input is an array given that the attribute
|
|
185
|
+
# is documented as an array but the input is not
|
|
186
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
187
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
188
|
+
end
|
|
189
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
new(transformed_hash)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Returns the object in the form of hash
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_hash
|
|
199
|
+
hash = {}
|
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
201
|
+
value = self.send(attr)
|
|
202
|
+
if value.nil?
|
|
203
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
204
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
hash[param] = _to_hash(value)
|
|
208
|
+
end
|
|
209
|
+
hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Volcano API
|
|
3
|
+
|
|
4
|
+
#Public API for Volcano 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 CapabilityList < 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<Capability>'
|
|
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::CapabilityList` 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::CapabilityList`. 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
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Volcano API
|
|
3
|
+
|
|
4
|
+
#Public API for Volcano 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 CapabilityStatus
|
|
18
|
+
AVAILABLE = "available".freeze
|
|
19
|
+
UNAVAILABLE = "unavailable".freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [AVAILABLE, UNAVAILABLE].freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
return value if CapabilityStatus.all_vars.include?(value)
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #CapabilityStatus"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -20,17 +20,15 @@ module Volcano::Generated
|
|
|
20
20
|
|
|
21
21
|
attr_accessor :sandbox_id
|
|
22
22
|
|
|
23
|
+
# Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits.
|
|
23
24
|
attr_accessor :memory_mb
|
|
24
25
|
|
|
25
26
|
# Region such as `us-east-1`. Region IDs issued by earlier versions of the API are still accepted.
|
|
26
27
|
attr_accessor :region
|
|
27
28
|
|
|
28
|
-
# Inherits the template TTL when omitted (3600 seconds for a
|
|
29
|
+
# Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. Local accepts 0 for unlimited or a positive lifetime.
|
|
29
30
|
attr_accessor :max_duration_seconds
|
|
30
31
|
|
|
31
|
-
# Inherits the template idle timeout when omitted, capped at the session duration. Set zero to disable idle timeout.
|
|
32
|
-
attr_accessor :idle_timeout_seconds
|
|
33
|
-
|
|
34
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
33
|
def self.attribute_map
|
|
36
34
|
{
|
|
@@ -38,8 +36,7 @@ module Volcano::Generated
|
|
|
38
36
|
:'sandbox_id' => :'sandbox_id',
|
|
39
37
|
:'memory_mb' => :'memory_mb',
|
|
40
38
|
:'region' => :'region',
|
|
41
|
-
:'max_duration_seconds' => :'max_duration_seconds'
|
|
42
|
-
:'idle_timeout_seconds' => :'idle_timeout_seconds'
|
|
39
|
+
:'max_duration_seconds' => :'max_duration_seconds'
|
|
43
40
|
}
|
|
44
41
|
end
|
|
45
42
|
|
|
@@ -60,8 +57,7 @@ module Volcano::Generated
|
|
|
60
57
|
:'sandbox_id' => :'String',
|
|
61
58
|
:'memory_mb' => :'Integer',
|
|
62
59
|
:'region' => :'String',
|
|
63
|
-
:'max_duration_seconds' => :'Integer'
|
|
64
|
-
:'idle_timeout_seconds' => :'Integer'
|
|
60
|
+
:'max_duration_seconds' => :'Integer'
|
|
65
61
|
}
|
|
66
62
|
end
|
|
67
63
|
|
|
@@ -108,10 +104,6 @@ module Volcano::Generated
|
|
|
108
104
|
if attributes.key?(:'max_duration_seconds')
|
|
109
105
|
self.max_duration_seconds = attributes[:'max_duration_seconds']
|
|
110
106
|
end
|
|
111
|
-
|
|
112
|
-
if attributes.key?(:'idle_timeout_seconds')
|
|
113
|
-
self.idle_timeout_seconds = attributes[:'idle_timeout_seconds']
|
|
114
|
-
end
|
|
115
107
|
end
|
|
116
108
|
|
|
117
109
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -128,20 +120,12 @@ module Volcano::Generated
|
|
|
128
120
|
invalid_properties.push("invalid value for \"region\", must conform to the pattern #{pattern}.")
|
|
129
121
|
end
|
|
130
122
|
|
|
131
|
-
if !@max_duration_seconds.nil? && @max_duration_seconds >
|
|
132
|
-
invalid_properties.push('invalid value for "max_duration_seconds", must be smaller than or equal to
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
if !@max_duration_seconds.nil? && @max_duration_seconds < 30
|
|
136
|
-
invalid_properties.push('invalid value for "max_duration_seconds", must be greater than or equal to 30.')
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
if !@idle_timeout_seconds.nil? && @idle_timeout_seconds > 28800
|
|
140
|
-
invalid_properties.push('invalid value for "idle_timeout_seconds", must be smaller than or equal to 28800.')
|
|
123
|
+
if !@max_duration_seconds.nil? && @max_duration_seconds > 2147483647
|
|
124
|
+
invalid_properties.push('invalid value for "max_duration_seconds", must be smaller than or equal to 2147483647.')
|
|
141
125
|
end
|
|
142
126
|
|
|
143
|
-
if !@
|
|
144
|
-
invalid_properties.push('invalid value for "
|
|
127
|
+
if !@max_duration_seconds.nil? && @max_duration_seconds < 0
|
|
128
|
+
invalid_properties.push('invalid value for "max_duration_seconds", must be greater than or equal to 0.')
|
|
145
129
|
end
|
|
146
130
|
|
|
147
131
|
invalid_properties
|
|
@@ -155,10 +139,8 @@ module Volcano::Generated
|
|
|
155
139
|
return false unless memory_mb_validator.valid?(@memory_mb)
|
|
156
140
|
return false if @region.nil?
|
|
157
141
|
return false if @region !~ Regexp.new(/^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$/)
|
|
158
|
-
return false if !@max_duration_seconds.nil? && @max_duration_seconds >
|
|
159
|
-
return false if !@max_duration_seconds.nil? && @max_duration_seconds <
|
|
160
|
-
return false if !@idle_timeout_seconds.nil? && @idle_timeout_seconds > 28800
|
|
161
|
-
return false if !@idle_timeout_seconds.nil? && @idle_timeout_seconds < 0
|
|
142
|
+
return false if !@max_duration_seconds.nil? && @max_duration_seconds > 2147483647
|
|
143
|
+
return false if !@max_duration_seconds.nil? && @max_duration_seconds < 0
|
|
162
144
|
true
|
|
163
145
|
end
|
|
164
146
|
|
|
@@ -194,35 +176,17 @@ module Volcano::Generated
|
|
|
194
176
|
fail ArgumentError, 'max_duration_seconds cannot be nil'
|
|
195
177
|
end
|
|
196
178
|
|
|
197
|
-
if max_duration_seconds >
|
|
198
|
-
fail ArgumentError, 'invalid value for "max_duration_seconds", must be smaller than or equal to
|
|
179
|
+
if max_duration_seconds > 2147483647
|
|
180
|
+
fail ArgumentError, 'invalid value for "max_duration_seconds", must be smaller than or equal to 2147483647.'
|
|
199
181
|
end
|
|
200
182
|
|
|
201
|
-
if max_duration_seconds <
|
|
202
|
-
fail ArgumentError, 'invalid value for "max_duration_seconds", must be greater than or equal to
|
|
183
|
+
if max_duration_seconds < 0
|
|
184
|
+
fail ArgumentError, 'invalid value for "max_duration_seconds", must be greater than or equal to 0.'
|
|
203
185
|
end
|
|
204
186
|
|
|
205
187
|
@max_duration_seconds = max_duration_seconds
|
|
206
188
|
end
|
|
207
189
|
|
|
208
|
-
# Custom attribute writer method with validation
|
|
209
|
-
# @param [Object] idle_timeout_seconds Value to be assigned
|
|
210
|
-
def idle_timeout_seconds=(idle_timeout_seconds)
|
|
211
|
-
if idle_timeout_seconds.nil?
|
|
212
|
-
fail ArgumentError, 'idle_timeout_seconds cannot be nil'
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
if idle_timeout_seconds > 28800
|
|
216
|
-
fail ArgumentError, 'invalid value for "idle_timeout_seconds", must be smaller than or equal to 28800.'
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
if idle_timeout_seconds < 0
|
|
220
|
-
fail ArgumentError, 'invalid value for "idle_timeout_seconds", must be greater than or equal to 0.'
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
@idle_timeout_seconds = idle_timeout_seconds
|
|
224
|
-
end
|
|
225
|
-
|
|
226
190
|
# Checks equality by comparing each attribute.
|
|
227
191
|
# @param [Object] Object to be compared
|
|
228
192
|
def ==(o)
|
|
@@ -232,8 +196,7 @@ module Volcano::Generated
|
|
|
232
196
|
sandbox_id == o.sandbox_id &&
|
|
233
197
|
memory_mb == o.memory_mb &&
|
|
234
198
|
region == o.region &&
|
|
235
|
-
max_duration_seconds == o.max_duration_seconds
|
|
236
|
-
idle_timeout_seconds == o.idle_timeout_seconds
|
|
199
|
+
max_duration_seconds == o.max_duration_seconds
|
|
237
200
|
end
|
|
238
201
|
|
|
239
202
|
# @see the `==` method
|
|
@@ -245,7 +208,7 @@ module Volcano::Generated
|
|
|
245
208
|
# Calculates hash code according to all attributes.
|
|
246
209
|
# @return [Integer] Hash code
|
|
247
210
|
def hash
|
|
248
|
-
[preset, sandbox_id, memory_mb, region, max_duration_seconds
|
|
211
|
+
[preset, sandbox_id, memory_mb, region, max_duration_seconds].hash
|
|
249
212
|
end
|
|
250
213
|
|
|
251
214
|
# Builds the object from hash
|