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,265 @@
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 WebKeyServiceBetaRSA
18
+ attr_accessor :bits
19
+
20
+ attr_accessor :hasher
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'bits' => :'bits',
48
+ :'hasher' => :'hasher'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'bits' => :'WebKeyServiceBetaRSABits',
66
+ :'hasher' => :'WebKeyServiceBetaRSAHasher'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Models attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ # MODIFIED: Updated class name in error message
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaRSA` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ # MODIFIED: Updated class name in error message
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaRSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'bits')
95
+ self.bits = attributes[:'bits']
96
+ else
97
+ self.bits = 'RSA_BITS_UNSPECIFIED'
98
+ end
99
+
100
+ if attributes.key?(:'hasher')
101
+ self.hasher = attributes[:'hasher']
102
+ else
103
+ self.hasher = 'RSA_HASHER_UNSPECIFIED'
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ true
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ bits == o.bits &&
128
+ hasher == o.hasher
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [bits, hasher].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Models attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash) # `new` will call the initialize method of the specific model class.
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def self._deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name
204
+ # MODIFIED: Ensure model is looked up in the Models namespace
205
+ # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails")
206
+ klass = Zitadel::Client::Models.const_get(type)
207
+ # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache)
208
+ # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself)
209
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf)
210
+ klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method
211
+ else
212
+ klass.build_from_hash(value) # For regular models
213
+ end
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {} # Calls super.to_hash if parent exists
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -0,0 +1,43 @@
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 WebKeyServiceBetaRSABits
18
+ RSA_BITS_UNSPECIFIED = "RSA_BITS_UNSPECIFIED".freeze
19
+ RSA_BITS_2048 = "RSA_BITS_2048".freeze
20
+ RSA_BITS_3072 = "RSA_BITS_3072".freeze
21
+ RSA_BITS_4096 = "RSA_BITS_4096".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].freeze
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ return value if WebKeyServiceBetaRSABits.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaRSABits"
40
+ end
41
+ end
42
+
43
+ end
@@ -0,0 +1,43 @@
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 WebKeyServiceBetaRSAHasher
18
+ RSA_HASHER_UNSPECIFIED = "RSA_HASHER_UNSPECIFIED".freeze
19
+ RSA_HASHER_SHA256 = "RSA_HASHER_SHA256".freeze
20
+ RSA_HASHER_SHA384 = "RSA_HASHER_SHA384".freeze
21
+ RSA_HASHER_SHA512 = "RSA_HASHER_SHA512".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [RSA_HASHER_UNSPECIFIED, RSA_HASHER_SHA256, RSA_HASHER_SHA384, RSA_HASHER_SHA512].freeze
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ return value if WebKeyServiceBetaRSAHasher.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaRSAHasher"
40
+ end
41
+ end
42
+
43
+ end
@@ -0,0 +1,44 @@
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 WebKeyServiceBetaState
18
+ STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze
19
+ STATE_INITIAL = "STATE_INITIAL".freeze
20
+ STATE_ACTIVE = "STATE_ACTIVE".freeze
21
+ STATE_INACTIVE = "STATE_INACTIVE".freeze
22
+ STATE_REMOVED = "STATE_REMOVED".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [STATE_UNSPECIFIED, STATE_INITIAL, STATE_ACTIVE, STATE_INACTIVE, STATE_REMOVED].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 WebKeyServiceBetaState.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaState"
41
+ end
42
+ end
43
+
44
+ end
@@ -0,0 +1,289 @@
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 WebKeyServiceBetaWebKey
18
+ # The unique identifier of the key.
19
+ attr_accessor :id
20
+
21
+ # The timestamp of the key creation.
22
+ attr_accessor :creation_date
23
+
24
+ # The timestamp of the last change to the key (e.g. creation, activation, deactivation).
25
+ attr_accessor :change_date
26
+
27
+ attr_accessor :state
28
+
29
+ attr_accessor :rsa
30
+
31
+ attr_accessor :ecdsa
32
+
33
+ attr_accessor :ed25519
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'creation_date' => :'creationDate',
40
+ :'change_date' => :'changeDate',
41
+ :'state' => :'state',
42
+ :'rsa' => :'rsa',
43
+ :'ecdsa' => :'ecdsa',
44
+ :'ed25519' => :'ed25519'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'id' => :'String',
62
+ :'creation_date' => :'Time',
63
+ :'change_date' => :'Time',
64
+ :'state' => :'WebKeyServiceBetaState',
65
+ :'rsa' => :'WebKeyServiceBetaRSA',
66
+ :'ecdsa' => :'WebKeyServiceBetaECDSA',
67
+ :'ed25519' => :'Object'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Models attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ # MODIFIED: Updated class name in error message
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaWebKey` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ # MODIFIED: Updated class name in error message
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaWebKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.key?(:'creation_date')
100
+ self.creation_date = attributes[:'creation_date']
101
+ end
102
+
103
+ if attributes.key?(:'change_date')
104
+ self.change_date = attributes[:'change_date']
105
+ end
106
+
107
+ if attributes.key?(:'state')
108
+ self.state = attributes[:'state']
109
+ else
110
+ self.state = 'STATE_UNSPECIFIED'
111
+ end
112
+
113
+ if attributes.key?(:'rsa')
114
+ self.rsa = attributes[:'rsa']
115
+ end
116
+
117
+ if attributes.key?(:'ecdsa')
118
+ self.ecdsa = attributes[:'ecdsa']
119
+ end
120
+
121
+ if attributes.key?(:'ed25519')
122
+ self.ed25519 = attributes[:'ed25519']
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
+ invalid_properties = Array.new
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ true
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
+ id == o.id &&
147
+ creation_date == o.creation_date &&
148
+ change_date == o.change_date &&
149
+ state == o.state &&
150
+ rsa == o.rsa &&
151
+ ecdsa == o.ecdsa &&
152
+ ed25519 == o.ed25519
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [id, creation_date, change_date, state, rsa, ecdsa, ed25519].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Models attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ transformed_hash = {}
174
+ openapi_types.each_pair do |key, type|
175
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[attribute_map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
+ end
183
+ elsif !attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
185
+ end
186
+ end
187
+ new(transformed_hash) # `new` will call the initialize method of the specific model class.
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param string type Data type
192
+ # @param string value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def self._deserialize(type, value)
195
+ case type.to_sym
196
+ when :Time
197
+ Time.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :Boolean
207
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name
228
+ # MODIFIED: Ensure model is looked up in the Models namespace
229
+ # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails")
230
+ klass = Zitadel::Client::Models.const_get(type)
231
+ # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache)
232
+ # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself)
233
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf)
234
+ klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method
235
+ else
236
+ klass.build_from_hash(value) # For regular models
237
+ end
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {} # Calls super.to_hash if parent exists
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end