authentik-api 2026.5.5 → 2026.8.0.rc1

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 (182) hide show
  1. checksums.yaml +4 -4
  2. data/README_API.md +105 -9
  3. data/lib/authentik/api/api/admin_api.rb +3 -0
  4. data/lib/authentik/api/api/core_api.rb +651 -27
  5. data/lib/authentik/api/api/endpoints_api.rb +7 -7
  6. data/lib/authentik/api/api/events_api.rb +35 -2
  7. data/lib/authentik/api/api/lifecycle_api.rb +258 -0
  8. data/lib/authentik/api/api/providers_api.rb +401 -0
  9. data/lib/authentik/api/api/requests_api.rb +1858 -0
  10. data/lib/authentik/api/api/sources_api.rb +6 -3
  11. data/lib/authentik/api/configuration.rb +14 -0
  12. data/lib/authentik/api/inflector.rb +2 -1
  13. data/lib/authentik/api/models/app_enum.rb +3 -1
  14. data/lib/authentik/api/models/application.rb +27 -1
  15. data/lib/authentik/api/models/authenticator_web_authn_stage.rb +1 -11
  16. data/lib/authentik/api/models/authenticator_web_authn_stage_request.rb +1 -11
  17. data/lib/authentik/api/models/brand.rb +21 -1
  18. data/lib/authentik/api/models/brand_request.rb +21 -1
  19. data/lib/authentik/api/models/captcha_stage.rb +32 -1
  20. data/lib/authentik/api/models/captcha_stage_request.rb +32 -1
  21. data/lib/authentik/api/models/compatibility_mode_enum.rb +2 -1
  22. data/lib/authentik/api/models/content_type.rb +30 -4
  23. data/lib/authentik/api/models/current_brand.rb +19 -1
  24. data/lib/authentik/api/models/current_brand_flags.rb +1 -55
  25. data/lib/authentik/api/models/device_user_binding.rb +39 -1
  26. data/lib/authentik/api/models/event_actions.rb +6 -1
  27. data/lib/authentik/api/models/grant_request.rb +382 -0
  28. data/lib/authentik/api/models/{reviewer_group.rb → grant_request_create_request.rb} +29 -42
  29. data/lib/authentik/api/models/{grant_types_enum.rb → grant_type_enum.rb} +5 -4
  30. data/lib/authentik/api/models/last_task_status_enum.rb +2 -1
  31. data/lib/authentik/api/models/ldap_outpost_config.rb +1 -1
  32. data/lib/authentik/api/models/ldap_source.rb +14 -4
  33. data/lib/authentik/api/models/ldap_source_request.rb +14 -4
  34. data/lib/authentik/api/models/lifecycle_rule.rb +2 -2
  35. data/lib/authentik/api/models/model_enum.rb +8 -1
  36. data/lib/authentik/api/models/notification_mode_enum.rb +35 -0
  37. data/lib/authentik/api/models/o_auth2_dynamic_client_registration.rb +291 -0
  38. data/lib/authentik/api/models/o_auth2_dynamic_client_registration_request.rb +303 -0
  39. data/lib/authentik/api/models/o_auth2_provider.rb +1 -1
  40. data/lib/authentik/api/models/o_auth2_provider_request.rb +1 -1
  41. data/lib/authentik/api/models/o_auth_source.rb +0 -60
  42. data/lib/authentik/api/models/o_auth_source_request.rb +0 -60
  43. data/lib/authentik/api/models/object_attribute.rb +420 -0
  44. data/lib/authentik/api/models/object_attribute_request.rb +358 -0
  45. data/lib/authentik/api/models/object_attribute_type_enum.rb +35 -0
  46. data/lib/authentik/api/models/offboarding_action_enum.rb +34 -0
  47. data/lib/authentik/api/models/offboarding_status_enum.rb +36 -0
  48. data/lib/authentik/api/models/paginated_grant_request_list.rb +214 -0
  49. data/lib/authentik/api/models/paginated_o_auth2_dynamic_client_registration_list.rb +214 -0
  50. data/lib/authentik/api/models/paginated_object_attribute_list.rb +214 -0
  51. data/lib/authentik/api/models/paginated_request_rule_binding_list.rb +214 -0
  52. data/lib/authentik/api/models/paginated_request_rule_child_binding_list.rb +214 -0
  53. data/lib/authentik/api/models/paginated_request_rule_list.rb +214 -0
  54. data/lib/authentik/api/models/paginated_requestable_target_list.rb +214 -0
  55. data/lib/authentik/api/models/paginated_user_offboarding_list.rb +214 -0
  56. data/lib/authentik/api/models/patched_authenticator_web_authn_stage_request.rb +1 -11
  57. data/lib/authentik/api/models/patched_brand_request.rb +21 -1
  58. data/lib/authentik/api/models/patched_captcha_stage_request.rb +32 -1
  59. data/lib/authentik/api/models/patched_grant_request_fulfill_request.rb +175 -0
  60. data/lib/authentik/api/models/patched_ldap_source_request.rb +14 -4
  61. data/lib/authentik/api/models/patched_o_auth2_dynamic_client_registration_request.rb +286 -0
  62. data/lib/authentik/api/models/patched_o_auth2_provider_request.rb +1 -1
  63. data/lib/authentik/api/models/patched_o_auth_source_request.rb +0 -60
  64. data/lib/authentik/api/models/patched_object_attribute_request.rb +320 -0
  65. data/lib/authentik/api/models/patched_request_rule_binding_request.rb +249 -0
  66. data/lib/authentik/api/models/patched_request_rule_child_binding_request.rb +159 -0
  67. data/lib/authentik/api/models/patched_request_rule_request.rb +277 -0
  68. data/lib/authentik/api/models/patched_saml_source_request.rb +8 -8
  69. data/lib/authentik/api/models/patched_settings_request.rb +30 -1
  70. data/lib/authentik/api/models/patched_settings_request_flags.rb +1 -1
  71. data/lib/authentik/api/models/patched_ws_federation_provider_request.rb +11 -1
  72. data/lib/authentik/api/models/policy_binding.rb +42 -4
  73. data/lib/authentik/api/models/provider_type_enum.rb +2 -3
  74. data/lib/authentik/api/models/related_rule.rb +2 -2
  75. data/lib/authentik/api/models/related_target.rb +266 -0
  76. data/lib/authentik/api/models/request_content_type_enum.rb +34 -0
  77. data/lib/authentik/api/models/request_rule.rb +329 -0
  78. data/lib/authentik/api/models/request_rule_binding.rb +353 -0
  79. data/lib/authentik/api/models/request_rule_binding_request.rb +283 -0
  80. data/lib/authentik/api/models/{reviewer_user.rb → request_rule_child_binding.rb} +34 -99
  81. data/lib/authentik/api/models/request_rule_child_binding_request.rb +193 -0
  82. data/lib/authentik/api/models/request_rule_request.rb +284 -0
  83. data/lib/authentik/api/models/request_status.rb +36 -0
  84. data/lib/authentik/api/models/requestable_target.rb +278 -0
  85. data/lib/authentik/api/models/review.rb +1 -1
  86. data/lib/authentik/api/models/saml_source.rb +35 -8
  87. data/lib/authentik/api/models/saml_source_request.rb +8 -8
  88. data/lib/authentik/api/models/saml_version_enum.rb +34 -0
  89. data/lib/authentik/api/models/session_user.rb +32 -4
  90. data/lib/authentik/api/models/settings.rb +30 -1
  91. data/lib/authentik/api/models/settings_request.rb +30 -1
  92. data/lib/authentik/api/models/system_info.rb +31 -4
  93. data/lib/authentik/api/models/task_aggregated_status_enum.rb +2 -1
  94. data/lib/authentik/api/models/task_status_enum.rb +2 -1
  95. data/lib/authentik/api/models/user_offboarding.rb +379 -0
  96. data/lib/authentik/api/models/user_offboarding_request.rb +237 -0
  97. data/lib/authentik/api/models/user_self.rb +28 -1
  98. data/lib/authentik/api/models/user_switch_action_enum.rb +34 -0
  99. data/lib/authentik/api/models/user_switch_request.rb +173 -0
  100. data/lib/authentik/api/models/user_switch_response.rb +159 -0
  101. data/lib/authentik/api/models/ws_federation_provider.rb +41 -4
  102. data/lib/authentik/api/models/ws_federation_provider_request.rb +11 -1
  103. data/lib/authentik/api/version.rb +1 -1
  104. data/spec/api/admin_api_spec.rb +1 -0
  105. data/spec/api/core_api_spec.rb +119 -0
  106. data/spec/api/events_api_spec.rb +11 -0
  107. data/spec/api/lifecycle_api_spec.rb +47 -0
  108. data/spec/api/providers_api_spec.rb +73 -0
  109. data/spec/api/requests_api_spec.rb +365 -0
  110. data/spec/api/sources_api_spec.rb +2 -1
  111. data/spec/models/application_spec.rb +6 -0
  112. data/spec/models/authenticator_web_authn_stage_request_spec.rb +0 -6
  113. data/spec/models/authenticator_web_authn_stage_spec.rb +0 -6
  114. data/spec/models/brand_request_spec.rb +12 -0
  115. data/spec/models/brand_spec.rb +12 -0
  116. data/spec/models/captcha_stage_request_spec.rb +6 -0
  117. data/spec/models/captcha_stage_spec.rb +6 -0
  118. data/spec/models/content_type_spec.rb +6 -0
  119. data/spec/models/current_brand_flags_spec.rb +0 -12
  120. data/spec/models/current_brand_spec.rb +12 -0
  121. data/spec/models/device_user_binding_spec.rb +12 -0
  122. data/spec/models/grant_request_create_request_spec.rb +36 -0
  123. data/spec/models/grant_request_spec.rb +90 -0
  124. data/spec/models/{grant_types_enum_spec.rb → grant_type_enum_spec.rb} +6 -6
  125. data/spec/models/ldap_source_request_spec.rb +6 -0
  126. data/spec/models/ldap_source_spec.rb +6 -0
  127. data/spec/models/notification_mode_enum_spec.rb +24 -0
  128. data/spec/models/o_auth2_dynamic_client_registration_request_spec.rb +78 -0
  129. data/spec/models/o_auth2_dynamic_client_registration_spec.rb +84 -0
  130. data/spec/models/object_attribute_request_spec.rb +84 -0
  131. data/spec/models/object_attribute_spec.rb +108 -0
  132. data/spec/models/object_attribute_type_enum_spec.rb +24 -0
  133. data/spec/models/offboarding_action_enum_spec.rb +24 -0
  134. data/spec/models/offboarding_status_enum_spec.rb +24 -0
  135. data/spec/models/paginated_grant_request_list_spec.rb +42 -0
  136. data/spec/models/paginated_o_auth2_dynamic_client_registration_list_spec.rb +42 -0
  137. data/spec/models/paginated_object_attribute_list_spec.rb +42 -0
  138. data/spec/models/paginated_request_rule_binding_list_spec.rb +42 -0
  139. data/spec/models/paginated_request_rule_child_binding_list_spec.rb +42 -0
  140. data/spec/models/paginated_request_rule_list_spec.rb +42 -0
  141. data/spec/models/paginated_requestable_target_list_spec.rb +42 -0
  142. data/spec/models/paginated_user_offboarding_list_spec.rb +42 -0
  143. data/spec/models/patched_authenticator_web_authn_stage_request_spec.rb +0 -6
  144. data/spec/models/patched_brand_request_spec.rb +12 -0
  145. data/spec/models/patched_captcha_stage_request_spec.rb +6 -0
  146. data/spec/models/patched_grant_request_fulfill_request_spec.rb +36 -0
  147. data/spec/models/patched_ldap_source_request_spec.rb +6 -0
  148. data/spec/models/patched_o_auth2_dynamic_client_registration_request_spec.rb +78 -0
  149. data/spec/models/patched_object_attribute_request_spec.rb +84 -0
  150. data/spec/models/patched_request_rule_binding_request_spec.rb +60 -0
  151. data/spec/models/patched_request_rule_child_binding_request_spec.rb +42 -0
  152. data/spec/models/patched_request_rule_request_spec.rb +72 -0
  153. data/spec/models/patched_saml_source_request_spec.rb +1 -1
  154. data/spec/models/patched_settings_request_spec.rb +6 -0
  155. data/spec/models/patched_ws_federation_provider_request_spec.rb +6 -0
  156. data/spec/models/policy_binding_spec.rb +12 -0
  157. data/spec/models/related_target_spec.rb +54 -0
  158. data/spec/models/request_content_type_enum_spec.rb +24 -0
  159. data/spec/models/request_rule_binding_request_spec.rb +60 -0
  160. data/spec/models/request_rule_binding_spec.rb +84 -0
  161. data/spec/models/request_rule_child_binding_request_spec.rb +42 -0
  162. data/spec/models/{reviewer_user_spec.rb → request_rule_child_binding_spec.rb} +8 -14
  163. data/spec/models/request_rule_request_spec.rb +72 -0
  164. data/spec/models/request_rule_spec.rb +84 -0
  165. data/spec/models/request_status_spec.rb +24 -0
  166. data/spec/models/requestable_target_spec.rb +60 -0
  167. data/spec/models/saml_source_request_spec.rb +1 -1
  168. data/spec/models/saml_source_spec.rb +7 -1
  169. data/spec/models/saml_version_enum_spec.rb +24 -0
  170. data/spec/models/session_user_spec.rb +6 -0
  171. data/spec/models/settings_request_spec.rb +6 -0
  172. data/spec/models/settings_spec.rb +6 -0
  173. data/spec/models/system_info_spec.rb +6 -0
  174. data/spec/models/user_offboarding_request_spec.rb +54 -0
  175. data/spec/models/user_offboarding_spec.rb +90 -0
  176. data/spec/models/user_self_spec.rb +6 -0
  177. data/spec/models/user_switch_action_enum_spec.rb +24 -0
  178. data/spec/models/{reviewer_group_spec.rb → user_switch_request_spec.rb} +8 -8
  179. data/spec/models/user_switch_response_spec.rb +30 -0
  180. data/spec/models/ws_federation_provider_request_spec.rb +6 -0
  181. data/spec/models/ws_federation_provider_spec.rb +12 -0
  182. metadata +127 -10
@@ -0,0 +1,420 @@
1
+ =begin
2
+ This file is automatically generated by: https://openapi-generator.tech.
3
+ Any manual changes will be lost when the OpenAPI scheme changes.
4
+
5
+ =end
6
+
7
+ require 'date'
8
+ require 'time'
9
+
10
+ module Authentik::Api
11
+ class ObjectAttribute < ApiModelBase
12
+ attr_accessor :pk
13
+
14
+ attr_accessor :object_type
15
+
16
+ attr_accessor :object_type_obj
17
+
18
+ attr_accessor :enabled
19
+
20
+ attr_accessor :created
21
+
22
+ attr_accessor :key
23
+
24
+ attr_accessor :label
25
+
26
+ attr_accessor :last_updated
27
+
28
+ attr_accessor :regex
29
+
30
+ attr_accessor :type
31
+
32
+ attr_accessor :group
33
+
34
+ # Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
35
+ attr_accessor :managed
36
+
37
+ attr_accessor :is_unique
38
+
39
+ attr_accessor :is_required
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'pk' => :'pk',
67
+ :'object_type' => :'object_type',
68
+ :'object_type_obj' => :'object_type_obj',
69
+ :'enabled' => :'enabled',
70
+ :'created' => :'created',
71
+ :'key' => :'key',
72
+ :'label' => :'label',
73
+ :'last_updated' => :'last_updated',
74
+ :'regex' => :'regex',
75
+ :'type' => :'type',
76
+ :'group' => :'group',
77
+ :'managed' => :'managed',
78
+ :'is_unique' => :'is_unique',
79
+ :'is_required' => :'is_required'
80
+ }
81
+ end
82
+
83
+ # Returns attribute mapping this model knows about
84
+ def self.acceptable_attribute_map
85
+ attribute_map
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ acceptable_attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'pk' => :'String',
97
+ :'object_type' => :'String',
98
+ :'object_type_obj' => :'ContentType',
99
+ :'enabled' => :'Boolean',
100
+ :'created' => :'Time',
101
+ :'key' => :'String',
102
+ :'label' => :'String',
103
+ :'last_updated' => :'Time',
104
+ :'regex' => :'String',
105
+ :'type' => :'ObjectAttributeTypeEnum',
106
+ :'group' => :'String',
107
+ :'managed' => :'String',
108
+ :'is_unique' => :'Boolean',
109
+ :'is_required' => :'Boolean'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ :'managed',
117
+ ])
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ if (!attributes.is_a?(Hash))
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::ObjectAttribute` initialize method"
125
+ end
126
+
127
+ # check to see if the attribute exists and convert string to symbol for hash key
128
+ acceptable_attribute_map = self.class.acceptable_attribute_map
129
+ attributes = attributes.each_with_object({}) { |(k, v), h|
130
+ if (!acceptable_attribute_map.key?(k.to_sym))
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::ObjectAttribute`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
132
+ end
133
+ h[k.to_sym] = v
134
+ }
135
+
136
+ if attributes.key?(:'pk')
137
+ self.pk = attributes[:'pk']
138
+ else
139
+ self.pk = nil
140
+ end
141
+
142
+ if attributes.key?(:'object_type')
143
+ self.object_type = attributes[:'object_type']
144
+ else
145
+ self.object_type = nil
146
+ end
147
+
148
+ if attributes.key?(:'object_type_obj')
149
+ self.object_type_obj = attributes[:'object_type_obj']
150
+ else
151
+ self.object_type_obj = nil
152
+ end
153
+
154
+ if attributes.key?(:'enabled')
155
+ self.enabled = attributes[:'enabled']
156
+ else
157
+ self.enabled = true
158
+ end
159
+
160
+ if attributes.key?(:'created')
161
+ self.created = attributes[:'created']
162
+ else
163
+ self.created = nil
164
+ end
165
+
166
+ if attributes.key?(:'key')
167
+ self.key = attributes[:'key']
168
+ else
169
+ self.key = nil
170
+ end
171
+
172
+ if attributes.key?(:'label')
173
+ self.label = attributes[:'label']
174
+ else
175
+ self.label = nil
176
+ end
177
+
178
+ if attributes.key?(:'last_updated')
179
+ self.last_updated = attributes[:'last_updated']
180
+ else
181
+ self.last_updated = nil
182
+ end
183
+
184
+ if attributes.key?(:'regex')
185
+ self.regex = attributes[:'regex']
186
+ end
187
+
188
+ if attributes.key?(:'type')
189
+ self.type = attributes[:'type']
190
+ else
191
+ self.type = nil
192
+ end
193
+
194
+ if attributes.key?(:'group')
195
+ self.group = attributes[:'group']
196
+ end
197
+
198
+ if attributes.key?(:'managed')
199
+ self.managed = attributes[:'managed']
200
+ end
201
+
202
+ if attributes.key?(:'is_unique')
203
+ self.is_unique = attributes[:'is_unique']
204
+ end
205
+
206
+ if attributes.key?(:'is_required')
207
+ self.is_required = attributes[:'is_required']
208
+ end
209
+ end
210
+
211
+ # Show invalid properties with the reasons. Usually used together with valid?
212
+ # @return Array for valid properties with the reasons
213
+ def list_invalid_properties
214
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
215
+ invalid_properties = Array.new
216
+ if @pk.nil?
217
+ invalid_properties.push('invalid value for "pk", pk cannot be nil.')
218
+ end
219
+
220
+ if @object_type.nil?
221
+ invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
222
+ end
223
+
224
+ if @object_type_obj.nil?
225
+ invalid_properties.push('invalid value for "object_type_obj", object_type_obj cannot be nil.')
226
+ end
227
+
228
+ if @created.nil?
229
+ invalid_properties.push('invalid value for "created", created cannot be nil.')
230
+ end
231
+
232
+ if @key.nil?
233
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
234
+ end
235
+
236
+ if @label.nil?
237
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
238
+ end
239
+
240
+ if @last_updated.nil?
241
+ invalid_properties.push('invalid value for "last_updated", last_updated cannot be nil.')
242
+ end
243
+
244
+ if @type.nil?
245
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
246
+ end
247
+
248
+ invalid_properties
249
+ end
250
+
251
+ # Check to see if the all the properties in the model are valid
252
+ # @return true if the model is valid
253
+ def valid?
254
+ warn '[DEPRECATED] the `valid?` method is obsolete'
255
+ return false if @pk.nil?
256
+ return false if @object_type.nil?
257
+ return false if @object_type_obj.nil?
258
+ return false if @created.nil?
259
+ return false if @key.nil?
260
+ return false if @label.nil?
261
+ return false if @last_updated.nil?
262
+ return false if @type.nil?
263
+ true
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] pk Value to be assigned
268
+ def pk=(pk)
269
+ if pk.nil?
270
+ fail ArgumentError, 'pk cannot be nil'
271
+ end
272
+
273
+ @pk = pk
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] object_type Value to be assigned
278
+ def object_type=(object_type)
279
+ if object_type.nil?
280
+ fail ArgumentError, 'object_type cannot be nil'
281
+ end
282
+
283
+ @object_type = object_type
284
+ end
285
+
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] object_type_obj Value to be assigned
288
+ def object_type_obj=(object_type_obj)
289
+ if object_type_obj.nil?
290
+ fail ArgumentError, 'object_type_obj cannot be nil'
291
+ end
292
+
293
+ @object_type_obj = object_type_obj
294
+ end
295
+
296
+ # Custom attribute writer method with validation
297
+ # @param [Object] created Value to be assigned
298
+ def created=(created)
299
+ if created.nil?
300
+ fail ArgumentError, 'created cannot be nil'
301
+ end
302
+
303
+ @created = created
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] key Value to be assigned
308
+ def key=(key)
309
+ if key.nil?
310
+ fail ArgumentError, 'key cannot be nil'
311
+ end
312
+
313
+ @key = key
314
+ end
315
+
316
+ # Custom attribute writer method with validation
317
+ # @param [Object] label Value to be assigned
318
+ def label=(label)
319
+ if label.nil?
320
+ fail ArgumentError, 'label cannot be nil'
321
+ end
322
+
323
+ @label = label
324
+ end
325
+
326
+ # Custom attribute writer method with validation
327
+ # @param [Object] last_updated Value to be assigned
328
+ def last_updated=(last_updated)
329
+ if last_updated.nil?
330
+ fail ArgumentError, 'last_updated cannot be nil'
331
+ end
332
+
333
+ @last_updated = last_updated
334
+ end
335
+
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] type Value to be assigned
338
+ def type=(type)
339
+ if type.nil?
340
+ fail ArgumentError, 'type cannot be nil'
341
+ end
342
+
343
+ @type = type
344
+ end
345
+
346
+ # Checks equality by comparing each attribute.
347
+ # @param [Object] Object to be compared
348
+ def ==(o)
349
+ return true if self.equal?(o)
350
+ self.class == o.class &&
351
+ pk == o.pk &&
352
+ object_type == o.object_type &&
353
+ object_type_obj == o.object_type_obj &&
354
+ enabled == o.enabled &&
355
+ created == o.created &&
356
+ key == o.key &&
357
+ label == o.label &&
358
+ last_updated == o.last_updated &&
359
+ regex == o.regex &&
360
+ type == o.type &&
361
+ group == o.group &&
362
+ managed == o.managed &&
363
+ is_unique == o.is_unique &&
364
+ is_required == o.is_required
365
+ end
366
+
367
+ # @see the `==` method
368
+ # @param [Object] Object to be compared
369
+ def eql?(o)
370
+ self == o
371
+ end
372
+
373
+ # Calculates hash code according to all attributes.
374
+ # @return [Integer] Hash code
375
+ def hash
376
+ [pk, object_type, object_type_obj, enabled, created, key, label, last_updated, regex, type, group, managed, is_unique, is_required].hash
377
+ end
378
+
379
+ # Builds the object from hash
380
+ # @param [Hash] attributes Model attributes in the form of hash
381
+ # @return [Object] Returns the model itself
382
+ def self.build_from_hash(attributes)
383
+ return nil unless attributes.is_a?(Hash)
384
+ attributes = attributes.transform_keys(&:to_sym)
385
+ transformed_hash = {}
386
+ openapi_types.each_pair do |key, type|
387
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
388
+ transformed_hash["#{key}"] = nil
389
+ elsif type =~ /\AArray<(.*)>/i
390
+ # check to ensure the input is an array given that the attribute
391
+ # is documented as an array but the input is not
392
+ if attributes[attribute_map[key]].is_a?(Array)
393
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
394
+ end
395
+ elsif !attributes[attribute_map[key]].nil?
396
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
397
+ end
398
+ end
399
+ new(transformed_hash)
400
+ end
401
+
402
+ # Returns the object in the form of hash
403
+ # @return [Hash] Returns the object in the form of hash
404
+ def to_hash
405
+ hash = {}
406
+ self.class.attribute_map.each_pair do |attr, param|
407
+ value = self.send(attr)
408
+ if value.nil?
409
+ is_nullable = self.class.openapi_nullable.include?(attr)
410
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
411
+ end
412
+
413
+ hash[param] = _to_hash(value)
414
+ end
415
+ hash
416
+ end
417
+
418
+ end
419
+
420
+ end