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.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -4
  3. data/lib/volcano/client.rb +1 -1
  4. data/lib/volcano/durable.rb +9 -4
  5. data/lib/volcano/durable_approval_models.rb +1 -1
  6. data/lib/volcano/durable_message_arguments.rb +49 -0
  7. data/lib/volcano/durable_message_backlog.rb +38 -0
  8. data/lib/volcano/durable_message_catch_ups.rb +112 -0
  9. data/lib/volcano/durable_message_models.rb +62 -0
  10. data/lib/volcano/durable_message_responses.rb +107 -0
  11. data/lib/volcano/durable_message_session.rb +72 -0
  12. data/lib/volcano/durable_message_stream.rb +176 -0
  13. data/lib/volcano/durable_messages.rb +217 -0
  14. data/lib/volcano/durable_models.rb +32 -3
  15. data/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb +2 -2
  16. data/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb +2 -2
  17. data/lib/volcano/generated/lib/volcano-generated/api/autofix_api.rb +222 -0
  18. data/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +725 -0
  19. data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
  20. data/lib/volcano/generated/lib/volcano-generated/api/issues_api.rb +254 -0
  21. data/lib/volcano/generated/lib/volcano-generated/api/sandboxes_api.rb +20 -20
  22. data/lib/volcano/generated/lib/volcano-generated/api/system_api.rb +57 -0
  23. data/lib/volcano/generated/lib/volcano-generated/api/variable_environments_api.rb +373 -0
  24. data/lib/volcano/generated/lib/volcano-generated/api/verified_domains_api.rb +2 -2
  25. data/lib/volcano/generated/lib/volcano-generated/models/auth_config.rb +46 -4
  26. data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_series_point.rb +110 -2
  27. data/lib/volcano/generated/lib/volcano-generated/models/autofix_model.rb +45 -0
  28. data/lib/volcano/generated/lib/volcano-generated/models/autofix_provider.rb +40 -0
  29. data/lib/volcano/generated/lib/volcano-generated/models/autofix_settings.rb +385 -0
  30. data/lib/volcano/generated/lib/volcano-generated/models/autofix_stage.rb +40 -0
  31. data/lib/volcano/generated/lib/volcano-generated/models/capability.rb +214 -0
  32. data/lib/volcano/generated/lib/volcano-generated/models/capability_list.rb +166 -0
  33. data/lib/volcano/generated/lib/volcano-generated/models/capability_status.rb +40 -0
  34. data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_session_request.rb +16 -53
  35. data/lib/volcano/generated/lib/volcano-generated/models/create_variable_environment_request.rb +176 -0
  36. data/lib/volcano/generated/lib/volcano-generated/models/durable_execution.rb +14 -4
  37. data/lib/volcano/generated/lib/volcano-generated/models/durable_message.rb +396 -0
  38. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_direction.rb +40 -0
  39. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_list.rb +194 -0
  40. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_sender.rb +203 -0
  41. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_session_registration.rb +165 -0
  42. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_status.rb +43 -0
  43. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait.rb +278 -0
  44. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_list.rb +167 -0
  45. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_registration.rb +225 -0
  46. data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_status.rb +43 -0
  47. data/lib/volcano/generated/lib/volcano-generated/models/frontend.rb +11 -1
  48. data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_conflict_error.rb +1 -1
  49. data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_response.rb +25 -2
  50. data/lib/volcano/generated/lib/volcano-generated/models/issue.rb +493 -0
  51. data/lib/volcano/generated/lib/volcano-generated/models/issue_status.rb +41 -0
  52. data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +1 -1
  53. data/lib/volcano/generated/lib/volcano-generated/models/open_durable_message_session_request.rb +228 -0
  54. data/lib/volcano/generated/lib/volcano-generated/models/paginated_issues.rb +230 -0
  55. data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +10 -1
  56. data/lib/volcano/generated/lib/volcano-generated/models/project_config_autofix.rb +206 -0
  57. data/lib/volcano/generated/lib/volcano-generated/models/project_config_custom_domain.rb +1 -1
  58. data/lib/volcano/generated/lib/volcano-generated/models/project_config_sandbox.rb +12 -50
  59. data/lib/volcano/generated/lib/volcano-generated/models/project_frontend_custom_domain.rb +25 -2
  60. data/lib/volcano/generated/lib/volcano-generated/models/publish_durable_message_request.rb +205 -0
  61. data/lib/volcano/generated/lib/volcano-generated/models/register_durable_message_wait_request.rb +284 -0
  62. data/lib/volcano/generated/lib/volcano-generated/models/rename_variable_environment_request.rb +176 -0
  63. data/lib/volcano/generated/lib/volcano-generated/models/request_durable_approval_request.rb +1 -1
  64. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_request.rb +11 -12
  65. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_request.rb +51 -13
  66. data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session.rb +4 -30
  67. data/lib/volcano/generated/lib/volcano-generated/models/send_durable_message_request.rb +205 -0
  68. data/lib/volcano/generated/lib/volcano-generated/models/update_auth_config_request.rb +79 -1
  69. data/lib/volcano/generated/lib/volcano-generated/models/update_autofix_settings_request.rb +273 -0
  70. data/lib/volcano/generated/lib/volcano-generated/models/update_issue_request.rb +186 -0
  71. data/lib/volcano/generated/lib/volcano-generated/models/variable_environment.rb +325 -0
  72. data/lib/volcano/generated/lib/volcano-generated/models/variable_environment_list.rb +175 -0
  73. data/lib/volcano/generated/lib/volcano-generated.rb +34 -0
  74. data/lib/volcano/generated_transport.rb +1 -0
  75. data/lib/volcano/generated_transport_durable_messages.rb +57 -0
  76. data/lib/volcano/realtime/channel_callbacks.rb +5 -1
  77. data/lib/volcano/realtime/channel_lifecycle.rb +4 -1
  78. data/lib/volcano/realtime/durable_channel.rb +47 -0
  79. data/lib/volcano/realtime/lifecycle.rb +37 -1
  80. data/lib/volcano/realtime/protocol.rb +7 -3
  81. data/lib/volcano/realtime/protocol_dispatch.rb +1 -1
  82. data/lib/volcano/realtime/protocol_io.rb +7 -4
  83. data/lib/volcano/realtime/protocol_lifecycle.rb +7 -0
  84. data/lib/volcano/realtime/protocol_recovery.rb +23 -12
  85. data/lib/volcano/realtime.rb +42 -8
  86. data/lib/volcano/redaction.rb +1 -1
  87. data/lib/volcano/version.rb +1 -1
  88. data/lib/volcano.rb +8 -0
  89. data/sig/core_facades.rbs +15 -0
  90. data/sig/durable_message_records.rbs +68 -0
  91. data/sig/durable_records.rbs +17 -9
  92. metadata +46 -1
@@ -0,0 +1,194 @@
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 DurableMessageList < ApiModelBase
18
+ # Messages after `after`, oldest first.
19
+ attr_accessor :data
20
+
21
+ # Whether more messages follow. Read them with `after` set to the last message's `seq`.
22
+ attr_accessor :has_more
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'data' => :'data',
28
+ :'has_more' => :'has_more'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'data' => :'Array<DurableMessage>',
46
+ :'has_more' => :'Boolean'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::DurableMessageList` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::DurableMessageList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'data')
73
+ if (value = attributes[:'data']).is_a?(Array)
74
+ self.data = value
75
+ end
76
+ else
77
+ self.data = nil
78
+ end
79
+
80
+ if attributes.key?(:'has_more')
81
+ self.has_more = attributes[:'has_more']
82
+ else
83
+ self.has_more = nil
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ if @data.nil?
93
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
94
+ end
95
+
96
+ if @has_more.nil?
97
+ invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ return false if @data.nil?
108
+ return false if @has_more.nil?
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] data Value to be assigned
114
+ def data=(data)
115
+ if data.nil?
116
+ fail ArgumentError, 'data cannot be nil'
117
+ end
118
+
119
+ @data = data
120
+ end
121
+
122
+ # Custom attribute writer method with validation
123
+ # @param [Object] has_more Value to be assigned
124
+ def has_more=(has_more)
125
+ if has_more.nil?
126
+ fail ArgumentError, 'has_more cannot be nil'
127
+ end
128
+
129
+ @has_more = has_more
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ data == o.data &&
138
+ has_more == o.has_more
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [data, has_more].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ attributes = attributes.transform_keys(&:to_sym)
159
+ transformed_hash = {}
160
+ openapi_types.each_pair do |key, type|
161
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = nil
163
+ elsif type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[attribute_map[key]].is_a?(Array)
167
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
168
+ end
169
+ elsif !attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
171
+ end
172
+ end
173
+ new(transformed_hash)
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ if value.nil?
183
+ is_nullable = self.class.openapi_nullable.include?(attr)
184
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
185
+ end
186
+
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ end
193
+
194
+ end
@@ -0,0 +1,203 @@
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
+ # Who sent the message.
18
+ class DurableMessageSender < ApiModelBase
19
+ # The credential the message was sent with. `project` is the project's owner or one of its access tokens, and `execution` is the execution itself publishing.
20
+ attr_accessor :type
21
+
22
+ # The auth user who sent it. Null unless `type` is `user`.
23
+ attr_accessor :user_id
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'type' => :'type',
51
+ :'user_id' => :'user_id'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'type' => :'String',
69
+ :'user_id' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'user_id'
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::DurableMessageSender` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::DurableMessageSender`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'type')
97
+ self.type = attributes[:'type']
98
+ else
99
+ self.type = nil
100
+ end
101
+
102
+ if attributes.key?(:'user_id')
103
+ self.user_id = attributes[:'user_id']
104
+ else
105
+ self.user_id = nil
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @type.nil?
115
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @type.nil?
126
+ type_validator = EnumAttributeValidator.new('String', ["service_key", "user", "anon", "project", "execution"])
127
+ return false unless type_validator.valid?(@type)
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method checking allowed values (enum).
132
+ # @param [Object] type Object to be assigned
133
+ def type=(type)
134
+ validator = EnumAttributeValidator.new('String', ["service_key", "user", "anon", "project", "execution"])
135
+ unless validator.valid?(type)
136
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
137
+ end
138
+ @type = type
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ type == o.type &&
147
+ user_id == o.user_id
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [type, user_id].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ transformed_hash = {}
169
+ openapi_types.each_pair do |key, type|
170
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = nil
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[attribute_map[key]].is_a?(Array)
176
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
177
+ end
178
+ elsif !attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
180
+ end
181
+ end
182
+ new(transformed_hash)
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ end
202
+
203
+ end
@@ -0,0 +1,165 @@
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
+ # The registered session. Its token reaches the workflow through the workflow itself, never in this response.
18
+ class DurableMessageSessionRegistration < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::DurableMessageSessionRegistration` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::DurableMessageSessionRegistration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'id')
68
+ self.id = attributes[:'id']
69
+ else
70
+ self.id = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @id.nil?
80
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @id.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] id Value to be assigned
96
+ def id=(id)
97
+ if id.nil?
98
+ fail ArgumentError, 'id cannot be nil'
99
+ end
100
+
101
+ @id = id
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ id == o.id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,43 @@
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 DurableMessageStatus
18
+ QUEUED = "queued".freeze
19
+ DELIVERING = "delivering".freeze
20
+ DELIVERED = "delivered".freeze
21
+ DROPPED = "dropped".freeze
22
+ PUBLISHED = "published".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [QUEUED, DELIVERING, DELIVERED, DROPPED, PUBLISHED].freeze
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if DurableMessageStatus.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #DurableMessageStatus"
41
+ end
42
+ end
43
+ end