zitadel-client 1.5.0 → 1.6.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zitadel/client/api/action_service_api.rb +670 -0
  3. data/lib/zitadel/client/api/settings_service_api.rb +125 -0
  4. data/lib/zitadel/client/api/web_key_service_api.rb +273 -0
  5. data/lib/zitadel/client/models/action_service_beta_condition.rb +257 -0
  6. data/lib/zitadel/client/models/action_service_beta_create_target_response.rb +251 -0
  7. data/lib/zitadel/client/models/action_service_beta_delete_target_response.rb +231 -0
  8. data/lib/zitadel/client/models/action_service_beta_event_execution.rb +307 -0
  9. data/lib/zitadel/client/models/action_service_beta_execution.rb +262 -0
  10. data/lib/zitadel/client/models/action_service_beta_execution_target_type.rb +240 -0
  11. data/lib/zitadel/client/models/action_service_beta_function_execution.rb +230 -0
  12. data/lib/zitadel/client/models/action_service_beta_get_target_response.rb +230 -0
  13. data/lib/zitadel/client/models/action_service_beta_in_target_i_ds_filter.rb +233 -0
  14. data/lib/zitadel/client/models/action_service_beta_list_execution_functions_response.rb +232 -0
  15. data/lib/zitadel/client/models/action_service_beta_list_execution_methods_response.rb +232 -0
  16. data/lib/zitadel/client/models/action_service_beta_list_execution_services_response.rb +232 -0
  17. data/lib/zitadel/client/models/action_service_beta_list_executions_response.rb +241 -0
  18. data/lib/zitadel/client/models/action_service_beta_list_targets_response.rb +241 -0
  19. data/lib/zitadel/client/models/action_service_beta_pagination_request.rb +251 -0
  20. data/lib/zitadel/client/models/action_service_beta_pagination_response.rb +241 -0
  21. data/lib/zitadel/client/models/action_service_beta_r_e_s_t_call.rb +231 -0
  22. data/lib/zitadel/client/models/action_service_beta_r_e_s_t_webhook.rb +231 -0
  23. data/lib/zitadel/client/models/action_service_beta_request_execution.rb +307 -0
  24. data/lib/zitadel/client/models/action_service_beta_response_execution.rb +307 -0
  25. data/lib/zitadel/client/models/action_service_beta_set_execution_response.rb +231 -0
  26. data/lib/zitadel/client/models/action_service_beta_target.rb +315 -0
  27. data/lib/zitadel/client/models/action_service_beta_target_field_name.rb +48 -0
  28. data/lib/zitadel/client/models/action_service_beta_target_name_filter.rb +283 -0
  29. data/lib/zitadel/client/models/action_service_beta_target_search_filter.rb +239 -0
  30. data/lib/zitadel/client/models/action_service_beta_text_filter_method.rb +47 -0
  31. data/lib/zitadel/client/models/action_service_beta_update_target_response.rb +241 -0
  32. data/lib/zitadel/client/models/action_service_create_target_request.rb +332 -0
  33. data/lib/zitadel/client/models/action_service_list_targets_request.rb +275 -0
  34. data/lib/zitadel/client/models/action_service_protobuf_any.rb +230 -0
  35. data/lib/zitadel/client/models/action_service_rpc_status.rb +250 -0
  36. data/lib/zitadel/client/models/action_service_set_execution_request.rb +242 -0
  37. data/lib/zitadel/client/models/action_service_update_target_request.rb +342 -0
  38. data/lib/zitadel/client/models/web_key_service_beta_activate_web_key_response.rb +231 -0
  39. data/lib/zitadel/client/models/web_key_service_beta_create_web_key_response.rb +241 -0
  40. data/lib/zitadel/client/models/web_key_service_beta_delete_web_key_response.rb +231 -0
  41. data/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a.rb +254 -0
  42. data/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a_curve.rb +43 -0
  43. data/lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb +232 -0
  44. data/lib/zitadel/client/models/web_key_service_beta_r_s_a.rb +265 -0
  45. data/lib/zitadel/client/models/web_key_service_beta_r_s_a_bits.rb +43 -0
  46. data/lib/zitadel/client/models/web_key_service_beta_r_s_a_hasher.rb +43 -0
  47. data/lib/zitadel/client/models/web_key_service_beta_state.rb +44 -0
  48. data/lib/zitadel/client/models/web_key_service_beta_web_key.rb +289 -0
  49. data/lib/zitadel/client/models/web_key_service_create_web_key_request.rb +248 -0
  50. data/lib/zitadel/client/models/web_key_service_protobuf_any.rb +230 -0
  51. data/lib/zitadel/client/models/web_key_service_rpc_status.rb +250 -0
  52. data/lib/zitadel/client/version.rb +1 -1
  53. data/lib/zitadel/client/zitadel.rb +9 -5
  54. data/sig/lib.rbs +2 -0
  55. metadata +51 -3
  56. data/lib/zitadel/client/api/settings_api.rb +0 -147
@@ -0,0 +1,307 @@
1
+ =begin
2
+ #Zitadel SDK
3
+
4
+ #The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zitadel::Client::Models
17
+ class ActionServiceBetaRequestExecution
18
+ # GRPC-method as condition.
19
+ attr_accessor :method
20
+
21
+ # GRPC-service as condition.
22
+ attr_accessor :service
23
+
24
+ # All calls to any available services and methods as condition.
25
+ attr_accessor :all
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'method' => :'method',
31
+ :'service' => :'service',
32
+ :'all' => :'all'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'method' => :'String',
50
+ :'service' => :'String',
51
+ :'all' => :'Boolean'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Models attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ # MODIFIED: Updated class name in error message
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaRequestExecution` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ # MODIFIED: Updated class name in error message
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaRequestExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'method')
80
+ self.method = attributes[:'method']
81
+ end
82
+
83
+ if attributes.key?(:'service')
84
+ self.service = attributes[:'service']
85
+ end
86
+
87
+ if attributes.key?(:'all')
88
+ self.all = attributes[:'all']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ if !@method.nil? && @method.to_s.length > 1000
98
+ invalid_properties.push('invalid value for "method", the character length must be smaller than or equal to 1000.')
99
+ end
100
+
101
+ if !@method.nil? && @method.to_s.length < 1
102
+ invalid_properties.push('invalid value for "method", the character length must be great than or equal to 1.')
103
+ end
104
+
105
+ if !@service.nil? && @service.to_s.length > 1000
106
+ invalid_properties.push('invalid value for "service", the character length must be smaller than or equal to 1000.')
107
+ end
108
+
109
+ if !@service.nil? && @service.to_s.length < 1
110
+ invalid_properties.push('invalid value for "service", the character length must be great than or equal to 1.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if !@method.nil? && @method.to_s.length > 1000
121
+ return false if !@method.nil? && @method.to_s.length < 1
122
+ return false if !@service.nil? && @service.to_s.length > 1000
123
+ return false if !@service.nil? && @service.to_s.length < 1
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] method Value to be assigned
129
+ def method=(method)
130
+ if method.nil?
131
+ fail ArgumentError, 'method cannot be nil'
132
+ end
133
+
134
+ if method.to_s.length > 1000
135
+ fail ArgumentError, 'invalid value for "method", the character length must be smaller than or equal to 1000.'
136
+ end
137
+
138
+ if method.to_s.length < 1
139
+ fail ArgumentError, 'invalid value for "method", the character length must be great than or equal to 1.'
140
+ end
141
+
142
+ @method = method
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] service Value to be assigned
147
+ def service=(service)
148
+ if service.nil?
149
+ fail ArgumentError, 'service cannot be nil'
150
+ end
151
+
152
+ if service.to_s.length > 1000
153
+ fail ArgumentError, 'invalid value for "service", the character length must be smaller than or equal to 1000.'
154
+ end
155
+
156
+ if service.to_s.length < 1
157
+ fail ArgumentError, 'invalid value for "service", the character length must be great than or equal to 1.'
158
+ end
159
+
160
+ @service = service
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ method == o.method &&
169
+ service == o.service &&
170
+ all == o.all
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [method, service, all].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Models attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash) # `new` will call the initialize method of the specific model class.
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def self._deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name
246
+ # MODIFIED: Ensure model is looked up in the Models namespace
247
+ # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails")
248
+ klass = Zitadel::Client::Models.const_get(type)
249
+ # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache)
250
+ # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself)
251
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf)
252
+ klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method
253
+ else
254
+ klass.build_from_hash(value) # For regular models
255
+ end
256
+ end
257
+ end
258
+
259
+ # Returns the string representation of the object
260
+ # @return [String] String presentation of the object
261
+ def to_s
262
+ to_hash.to_s
263
+ end
264
+
265
+ # to_body is an alias to to_hash (backward compatibility)
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_body
268
+ to_hash
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {} # Calls super.to_hash if parent exists
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ # Outputs non-array value in the form of hash
288
+ # For object, use to_hash. Otherwise, just return the value
289
+ # @param [Object] value Any valid value
290
+ # @return [Hash] Returns the value in the form of hash
291
+ def _to_hash(value)
292
+ if value.is_a?(Array)
293
+ value.compact.map { |v| _to_hash(v) }
294
+ elsif value.is_a?(Hash)
295
+ {}.tap do |hash|
296
+ value.each { |k, v| hash[k] = _to_hash(v) }
297
+ end
298
+ elsif value.respond_to? :to_hash
299
+ value.to_hash
300
+ else
301
+ value
302
+ end
303
+ end
304
+
305
+ end
306
+
307
+ end
@@ -0,0 +1,307 @@
1
+ =begin
2
+ #Zitadel SDK
3
+
4
+ #The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zitadel::Client::Models
17
+ class ActionServiceBetaResponseExecution
18
+ # GRPC-method as condition.
19
+ attr_accessor :method
20
+
21
+ # GRPC-service as condition.
22
+ attr_accessor :service
23
+
24
+ # All calls to any available services and methods as condition.
25
+ attr_accessor :all
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'method' => :'method',
31
+ :'service' => :'service',
32
+ :'all' => :'all'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'method' => :'String',
50
+ :'service' => :'String',
51
+ :'all' => :'Boolean'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Models attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ # MODIFIED: Updated class name in error message
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaResponseExecution` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ # MODIFIED: Updated class name in error message
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaResponseExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'method')
80
+ self.method = attributes[:'method']
81
+ end
82
+
83
+ if attributes.key?(:'service')
84
+ self.service = attributes[:'service']
85
+ end
86
+
87
+ if attributes.key?(:'all')
88
+ self.all = attributes[:'all']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ if !@method.nil? && @method.to_s.length > 1000
98
+ invalid_properties.push('invalid value for "method", the character length must be smaller than or equal to 1000.')
99
+ end
100
+
101
+ if !@method.nil? && @method.to_s.length < 1
102
+ invalid_properties.push('invalid value for "method", the character length must be great than or equal to 1.')
103
+ end
104
+
105
+ if !@service.nil? && @service.to_s.length > 1000
106
+ invalid_properties.push('invalid value for "service", the character length must be smaller than or equal to 1000.')
107
+ end
108
+
109
+ if !@service.nil? && @service.to_s.length < 1
110
+ invalid_properties.push('invalid value for "service", the character length must be great than or equal to 1.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if !@method.nil? && @method.to_s.length > 1000
121
+ return false if !@method.nil? && @method.to_s.length < 1
122
+ return false if !@service.nil? && @service.to_s.length > 1000
123
+ return false if !@service.nil? && @service.to_s.length < 1
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] method Value to be assigned
129
+ def method=(method)
130
+ if method.nil?
131
+ fail ArgumentError, 'method cannot be nil'
132
+ end
133
+
134
+ if method.to_s.length > 1000
135
+ fail ArgumentError, 'invalid value for "method", the character length must be smaller than or equal to 1000.'
136
+ end
137
+
138
+ if method.to_s.length < 1
139
+ fail ArgumentError, 'invalid value for "method", the character length must be great than or equal to 1.'
140
+ end
141
+
142
+ @method = method
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] service Value to be assigned
147
+ def service=(service)
148
+ if service.nil?
149
+ fail ArgumentError, 'service cannot be nil'
150
+ end
151
+
152
+ if service.to_s.length > 1000
153
+ fail ArgumentError, 'invalid value for "service", the character length must be smaller than or equal to 1000.'
154
+ end
155
+
156
+ if service.to_s.length < 1
157
+ fail ArgumentError, 'invalid value for "service", the character length must be great than or equal to 1.'
158
+ end
159
+
160
+ @service = service
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ method == o.method &&
169
+ service == o.service &&
170
+ all == o.all
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [method, service, all].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Models attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash) # `new` will call the initialize method of the specific model class.
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def self._deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name
246
+ # MODIFIED: Ensure model is looked up in the Models namespace
247
+ # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails")
248
+ klass = Zitadel::Client::Models.const_get(type)
249
+ # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache)
250
+ # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself)
251
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf)
252
+ klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method
253
+ else
254
+ klass.build_from_hash(value) # For regular models
255
+ end
256
+ end
257
+ end
258
+
259
+ # Returns the string representation of the object
260
+ # @return [String] String presentation of the object
261
+ def to_s
262
+ to_hash.to_s
263
+ end
264
+
265
+ # to_body is an alias to to_hash (backward compatibility)
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_body
268
+ to_hash
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {} # Calls super.to_hash if parent exists
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ # Outputs non-array value in the form of hash
288
+ # For object, use to_hash. Otherwise, just return the value
289
+ # @param [Object] value Any valid value
290
+ # @return [Hash] Returns the value in the form of hash
291
+ def _to_hash(value)
292
+ if value.is_a?(Array)
293
+ value.compact.map { |v| _to_hash(v) }
294
+ elsif value.is_a?(Hash)
295
+ {}.tap do |hash|
296
+ value.each { |k, v| hash[k] = _to_hash(v) }
297
+ end
298
+ elsif value.respond_to? :to_hash
299
+ value.to_hash
300
+ else
301
+ value
302
+ end
303
+ end
304
+
305
+ end
306
+
307
+ end