authentik-api 2026.5.6 → 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 +104 -8
  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,379 @@
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
+ # Mixin to validate that a valid enterprise license exists before allowing to save the object
12
+ class UserOffboarding < ApiModelBase
13
+ attr_accessor :id
14
+
15
+ attr_accessor :user
16
+
17
+ attr_accessor :user_obj
18
+
19
+ # Absolute time at which the offboarding action is executed.
20
+ attr_accessor :scheduled_at
21
+
22
+ attr_accessor :action
23
+
24
+ # Revoke all of the user's sessions when offboarding.
25
+ attr_accessor :revoke_sessions
26
+
27
+ # Revoke all of the user's tokens when offboarding.
28
+ attr_accessor :revoke_tokens
29
+
30
+ attr_accessor :status
31
+
32
+ attr_accessor :created_by_obj
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :executed_at
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'id' => :'id',
64
+ :'user' => :'user',
65
+ :'user_obj' => :'user_obj',
66
+ :'scheduled_at' => :'scheduled_at',
67
+ :'action' => :'action',
68
+ :'revoke_sessions' => :'revoke_sessions',
69
+ :'revoke_tokens' => :'revoke_tokens',
70
+ :'status' => :'status',
71
+ :'created_by_obj' => :'created_by_obj',
72
+ :'created_at' => :'created_at',
73
+ :'executed_at' => :'executed_at'
74
+ }
75
+ end
76
+
77
+ # Returns attribute mapping this model knows about
78
+ def self.acceptable_attribute_map
79
+ attribute_map
80
+ end
81
+
82
+ # Returns all the JSON keys this model knows about
83
+ def self.acceptable_attributes
84
+ acceptable_attribute_map.values
85
+ end
86
+
87
+ # Attribute type mapping.
88
+ def self.openapi_types
89
+ {
90
+ :'id' => :'String',
91
+ :'user' => :'Integer',
92
+ :'user_obj' => :'PartialUser',
93
+ :'scheduled_at' => :'Time',
94
+ :'action' => :'OffboardingActionEnum',
95
+ :'revoke_sessions' => :'Boolean',
96
+ :'revoke_tokens' => :'Boolean',
97
+ :'status' => :'OffboardingStatusEnum',
98
+ :'created_by_obj' => :'PartialUser',
99
+ :'created_at' => :'Time',
100
+ :'executed_at' => :'Time'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ :'executed_at'
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::UserOffboarding` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ acceptable_attribute_map = self.class.acceptable_attribute_map
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!acceptable_attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::UserOffboarding`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'id')
128
+ self.id = attributes[:'id']
129
+ else
130
+ self.id = nil
131
+ end
132
+
133
+ if attributes.key?(:'user')
134
+ self.user = attributes[:'user']
135
+ else
136
+ self.user = nil
137
+ end
138
+
139
+ if attributes.key?(:'user_obj')
140
+ self.user_obj = attributes[:'user_obj']
141
+ else
142
+ self.user_obj = nil
143
+ end
144
+
145
+ if attributes.key?(:'scheduled_at')
146
+ self.scheduled_at = attributes[:'scheduled_at']
147
+ else
148
+ self.scheduled_at = nil
149
+ end
150
+
151
+ if attributes.key?(:'action')
152
+ self.action = attributes[:'action']
153
+ end
154
+
155
+ if attributes.key?(:'revoke_sessions')
156
+ self.revoke_sessions = attributes[:'revoke_sessions']
157
+ end
158
+
159
+ if attributes.key?(:'revoke_tokens')
160
+ self.revoke_tokens = attributes[:'revoke_tokens']
161
+ end
162
+
163
+ if attributes.key?(:'status')
164
+ self.status = attributes[:'status']
165
+ else
166
+ self.status = nil
167
+ end
168
+
169
+ if attributes.key?(:'created_by_obj')
170
+ self.created_by_obj = attributes[:'created_by_obj']
171
+ else
172
+ self.created_by_obj = nil
173
+ end
174
+
175
+ if attributes.key?(:'created_at')
176
+ self.created_at = attributes[:'created_at']
177
+ else
178
+ self.created_at = nil
179
+ end
180
+
181
+ if attributes.key?(:'executed_at')
182
+ self.executed_at = attributes[:'executed_at']
183
+ else
184
+ self.executed_at = nil
185
+ end
186
+ end
187
+
188
+ # Show invalid properties with the reasons. Usually used together with valid?
189
+ # @return Array for valid properties with the reasons
190
+ def list_invalid_properties
191
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
192
+ invalid_properties = Array.new
193
+ if @id.nil?
194
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
195
+ end
196
+
197
+ if @user.nil?
198
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
199
+ end
200
+
201
+ if @user_obj.nil?
202
+ invalid_properties.push('invalid value for "user_obj", user_obj cannot be nil.')
203
+ end
204
+
205
+ if @scheduled_at.nil?
206
+ invalid_properties.push('invalid value for "scheduled_at", scheduled_at cannot be nil.')
207
+ end
208
+
209
+ if @status.nil?
210
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
211
+ end
212
+
213
+ if @created_by_obj.nil?
214
+ invalid_properties.push('invalid value for "created_by_obj", created_by_obj cannot be nil.')
215
+ end
216
+
217
+ if @created_at.nil?
218
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
219
+ end
220
+
221
+ invalid_properties
222
+ end
223
+
224
+ # Check to see if the all the properties in the model are valid
225
+ # @return true if the model is valid
226
+ def valid?
227
+ warn '[DEPRECATED] the `valid?` method is obsolete'
228
+ return false if @id.nil?
229
+ return false if @user.nil?
230
+ return false if @user_obj.nil?
231
+ return false if @scheduled_at.nil?
232
+ return false if @status.nil?
233
+ return false if @created_by_obj.nil?
234
+ return false if @created_at.nil?
235
+ true
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] id Value to be assigned
240
+ def id=(id)
241
+ if id.nil?
242
+ fail ArgumentError, 'id cannot be nil'
243
+ end
244
+
245
+ @id = id
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] user Value to be assigned
250
+ def user=(user)
251
+ if user.nil?
252
+ fail ArgumentError, 'user cannot be nil'
253
+ end
254
+
255
+ @user = user
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] user_obj Value to be assigned
260
+ def user_obj=(user_obj)
261
+ if user_obj.nil?
262
+ fail ArgumentError, 'user_obj cannot be nil'
263
+ end
264
+
265
+ @user_obj = user_obj
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] scheduled_at Value to be assigned
270
+ def scheduled_at=(scheduled_at)
271
+ if scheduled_at.nil?
272
+ fail ArgumentError, 'scheduled_at cannot be nil'
273
+ end
274
+
275
+ @scheduled_at = scheduled_at
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] status Value to be assigned
280
+ def status=(status)
281
+ if status.nil?
282
+ fail ArgumentError, 'status cannot be nil'
283
+ end
284
+
285
+ @status = status
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] created_by_obj Value to be assigned
290
+ def created_by_obj=(created_by_obj)
291
+ if created_by_obj.nil?
292
+ fail ArgumentError, 'created_by_obj cannot be nil'
293
+ end
294
+
295
+ @created_by_obj = created_by_obj
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] created_at Value to be assigned
300
+ def created_at=(created_at)
301
+ if created_at.nil?
302
+ fail ArgumentError, 'created_at cannot be nil'
303
+ end
304
+
305
+ @created_at = created_at
306
+ end
307
+
308
+ # Checks equality by comparing each attribute.
309
+ # @param [Object] Object to be compared
310
+ def ==(o)
311
+ return true if self.equal?(o)
312
+ self.class == o.class &&
313
+ id == o.id &&
314
+ user == o.user &&
315
+ user_obj == o.user_obj &&
316
+ scheduled_at == o.scheduled_at &&
317
+ action == o.action &&
318
+ revoke_sessions == o.revoke_sessions &&
319
+ revoke_tokens == o.revoke_tokens &&
320
+ status == o.status &&
321
+ created_by_obj == o.created_by_obj &&
322
+ created_at == o.created_at &&
323
+ executed_at == o.executed_at
324
+ end
325
+
326
+ # @see the `==` method
327
+ # @param [Object] Object to be compared
328
+ def eql?(o)
329
+ self == o
330
+ end
331
+
332
+ # Calculates hash code according to all attributes.
333
+ # @return [Integer] Hash code
334
+ def hash
335
+ [id, user, user_obj, scheduled_at, action, revoke_sessions, revoke_tokens, status, created_by_obj, created_at, executed_at].hash
336
+ end
337
+
338
+ # Builds the object from hash
339
+ # @param [Hash] attributes Model attributes in the form of hash
340
+ # @return [Object] Returns the model itself
341
+ def self.build_from_hash(attributes)
342
+ return nil unless attributes.is_a?(Hash)
343
+ attributes = attributes.transform_keys(&:to_sym)
344
+ transformed_hash = {}
345
+ openapi_types.each_pair do |key, type|
346
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
347
+ transformed_hash["#{key}"] = nil
348
+ elsif type =~ /\AArray<(.*)>/i
349
+ # check to ensure the input is an array given that the attribute
350
+ # is documented as an array but the input is not
351
+ if attributes[attribute_map[key]].is_a?(Array)
352
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
353
+ end
354
+ elsif !attributes[attribute_map[key]].nil?
355
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
356
+ end
357
+ end
358
+ new(transformed_hash)
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = self.send(attr)
367
+ if value.nil?
368
+ is_nullable = self.class.openapi_nullable.include?(attr)
369
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
370
+ end
371
+
372
+ hash[param] = _to_hash(value)
373
+ end
374
+ hash
375
+ end
376
+
377
+ end
378
+
379
+ end
@@ -0,0 +1,237 @@
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
+ # Mixin to validate that a valid enterprise license exists before allowing to save the object
12
+ class UserOffboardingRequest < ApiModelBase
13
+ attr_accessor :user
14
+
15
+ # Absolute time at which the offboarding action is executed.
16
+ attr_accessor :scheduled_at
17
+
18
+ attr_accessor :action
19
+
20
+ # Revoke all of the user's sessions when offboarding.
21
+ attr_accessor :revoke_sessions
22
+
23
+ # Revoke all of the user's tokens when offboarding.
24
+ attr_accessor :revoke_tokens
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'user' => :'user',
52
+ :'scheduled_at' => :'scheduled_at',
53
+ :'action' => :'action',
54
+ :'revoke_sessions' => :'revoke_sessions',
55
+ :'revoke_tokens' => :'revoke_tokens'
56
+ }
57
+ end
58
+
59
+ # Returns attribute mapping this model knows about
60
+ def self.acceptable_attribute_map
61
+ attribute_map
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ acceptable_attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'user' => :'Integer',
73
+ :'scheduled_at' => :'Time',
74
+ :'action' => :'OffboardingActionEnum',
75
+ :'revoke_sessions' => :'Boolean',
76
+ :'revoke_tokens' => :'Boolean'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::UserOffboardingRequest` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::UserOffboardingRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'user')
103
+ self.user = attributes[:'user']
104
+ else
105
+ self.user = nil
106
+ end
107
+
108
+ if attributes.key?(:'scheduled_at')
109
+ self.scheduled_at = attributes[:'scheduled_at']
110
+ else
111
+ self.scheduled_at = nil
112
+ end
113
+
114
+ if attributes.key?(:'action')
115
+ self.action = attributes[:'action']
116
+ end
117
+
118
+ if attributes.key?(:'revoke_sessions')
119
+ self.revoke_sessions = attributes[:'revoke_sessions']
120
+ end
121
+
122
+ if attributes.key?(:'revoke_tokens')
123
+ self.revoke_tokens = attributes[:'revoke_tokens']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
131
+ invalid_properties = Array.new
132
+ if @user.nil?
133
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
134
+ end
135
+
136
+ if @scheduled_at.nil?
137
+ invalid_properties.push('invalid value for "scheduled_at", scheduled_at cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @user.nil?
148
+ return false if @scheduled_at.nil?
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] user Value to be assigned
154
+ def user=(user)
155
+ if user.nil?
156
+ fail ArgumentError, 'user cannot be nil'
157
+ end
158
+
159
+ @user = user
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] scheduled_at Value to be assigned
164
+ def scheduled_at=(scheduled_at)
165
+ if scheduled_at.nil?
166
+ fail ArgumentError, 'scheduled_at cannot be nil'
167
+ end
168
+
169
+ @scheduled_at = scheduled_at
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ user == o.user &&
178
+ scheduled_at == o.scheduled_at &&
179
+ action == o.action &&
180
+ revoke_sessions == o.revoke_sessions &&
181
+ revoke_tokens == o.revoke_tokens
182
+ end
183
+
184
+ # @see the `==` method
185
+ # @param [Object] Object to be compared
186
+ def eql?(o)
187
+ self == o
188
+ end
189
+
190
+ # Calculates hash code according to all attributes.
191
+ # @return [Integer] Hash code
192
+ def hash
193
+ [user, scheduled_at, action, revoke_sessions, revoke_tokens].hash
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def self.build_from_hash(attributes)
200
+ return nil unless attributes.is_a?(Hash)
201
+ attributes = attributes.transform_keys(&:to_sym)
202
+ transformed_hash = {}
203
+ openapi_types.each_pair do |key, type|
204
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
205
+ transformed_hash["#{key}"] = nil
206
+ elsif type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[attribute_map[key]].is_a?(Array)
210
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
211
+ end
212
+ elsif !attributes[attribute_map[key]].nil?
213
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
214
+ end
215
+ end
216
+ new(transformed_hash)
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -23,6 +23,9 @@ module Authentik::Api
23
23
 
24
24
  attr_accessor :is_superuser
25
25
 
26
+ # Return whether this user owns the current browser session.
27
+ attr_accessor :is_current
28
+
26
29
  attr_accessor :groups
27
30
 
28
31
  attr_accessor :roles
@@ -72,6 +75,7 @@ module Authentik::Api
72
75
  :'name' => :'name',
73
76
  :'is_active' => :'is_active',
74
77
  :'is_superuser' => :'is_superuser',
78
+ :'is_current' => :'is_current',
75
79
  :'groups' => :'groups',
76
80
  :'roles' => :'roles',
77
81
  :'email' => :'email',
@@ -101,6 +105,7 @@ module Authentik::Api
101
105
  :'name' => :'String',
102
106
  :'is_active' => :'Boolean',
103
107
  :'is_superuser' => :'Boolean',
108
+ :'is_current' => :'Boolean',
104
109
  :'groups' => :'Array<UserSelfGroups>',
105
110
  :'roles' => :'Array<UserSelfRoles>',
106
111
  :'email' => :'String',
@@ -164,6 +169,12 @@ module Authentik::Api
164
169
  self.is_superuser = nil
165
170
  end
166
171
 
172
+ if attributes.key?(:'is_current')
173
+ self.is_current = attributes[:'is_current']
174
+ else
175
+ self.is_current = nil
176
+ end
177
+
167
178
  if attributes.key?(:'groups')
168
179
  if (value = attributes[:'groups']).is_a?(Array)
169
180
  self.groups = value
@@ -251,6 +262,10 @@ module Authentik::Api
251
262
  invalid_properties.push('invalid value for "is_superuser", is_superuser cannot be nil.')
252
263
  end
253
264
 
265
+ if @is_current.nil?
266
+ invalid_properties.push('invalid value for "is_current", is_current cannot be nil.')
267
+ end
268
+
254
269
  if @groups.nil?
255
270
  invalid_properties.push('invalid value for "groups", groups cannot be nil.')
256
271
  end
@@ -293,6 +308,7 @@ module Authentik::Api
293
308
  return false if @name.nil?
294
309
  return false if @is_active.nil?
295
310
  return false if @is_superuser.nil?
311
+ return false if @is_current.nil?
296
312
  return false if @groups.nil?
297
313
  return false if @roles.nil?
298
314
  return false if !@email.nil? && @email.to_s.length > 254
@@ -362,6 +378,16 @@ module Authentik::Api
362
378
  @is_superuser = is_superuser
363
379
  end
364
380
 
381
+ # Custom attribute writer method with validation
382
+ # @param [Object] is_current Value to be assigned
383
+ def is_current=(is_current)
384
+ if is_current.nil?
385
+ fail ArgumentError, 'is_current cannot be nil'
386
+ end
387
+
388
+ @is_current = is_current
389
+ end
390
+
365
391
  # Custom attribute writer method with validation
366
392
  # @param [Object] groups Value to be assigned
367
393
  def groups=(groups)
@@ -446,6 +472,7 @@ module Authentik::Api
446
472
  name == o.name &&
447
473
  is_active == o.is_active &&
448
474
  is_superuser == o.is_superuser &&
475
+ is_current == o.is_current &&
449
476
  groups == o.groups &&
450
477
  roles == o.roles &&
451
478
  email == o.email &&
@@ -465,7 +492,7 @@ module Authentik::Api
465
492
  # Calculates hash code according to all attributes.
466
493
  # @return [Integer] Hash code
467
494
  def hash
468
- [pk, username, name, is_active, is_superuser, groups, roles, email, avatar, uid, settings, type, system_permissions].hash
495
+ [pk, username, name, is_active, is_superuser, is_current, groups, roles, email, avatar, uid, settings, type, system_permissions].hash
469
496
  end
470
497
 
471
498
  # Builds the object from hash