volcano-sdk 0.9.4 → 0.10.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 +69 -0
- data/lib/volcano/client.rb +2 -1
- data/lib/volcano/durable.rb +136 -0
- data/lib/volcano/durable_models.rb +143 -0
- data/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +1239 -0
- data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb +18 -6
- data/lib/volcano/generated/lib/volcano-generated/api/o_auth_authentication_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb +76 -2
- data/lib/volcano/generated/lib/volcano-generated/models/create_database_request.rb +6 -8
- data/lib/volcano/generated/lib/volcano-generated/models/create_variable_request.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution.rb +358 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution_error.rb +157 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution_status.rb +45 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_function.rb +479 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_function_config.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_kind.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_runtime_option.rb +28 -1
- data/lib/volcano/generated/lib/volcano-generated/models/function_scheduler.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/list_database_regions200_response_inner.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_durable_executions.rb +274 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_durable_functions.rb +274 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +23 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_function.rb +47 -2
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_variable.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_deployment_resource.rb +14 -4
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_resource.rb +14 -4
- data/lib/volcano/generated/lib/volcano-generated/models/replace_shared_variables_request.rb +237 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_variable_request.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/variable.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated.rb +10 -0
- data/lib/volcano/generated_transport.rb +2 -1
- data/lib/volcano/generated_transport_durable.rb +50 -0
- data/lib/volcano/generated_transport_support.rb +1 -0
- data/lib/volcano/version.rb +1 -1
- data/lib/volcano.rb +2 -0
- metadata +14 -1
|
@@ -0,0 +1,479 @@
|
|
|
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
|
+
# A durable function. Separate from `Function` because a durable function is invoked only through its own execution endpoints, so it has no invocation mode, HTTP auth mode, OpenAPI document or invoke URL, and it carries a `durable` configuration that a standard function has no field for.
|
|
18
|
+
class DurableFunction < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :project_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :name
|
|
24
|
+
|
|
25
|
+
attr_accessor :status
|
|
26
|
+
|
|
27
|
+
# Timestamp when the current provisioning phase started
|
|
28
|
+
attr_accessor :provisioning_started_at
|
|
29
|
+
|
|
30
|
+
# Whether anon keys may start executions of this function through `POST /durable-functions/{functionId}/executions`. When `true`, an anon key holding `functions.invoke` can start an execution. When `false` (the default) only service keys and auth user tokens can. Reading and stopping an execution always require the project owner's token, whatever this is set to. Set it when the function is created. Durable functions have no update endpoint, so changing visibility later means redeploying. A public durable function is startable, never invocable: it is not reachable through `POST /functions/{functionId}/invoke` or a function URL, which answer `404` for either visibility.
|
|
31
|
+
attr_accessor :is_public
|
|
32
|
+
|
|
33
|
+
attr_accessor :durable
|
|
34
|
+
|
|
35
|
+
# Regions where this function is currently deployed
|
|
36
|
+
attr_accessor :deployed_regions
|
|
37
|
+
|
|
38
|
+
attr_accessor :runtime
|
|
39
|
+
|
|
40
|
+
attr_accessor :handler
|
|
41
|
+
|
|
42
|
+
# Identifier of the latest deployment operation
|
|
43
|
+
attr_accessor :current_deployment_id
|
|
44
|
+
|
|
45
|
+
# Newest queued deployment that will run after the current operation
|
|
46
|
+
attr_accessor :pending_deployment_id
|
|
47
|
+
|
|
48
|
+
# Most recent successful invocation timestamp
|
|
49
|
+
attr_accessor :last_invoked_at
|
|
50
|
+
|
|
51
|
+
attr_accessor :created_at
|
|
52
|
+
|
|
53
|
+
attr_accessor :updated_at
|
|
54
|
+
|
|
55
|
+
class EnumAttributeValidator
|
|
56
|
+
attr_reader :datatype
|
|
57
|
+
attr_reader :allowable_values
|
|
58
|
+
|
|
59
|
+
def initialize(datatype, allowable_values)
|
|
60
|
+
@allowable_values = allowable_values.map do |value|
|
|
61
|
+
case datatype.to_s
|
|
62
|
+
when /Integer/i
|
|
63
|
+
value.to_i
|
|
64
|
+
when /Float/i
|
|
65
|
+
value.to_f
|
|
66
|
+
else
|
|
67
|
+
value
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def valid?(value)
|
|
73
|
+
!value || allowable_values.include?(value)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
78
|
+
def self.attribute_map
|
|
79
|
+
{
|
|
80
|
+
:'id' => :'id',
|
|
81
|
+
:'project_id' => :'project_id',
|
|
82
|
+
:'name' => :'name',
|
|
83
|
+
:'status' => :'status',
|
|
84
|
+
:'provisioning_started_at' => :'provisioning_started_at',
|
|
85
|
+
:'is_public' => :'is_public',
|
|
86
|
+
:'durable' => :'durable',
|
|
87
|
+
:'deployed_regions' => :'deployed_regions',
|
|
88
|
+
:'runtime' => :'runtime',
|
|
89
|
+
:'handler' => :'handler',
|
|
90
|
+
:'current_deployment_id' => :'current_deployment_id',
|
|
91
|
+
:'pending_deployment_id' => :'pending_deployment_id',
|
|
92
|
+
:'last_invoked_at' => :'last_invoked_at',
|
|
93
|
+
:'created_at' => :'created_at',
|
|
94
|
+
:'updated_at' => :'updated_at'
|
|
95
|
+
}
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Returns attribute mapping this model knows about
|
|
99
|
+
def self.acceptable_attribute_map
|
|
100
|
+
attribute_map
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Returns all the JSON keys this model knows about
|
|
104
|
+
def self.acceptable_attributes
|
|
105
|
+
acceptable_attribute_map.values
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Attribute type mapping.
|
|
109
|
+
def self.openapi_types
|
|
110
|
+
{
|
|
111
|
+
:'id' => :'String',
|
|
112
|
+
:'project_id' => :'String',
|
|
113
|
+
:'name' => :'String',
|
|
114
|
+
:'status' => :'String',
|
|
115
|
+
:'provisioning_started_at' => :'Time',
|
|
116
|
+
:'is_public' => :'Boolean',
|
|
117
|
+
:'durable' => :'DurableFunctionConfig',
|
|
118
|
+
:'deployed_regions' => :'Array<String>',
|
|
119
|
+
:'runtime' => :'String',
|
|
120
|
+
:'handler' => :'String',
|
|
121
|
+
:'current_deployment_id' => :'String',
|
|
122
|
+
:'pending_deployment_id' => :'String',
|
|
123
|
+
:'last_invoked_at' => :'Time',
|
|
124
|
+
:'created_at' => :'Time',
|
|
125
|
+
:'updated_at' => :'Time'
|
|
126
|
+
}
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# List of attributes with nullable: true
|
|
130
|
+
def self.openapi_nullable
|
|
131
|
+
Set.new([
|
|
132
|
+
])
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Initializes the object
|
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
137
|
+
def initialize(attributes = {})
|
|
138
|
+
if (!attributes.is_a?(Hash))
|
|
139
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::DurableFunction` initialize method"
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
143
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
144
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
145
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
146
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::DurableFunction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
147
|
+
end
|
|
148
|
+
h[k.to_sym] = v
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'id')
|
|
152
|
+
self.id = attributes[:'id']
|
|
153
|
+
else
|
|
154
|
+
self.id = nil
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'project_id')
|
|
158
|
+
self.project_id = attributes[:'project_id']
|
|
159
|
+
else
|
|
160
|
+
self.project_id = nil
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'name')
|
|
164
|
+
self.name = attributes[:'name']
|
|
165
|
+
else
|
|
166
|
+
self.name = nil
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'status')
|
|
170
|
+
self.status = attributes[:'status']
|
|
171
|
+
else
|
|
172
|
+
self.status = nil
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'provisioning_started_at')
|
|
176
|
+
self.provisioning_started_at = attributes[:'provisioning_started_at']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'is_public')
|
|
180
|
+
self.is_public = attributes[:'is_public']
|
|
181
|
+
else
|
|
182
|
+
self.is_public = nil
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'durable')
|
|
186
|
+
self.durable = attributes[:'durable']
|
|
187
|
+
else
|
|
188
|
+
self.durable = nil
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'deployed_regions')
|
|
192
|
+
if (value = attributes[:'deployed_regions']).is_a?(Array)
|
|
193
|
+
self.deployed_regions = value
|
|
194
|
+
end
|
|
195
|
+
else
|
|
196
|
+
self.deployed_regions = nil
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'runtime')
|
|
200
|
+
self.runtime = attributes[:'runtime']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'handler')
|
|
204
|
+
self.handler = attributes[:'handler']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'current_deployment_id')
|
|
208
|
+
self.current_deployment_id = attributes[:'current_deployment_id']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'pending_deployment_id')
|
|
212
|
+
self.pending_deployment_id = attributes[:'pending_deployment_id']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'last_invoked_at')
|
|
216
|
+
self.last_invoked_at = attributes[:'last_invoked_at']
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if attributes.key?(:'created_at')
|
|
220
|
+
self.created_at = attributes[:'created_at']
|
|
221
|
+
else
|
|
222
|
+
self.created_at = nil
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'updated_at')
|
|
226
|
+
self.updated_at = attributes[:'updated_at']
|
|
227
|
+
else
|
|
228
|
+
self.updated_at = nil
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
233
|
+
# @return Array for valid properties with the reasons
|
|
234
|
+
def list_invalid_properties
|
|
235
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
236
|
+
invalid_properties = Array.new
|
|
237
|
+
if @id.nil?
|
|
238
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if @project_id.nil?
|
|
242
|
+
invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if @name.nil?
|
|
246
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if @name.to_s.length > 63
|
|
250
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 63.')
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/)
|
|
254
|
+
if @name !~ pattern
|
|
255
|
+
invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
if @status.nil?
|
|
259
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if @is_public.nil?
|
|
263
|
+
invalid_properties.push('invalid value for "is_public", is_public cannot be nil.')
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if @durable.nil?
|
|
267
|
+
invalid_properties.push('invalid value for "durable", durable cannot be nil.')
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if @deployed_regions.nil?
|
|
271
|
+
invalid_properties.push('invalid value for "deployed_regions", deployed_regions cannot be nil.')
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if @created_at.nil?
|
|
275
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if @updated_at.nil?
|
|
279
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
invalid_properties
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Check to see if the all the properties in the model are valid
|
|
286
|
+
# @return true if the model is valid
|
|
287
|
+
def valid?
|
|
288
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
289
|
+
return false if @id.nil?
|
|
290
|
+
return false if @project_id.nil?
|
|
291
|
+
return false if @name.nil?
|
|
292
|
+
return false if @name.to_s.length > 63
|
|
293
|
+
return false if @name !~ Regexp.new(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/)
|
|
294
|
+
return false if @status.nil?
|
|
295
|
+
status_validator = EnumAttributeValidator.new('String', ["provisioning", "active", "failed", "deleting"])
|
|
296
|
+
return false unless status_validator.valid?(@status)
|
|
297
|
+
return false if @is_public.nil?
|
|
298
|
+
return false if @durable.nil?
|
|
299
|
+
return false if @deployed_regions.nil?
|
|
300
|
+
return false if @created_at.nil?
|
|
301
|
+
return false if @updated_at.nil?
|
|
302
|
+
true
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Custom attribute writer method with validation
|
|
306
|
+
# @param [Object] id Value to be assigned
|
|
307
|
+
def id=(id)
|
|
308
|
+
if id.nil?
|
|
309
|
+
fail ArgumentError, 'id cannot be nil'
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
@id = id
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Custom attribute writer method with validation
|
|
316
|
+
# @param [Object] project_id Value to be assigned
|
|
317
|
+
def project_id=(project_id)
|
|
318
|
+
if project_id.nil?
|
|
319
|
+
fail ArgumentError, 'project_id cannot be nil'
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
@project_id = project_id
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
# Custom attribute writer method with validation
|
|
326
|
+
# @param [Object] name Value to be assigned
|
|
327
|
+
def name=(name)
|
|
328
|
+
if name.nil?
|
|
329
|
+
fail ArgumentError, 'name cannot be nil'
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
if name.to_s.length > 63
|
|
333
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 63.'
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/)
|
|
337
|
+
if name !~ pattern
|
|
338
|
+
fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
@name = name
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
345
|
+
# @param [Object] status Object to be assigned
|
|
346
|
+
def status=(status)
|
|
347
|
+
validator = EnumAttributeValidator.new('String', ["provisioning", "active", "failed", "deleting"])
|
|
348
|
+
unless validator.valid?(status)
|
|
349
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
350
|
+
end
|
|
351
|
+
@status = status
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# Custom attribute writer method with validation
|
|
355
|
+
# @param [Object] is_public Value to be assigned
|
|
356
|
+
def is_public=(is_public)
|
|
357
|
+
if is_public.nil?
|
|
358
|
+
fail ArgumentError, 'is_public cannot be nil'
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
@is_public = is_public
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Custom attribute writer method with validation
|
|
365
|
+
# @param [Object] durable Value to be assigned
|
|
366
|
+
def durable=(durable)
|
|
367
|
+
if durable.nil?
|
|
368
|
+
fail ArgumentError, 'durable cannot be nil'
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
@durable = durable
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Custom attribute writer method with validation
|
|
375
|
+
# @param [Object] deployed_regions Value to be assigned
|
|
376
|
+
def deployed_regions=(deployed_regions)
|
|
377
|
+
if deployed_regions.nil?
|
|
378
|
+
fail ArgumentError, 'deployed_regions cannot be nil'
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
@deployed_regions = deployed_regions
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# Custom attribute writer method with validation
|
|
385
|
+
# @param [Object] created_at Value to be assigned
|
|
386
|
+
def created_at=(created_at)
|
|
387
|
+
if created_at.nil?
|
|
388
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
@created_at = created_at
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Custom attribute writer method with validation
|
|
395
|
+
# @param [Object] updated_at Value to be assigned
|
|
396
|
+
def updated_at=(updated_at)
|
|
397
|
+
if updated_at.nil?
|
|
398
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
@updated_at = updated_at
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
# Checks equality by comparing each attribute.
|
|
405
|
+
# @param [Object] Object to be compared
|
|
406
|
+
def ==(o)
|
|
407
|
+
return true if self.equal?(o)
|
|
408
|
+
self.class == o.class &&
|
|
409
|
+
id == o.id &&
|
|
410
|
+
project_id == o.project_id &&
|
|
411
|
+
name == o.name &&
|
|
412
|
+
status == o.status &&
|
|
413
|
+
provisioning_started_at == o.provisioning_started_at &&
|
|
414
|
+
is_public == o.is_public &&
|
|
415
|
+
durable == o.durable &&
|
|
416
|
+
deployed_regions == o.deployed_regions &&
|
|
417
|
+
runtime == o.runtime &&
|
|
418
|
+
handler == o.handler &&
|
|
419
|
+
current_deployment_id == o.current_deployment_id &&
|
|
420
|
+
pending_deployment_id == o.pending_deployment_id &&
|
|
421
|
+
last_invoked_at == o.last_invoked_at &&
|
|
422
|
+
created_at == o.created_at &&
|
|
423
|
+
updated_at == o.updated_at
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
# @see the `==` method
|
|
427
|
+
# @param [Object] Object to be compared
|
|
428
|
+
def eql?(o)
|
|
429
|
+
self == o
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# Calculates hash code according to all attributes.
|
|
433
|
+
# @return [Integer] Hash code
|
|
434
|
+
def hash
|
|
435
|
+
[id, project_id, name, status, provisioning_started_at, is_public, durable, deployed_regions, runtime, handler, current_deployment_id, pending_deployment_id, last_invoked_at, created_at, updated_at].hash
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# Builds the object from hash
|
|
439
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
440
|
+
# @return [Object] Returns the model itself
|
|
441
|
+
def self.build_from_hash(attributes)
|
|
442
|
+
return nil unless attributes.is_a?(Hash)
|
|
443
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
444
|
+
transformed_hash = {}
|
|
445
|
+
openapi_types.each_pair do |key, type|
|
|
446
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
447
|
+
transformed_hash["#{key}"] = nil
|
|
448
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
449
|
+
# check to ensure the input is an array given that the attribute
|
|
450
|
+
# is documented as an array but the input is not
|
|
451
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
452
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
453
|
+
end
|
|
454
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
455
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
456
|
+
end
|
|
457
|
+
end
|
|
458
|
+
new(transformed_hash)
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
# Returns the object in the form of hash
|
|
462
|
+
# @return [Hash] Returns the object in the form of hash
|
|
463
|
+
def to_hash
|
|
464
|
+
hash = {}
|
|
465
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
466
|
+
value = self.send(attr)
|
|
467
|
+
if value.nil?
|
|
468
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
469
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
hash[param] = _to_hash(value)
|
|
473
|
+
end
|
|
474
|
+
hash
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
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
|
+
# Execution limits the function was created with, derived from the project's plan. Fixed for the life of the function: changing them means creating a new one. The memory the function runs at, and the timeout on one attempt within an execution, also come from the plan but are not reported here: they are applied to the deployed function rather than recorded on it. Both are published per plan in the plans and limits guide.
|
|
18
|
+
class DurableFunctionConfig < ApiModelBase
|
|
19
|
+
# How long a whole execution may run, including time suspended in a wait. This is not a limit on one attempt: an execution outlives any single attempt by checkpointing and resuming, and the per-attempt timeout is the plan's own, smaller number.
|
|
20
|
+
attr_accessor :execution_timeout_seconds
|
|
21
|
+
|
|
22
|
+
# How long a finished execution's result and history are retained, for as long as the function exists. Deleting the function, or its project, ends retention early and takes the history with it.
|
|
23
|
+
attr_accessor :retention_days
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'execution_timeout_seconds' => :'execution_timeout_seconds',
|
|
29
|
+
:'retention_days' => :'retention_days'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'execution_timeout_seconds' => :'Integer',
|
|
47
|
+
:'retention_days' => :'Integer'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::DurableFunctionConfig` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::DurableFunctionConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'execution_timeout_seconds')
|
|
74
|
+
self.execution_timeout_seconds = attributes[:'execution_timeout_seconds']
|
|
75
|
+
else
|
|
76
|
+
self.execution_timeout_seconds = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'retention_days')
|
|
80
|
+
self.retention_days = attributes[:'retention_days']
|
|
81
|
+
else
|
|
82
|
+
self.retention_days = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
if @execution_timeout_seconds.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "execution_timeout_seconds", execution_timeout_seconds cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @retention_days.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "retention_days", retention_days cannot be nil.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
invalid_properties
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Check to see if the all the properties in the model are valid
|
|
103
|
+
# @return true if the model is valid
|
|
104
|
+
def valid?
|
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
+
return false if @execution_timeout_seconds.nil?
|
|
107
|
+
return false if @retention_days.nil?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] execution_timeout_seconds Value to be assigned
|
|
113
|
+
def execution_timeout_seconds=(execution_timeout_seconds)
|
|
114
|
+
if execution_timeout_seconds.nil?
|
|
115
|
+
fail ArgumentError, 'execution_timeout_seconds cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@execution_timeout_seconds = execution_timeout_seconds
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] retention_days Value to be assigned
|
|
123
|
+
def retention_days=(retention_days)
|
|
124
|
+
if retention_days.nil?
|
|
125
|
+
fail ArgumentError, 'retention_days cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@retention_days = retention_days
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
execution_timeout_seconds == o.execution_timeout_seconds &&
|
|
137
|
+
retention_days == o.retention_days
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[execution_timeout_seconds, retention_days].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|