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